Skip to content

Commit

Permalink
Merge pull request #346 from Litiano/master
Browse files Browse the repository at this point in the history
Correct path if slug contains "-"
  • Loading branch information
kaidesu authored Feb 5, 2018
2 parents e72edab + e64d51c commit 5294525
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Console/GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ protected function qualifyClass($name)
protected function getPath($name)
{
$slug = $this->argument('slug');
$module = Module::where('slug', $slug);

// take everything after the module name in the given path (ignoring case)
$key = array_search(strtolower($slug), explode('\\', strtolower($name)));
$key = array_search(strtolower($module['basename']), explode('\\', strtolower($name)));
if ($key === false) {
$newPath = str_replace('\\', '/', $name);
} else {
Expand Down
1 change: 0 additions & 1 deletion src/Console/Generators/stubs/controller.resource.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace DummyNamespace;

use Illuminate\Http\Request;

use DummyRootNamespaceHttp\Requests;
use DummyRootNamespaceHttp\Controllers\Controller;

class DummyClass extends Controller
Expand Down
1 change: 0 additions & 1 deletion src/Console/Generators/stubs/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace DummyNamespace;

use Illuminate\Http\Request;

use DummyRootNamespaceHttp\Requests;
use DummyRootNamespaceHttp\Controllers\Controller;

class DummyClass extends Controller
Expand Down

0 comments on commit 5294525

Please sign in to comment.