Skip to content

Commit

Permalink
Now Model Namespace can be nullable. So App\Model can be created
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldreams committed Nov 21, 2018
1 parent 83d34c7 commit bfdc2ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lara-crud/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ public function getFileName($name)
public function getFullNS($namespace)
{
$rootNs = config('laracrud.rootNamespace', 'App');
if (empty($namespace)) {
return $rootNs;
}
if (substr_compare($namespace, $rootNs, 0, strlen($rootNs)) !== 0) {
return trim($rootNs, "\\") ."\\". $namespace;
return trim($rootNs, "\\") . "\\" . $namespace;
}
return $namespace;
}
Expand Down

0 comments on commit bfdc2ae

Please sign in to comment.