Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns a parent directory's path
<?php dirname(string $path, int $levels = 1): string
<?php             return Arr::wrap(call_user_func($this->guessPolicyNamesUsingCallback, $class));

        }



        $classDirname = str_replace('/', '\\', dirname(str_replace('\\', '/', $class)));



        $classDirnameSegments = explode('\\', $classDirname);
<?php     protected function ensureCacheDirectoryExists($path)

    {

        $directory = dirname($path);



        if (! $this->files->exists($directory)) {

            $this->files->makeDirectory($directory, 0777, true, true);
<?php             $this->ensurePermissionsAreCorrect($directory);

            $this->ensurePermissionsAreCorrect(dirname($directory));

        }

    }
<?php     protected function makeDirectory($path)

    {

        if (! $this->files->isDirectory(dirname($path))) {

            $this->files->makeDirectory(dirname($path), 0777, true, true);

        }
<?php     protected function makeDirectory($path)

    {

        if (! $this->files->isDirectory(dirname($path))) {

            $this->files->makeDirectory(dirname($path), 0777, true, true);

        }



        return $path;
<?php     protected function path(Connection $connection)

    {

        return tap($this->option('path') ?: database_path('schema/'.$connection->getName().'-schema.sql'), function ($path) {

            (new Filesystem)->ensureDirectoryExists(dirname($path));

        });

    }

}
<?php         $path = $this->getPath($name, $path);



        $this->files->ensureDirectoryExists(dirname($path));



        $this->files->put(

            $path, $this->populateStub($stub, $table)
<?php         $path = realpath($path) ?: $path;



        $tempPath = tempnam(dirname($path), basename($path));




        if (! is_null($mode)) {
<?php             );

        }



        $relativeTarget = (new SymfonyFilesystem)->makePathRelative($target, dirname($link));



        $this->link($this->isFile($target) ? rtrim($relativeTarget, '/') : $relativeTarget, $link);

    }
<?php     protected function ensureDirectoryExists($path)

    {

        if (! file_exists(dirname($path))) {

            @mkdir(dirname($path), 0777, true);

        }

    }
<?php     protected function ensureDirectoryExists($path)

    {

        if (! file_exists(dirname($path))) {

            @mkdir(dirname($path), 0777, true);

        }

    }
<?php     protected function formatFacadeStub($alias, $stub)

    {

        $replacements = [

            str_replace('/', '\\', dirname(str_replace('\\', '/', $alias))),

            class_basename($alias),

            substr($alias, strlen(static::$facadeNamespace)),

        ];
<?php     {

        return match (true) {

            isset($_ENV['APP_BASE_PATH']) => $_ENV['APP_BASE_PATH'],

            default => dirname(array_keys(ClassLoader::getRegisteredLoaders())[0]),

        };

    }
<?php             str_replace('.', '/', 'components.'.$this->getView()).'.blade.php'

        );



        if (! $this->files->isDirectory(dirname($path))) {

            $this->files->makeDirectory(dirname($path), 0777, true, true);

        }
<?php         );



        if (! $this->files->isDirectory(dirname($path))) {

            $this->files->makeDirectory(dirname($path), 0777, true, true);

        }



        if ($this->files->exists($path) && ! $this->option('force')) {