php - laravel 5.3 auth always redirect to login page -
i want create authentication on laravel, have problem. when want access page, page has redirected login page.
here routes
route::auth(); route::get('/news/getid/{id_category}', 'newscontroller@getid'); route::group(['middleware' => ['web', 'auth']], function () { route::resource('news', 'newscontroller', ['except' => ['getid']]); route::resource('category', 'categorycontroller'); });
and here logincontroller
protected $redirectto = '/news'; public function username() { return 'username'; } /** * create new controller instance. * * @return void */ public function __construct() { $this->middleware('guest', ['except' => 'logout']); }
you have comment $this->middleware('auth'); line constructor of "newscontroller". should
public function __construct() { // $this->middleware('auth'); }
note: commenting line, never check authentication view page return controller.
Comments
Post a Comment