php - Laravel 5 routes of Modules can't working correct when use authentication middleware -
i'm create folder modules in folder app.
i'm config complete.
- module directory structure: module directory structure
module.php
return [ 'modules' => [ 'product', ] ];
routes.php
route::group(['middleware' => 'auth', 'prefix' => 'products', 'namespace' => 'app\modules\product\controllers'], function() { // route::get('/categories', ['as' => 'categories.index', 'uses' => 'categorycontroller@index']); route::get('/', ['as' => 'products.index', 'uses' => 'productcontroller@index']); });
produccontroller.php
namespace app\modules\product\controllers; use illuminate\http\request; use app\http\requests; use app\http\controllers\controller; class productcontroller extends controller { /** * display listing of resource. * * @return \illuminate\http\response */ public function index() { return view('product::product'); } }
but when go http://xxxxxxx.dev/products page redirect welcome page.
if remove 'middleware' => 'auth' routes.php working correct.
please me!
Comments
Post a Comment