vendredi 29 septembre 2017

Redirect issue in middleware for admin login in Laravel

When login to admin,then page is redirect But 'The page isn't redirecting properly' message show. Please help me

Middleware  - IsAdmin.php

    public function handle($request, Closure $next)
    {

         if (Auth::user()->role_id == 1)
        {
            return redirect ('/administrator');
        }

               return $next($request);
    }

web.php

Route::group(['prefix'=>'administrator','as' => 'admin.','middleware' => ['auth'],'middleware' => 'isAdmin'], function(){

    Route::get('/','AdminController@index');

    Route::resource('user','AdminController');

    Route::resource('card','AdminCardController');

});

Thanx in advanced..



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire