Redirect to specified route after logout – Laravel

Redirect after logout

In default Laravel app, once you logout it will redirect to the home page.

But you can change where to redirect after you log out.
Never edit the core files located at your vendor folder that will override when you update the Laravel versions

In Auth\LoginController you have the following trait

You can change it with following

Now you can define the logout function which will override the logout @ AuthenticatesUsers trait

Basically we are calling the logout@AuthenticatesUsers trait by passing the $request and finally redirect where we want after logging out