Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module artisan command bug #234

Closed
joooseb opened this issue Apr 23, 2018 · 2 comments
Closed

Module artisan command bug #234

joooseb opened this issue Apr 23, 2018 · 2 comments

Comments

@joooseb
Copy link
Contributor

joooseb commented Apr 23, 2018

It create a Admin controller with incorrectly namespace
for example:
php artisan module:make EventCenter
In AdminController.php shows:
namespace Modules\EventCenter\Http\Controllers;
but should be:
namespace Modules\EventCenter\Http\Controllers\Admin;
and it create a wrong admin prefix on routes at ServiceProvider:
/**
* Routes for the admin
/
Route::group([
'as' => 'eventcenter.',
'prefix' => 'api/eventcenter/admin',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web', 'role:admin'],
'namespace' => 'Modules\EventCenter\Http\Controllers\Admin'
], function() {
$this->loadRoutesFrom(DIR . '/../Http/Routes/admin.php');
});
it call a prefix to /api/ should be without /api/:
/
*
* Routes for the admin
*/
Route::group([
'as' => 'eventcenter.',
'prefix' => 'eventcenter/admin',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web', 'role:admin'],
'namespace' => 'Modules\EventCenter\Http\Controllers\Admin'
], function() {
$this->loadRoutesFrom(DIR . '/../Http/Routes/admin.php');
});
If you modify these lines the 404 error at admin route of the module will be fix.

Hope this help you!

@joooseb
Copy link
Contributor Author

joooseb commented Apr 23, 2018

Solved in dev branch

@joooseb joooseb closed this as completed Apr 23, 2018
@nabeelio
Copy link
Owner

Yeah, I need to merge dev into master and will do that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants