Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wadey's avatar
Level 2

TokenMismatchException in VerifyCsrfToken.php line 46 error

I know this question has been asked many times and I've tried everyone of them to fix my issue:

I use Laravel auth/login to login to my admin section. It's all worked perfectly well until recently when I added some new routes/views to this section. Now when I try to login, I get the TokenMismatchException in VerifyCsrfToken.php line 46 error.

I have tried php artisan key:generate and I also have the line <input type="hidden" name="_token" value="{{ csrf_token() }}" /> in my form.

This is my routing for the login:

Route::get('auth/register', function() {  return redirect('/'); });
//stops anyone registering

Route::get('admin','AdminPagesController@adminHome');
Route::controllers([
    'auth'      =>  'Auth\AuthController',
    'password'  =>  'Auth\PasswordController',
]);

I've scratched my head and I simply don't understand what the issue is and I'm hoping someone can help.

I'm using Laravel 5

0 likes
0 replies

Please or to participate in this conversation.