Skip to content

Commit

Permalink
Added L5.3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Flobbo authored and Flobbo committed Jun 21, 2018
1 parent 423fb44 commit 0cdf000
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Crudable/Commands/CrudCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@ protected function getStub(){
return;
}

/**
* Parse the class name and format according to the root namespace.
* Added from Laravel to fix issue in L5.3
* @param string $name
* @return string
*/
protected function qualifyClass($name){
$name = ltrim($name, '\\/');

$rootNamespace = $this->rootNamespace();

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

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

return $this->qualifyClass(
$this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name
);
}

/**
* Get the fully-qualified model class name.
*
Expand Down

0 comments on commit 0cdf000

Please sign in to comment.