Customize Login routes in Laravel 5.3


Hi, I have a problem with Login routing with the php artisan make: auth method that generates everything you need From now on it's quite difficult for me to join the project I was doing to this login and its views. But it does not let me change the prefedinida route to one that I want

So they come by default:

Route::get('login', 'Auth\[email protected]')->name('login');

Route::post('login', 'Auth\[email protected]');

Route::post('logout', 'Auth\[email protected]');

Thus I customize

Route::get('admin/auth/login', 'Auth\[email protected]')->name('login');

Route::post('admin/auth/login', 'Auth\[email protected]');

Route::post('admin/auth/logout', 'Auth\[email protected]');


use AuthenticatesUsers;

protected $redirectTo = '/';

public function __construct()
    $this->middleware('guest', ['except' => 'logout']);

public function showLoginForm()
    return view('admin.auth.login'); //tambien cambie de dir la carp auth

public function logout(Request $request)



    //return view('inicio');
    return redirect('/');

When I enter the login route, and log in I miss this error:


NotFoundHttpException in RouteCollection.php line 161: ...

asked by Cidius 09.09.2016 в 05:31

1 answer


Indeed, I failed to correct the login.blade.php form for the default provided by Laravel. By placing the correct URL, it works as expected.

form class="form-horizontal" role="form" method="POST" action="{{ url('admin/auth/login') }}"> {{ csrf_field() }}

Remember, there is also the logout form that happens the same.

answered by 09.09.2016 / 15:39