Prevent Browser back button after Logout in Laravel 5.3

When you click back button after logout , still that page will appear. This is not you are actually logged it, just browser cached previous page. If you try to interact with that page, it will not display. Because you were not authenticated. To solve this type problem, simply create a middleware to handle this type of problems as follows.

Create Middleware :

Add code into Middleware :

Register middleware into kernal.php :

Put the middleware into routes :