Skip to content

Commit

Permalink
Merge pull request #14 from jyrkidn/feature/laravel-6
Browse files Browse the repository at this point in the history
Make compatible with Laravel 6
  • Loading branch information
Naoray authored Jun 5, 2020
2 parents 0021c9b + 3c7d8f9 commit fe6adbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
}
],
"require": {
"illuminate/pipeline": "^7.0",
"illuminate/support": "^7.0",
"illuminate/pipeline": "^6.0 || ^7.0",
"illuminate/support": "^6.0 || ^7.0",
"laravel-shift/blueprint": "^1.9"
},
"require-dev": {
"orchestra/testbench": "^5.0",
"orchestra/testbench": "^4.0 || ^5.0",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^9.0"
},
Expand Down
9 changes: 4 additions & 5 deletions src/NovaGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,14 @@ protected function populateStub(string $stub, Model $model): string

protected function getNovaNamespace(Model $model): string
{
$namespace = Str::of($model->fullyQualifiedNamespace())
->after(config('blueprint.namespace'))
->prepend(config('blueprint.namespace').'\Nova');
$namespace = Str::after($model->fullyQualifiedNamespace(), config('blueprint.namespace'));
$namespace = config('blueprint.namespace').'\Nova'.$namespace;

if (config('blueprint.models_namespace')) {
$namespace = $namespace->replace('\\'.config('blueprint.models_namespace'), '');
$namespace = str_replace('\\'.config('blueprint.models_namespace'), '', $namespace);
}

return $namespace->__toString();
return $namespace;
}

public function registerTask(Task $task): void
Expand Down

0 comments on commit fe6adbf

Please sign in to comment.