jeudi 31 décembre 2015

Laravel 5 authentication middleware always redirects to root or login

When I protect routes in Laravel 5 it works well when I'm not logged in because it redirects the protected routes to the login page but once I login and try to access the protected routes it redirects me to the root route. For example if I try to access /people or /people/1 it will redirect me to /

Here's my routes.php file:

Route::get('/', function () {
 return view('welcome');
});

Route::group(['middleware' => ['auth']], function () {
 Route::resource('people', 'PeopleController');
 Route::resource('people.checkins', 'CheckinsController');
 Route::model('checkins', 'Checkin');
 Route::model('people', 'Person');

 Route::bind('checkins', function($value, $route) {
    return App\Checkin::whereId($value)->first();
 });
 Route::bind('people', function($value, $route) {
    return App\Person::whereId($value)->first();
 });
});

Route::group(['middleware' => 'web'], function () {
 Route::auth();

 Route::get('/home', 'HomeController@index');
});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1UjcixG
via IFTTT

1 commentaire: