Skip to content

Commit

Permalink
Fix qualifyModel problem with Laravel 7 and 6
Browse files Browse the repository at this point in the history
  • Loading branch information
reziamini committed May 26, 2021
1 parent e261327 commit b45e0e7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Commands/Actions/MakeCRUDConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,21 @@ private function resolveStubPath($stub)
: __DIR__.'/../stub/'.$stub;
}

protected function qualifyModel($model)
{
$model = ltrim($model, '\\/');

$model = str_replace('/', '\\', $model);

$rootNamespace = $this->rootNamespace();

if (Str::startsWith($model, $rootNamespace)) {
return $model;
}

return is_dir(app_path('Models'))
? $rootNamespace.'Models\\'.$model
: $rootNamespace.$model;
}

}

0 comments on commit b45e0e7

Please sign in to comment.