Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Tells whether the filename is a directory
<?php is_dir(string $filename): bool
<?php public function handle()
{
if (! is_dir($stubsPath = base_path('stubs'))) {
(new Filesystem)->makeDirectory($stubsPath);
}
<?php return $model;
}
return is_dir(app_path('Models'))
? $rootNamespace.'Models\\'.$model
: $rootNamespace.$model;
}
<?php protected function possibleModels()
{
$modelPath = is_dir(app_path('Models')) ? app_path('Models') : app_path();
return collect(Finder::create()->files()->depth(0)->in($modelPath))
->map(fn ($file) => $file->getBasename('.php'))
<?php {
$eventPath = app_path('Events');
if (! is_dir($eventPath)) {
return [];
}
<?php return $modelName;
}
if (is_dir(app_path('Models/'))) {
return $this->rootNamespace().'Models\Model';
}
<?php {
$name = str_replace('\\', '/', Str::replaceFirst($this->rootNamespace(), '', $name));
if (is_dir($this->laravel->databasePath().'/seeds')) {
return $this->laravel->databasePath().'/seeds/'.$name.'.php';
}
<?php return $model;
}
return is_dir(app_path('Models'))
? $rootNamespace.'Models\\'.$model
: $rootNamespace.$model;
}
<?php public function isDirectory($directory)
{
return is_dir($directory);
}
<?php $this->instance('path.storage', $this->storagePath());
$this->useBootstrapPath(value(function () {
return is_dir($directory = $this->basePath('.laravel'))
? $directory
: $this->basePath('bootstrap');
}));
<?php }));
$this->useLangPath(value(function () {
return is_dir($directory = $this->resourcePath('lang'))
? $directory
: $this->basePath('lang');
}));
<?php if (! file_exists($echoScriptPath = $this->laravel->resourcePath('js/echo.js'))) {
if (! is_dir($directory = $this->laravel->resourcePath('js'))) {
mkdir($directory, 0755, true);
}
<?php protected function getDefaultNamespace($rootNamespace)
{
return match (true) {
is_dir(app_path('Enums')) => $rootNamespace.'\\Enums',
is_dir(app_path('Enumerations')) => $rootNamespace.'\\Enumerations',
default => $rootNamespace,
};
<?php {
return match (true) {
is_dir(app_path('Enums')) => $rootNamespace.'\\Enums',
is_dir(app_path('Enumerations')) => $rootNamespace.'\\Enumerations',
default => $rootNamespace,
};
}
<?php protected function getDefaultNamespace($rootNamespace)
{
return match (true) {
is_dir(app_path('Contracts')) => $rootNamespace.'\\Contracts',
is_dir(app_path('Interfaces')) => $rootNamespace.'\\Interfaces',
default => $rootNamespace,
};
<?php {
return match (true) {
is_dir(app_path('Contracts')) => $rootNamespace.'\\Contracts',
is_dir(app_path('Interfaces')) => $rootNamespace.'\\Interfaces',
default => $rootNamespace,
};
}