Token mismatch exception laravel 5

Token mismatch exception laravel 5

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching.

Larvel has producing number of exceptions via exception handler. In this example we are going to see how to fix token mismatch error in laravel.
Laravel has mainting the session tokens with in the framework. Under App/config/session.php you can find the session life time. I fht eapplication do not active for that particular time the application will throug token mismatch error. Its because of CSRF security.

You can find this coding under filter.php

Here you can redirect to your custom page like below


Simply add the following lines to ./app/start/global.php or routes.php at the “Application Error Handler” – Section there is no need to touch the “CSRF Protection Filter” at all.

If you like this article don’t forget to share and comment.


Happy Coding!.