2
I am using Laravel 5.1 native authentication but when accessing a protected route the system does not redirect me to the login screen, instead it shows me the message "You don’t have permission to access this Resource".
The routes then this way:
Route::group(['prefix'=>'admin','before' => 'auth','middleware'=>['needsRole:Admin'],'namespace'=>'Admin'], function()
{
Route::resource('/', 'HomeController');
Route::resource('users','UsersController');
Route::resource('stores','StoresController');
Route::resource('templates','TemplatesController');
});
You have to do it by Middleware. Which one are you using ?
– Diego Souza
The routes then like this: http://pastebin.com/EK4JYx7Y
– Neimeg
All right, but Middleware ?
'auth','middleware'=>['needsRole:Admin']
. What’s in that one Middleware ? It will redirect the user.– Diego Souza