Jamal Ahmad
Jamal Ahmad

Reputation: 691

The 127.0.0.1 page isn’t working .. Laravel 5.4

we develop an application in Laravel .. Before it was working, but not yet. after login it show me this error The 127.0.0.1 page isn’t working 127.0.0.1 redirected you too many times.

Routes

Route::any('/logout', 'Auth\LoginController@logout');
Route::get('/', 'PageController@login');
Route::get('/home', 'HomeController@index');

Route::group( ['middleware' => 'auth' ], function() {
    Route::get('main', 'PageController@main');
    Route::get('browse', 'PageController@browse');
    Route::get('pickngo', 'PageController@pickngo');
    Route::get('edit_profile', 'PageController@profile');

    Auth::routes();
    Route::post('/user/create', 'Auth\RegisterController@createUser');
    Route::post('/user/login', 'Auth\LoginController@doLogin');

});

Upvotes: 0

Views: 974

Answers (1)

Advaith
Advaith

Reputation: 2580

Its because you are using Auth::routes() inside group(). It is actually wrong because there are many routes wich are having middleware of guest (login, register, etc) So it will keep redirecting to the same page in a infinite loop

Try bringing Auth::routes() to top or bottom of Route::group()

Upvotes: 1

Related Questions