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

RudolfFussek's avatar

TokenMismatchException

Hey,

I have Laravel 5.4 and a problem whit the post from a form. When I click the submit button, then I have a error:

"in VerifyCsrfToken.php (line 68)"

My form are look:

{{ csrf_field() }}
<input type="text" name="name" value="{{ old('name') }}" required >
<input type="password" name="password" value="{{ old('password') }} required>

My route (web.php): Route::get('user/registration', 'Frontend\Usersystem\RegistrationController@index'); Route::post('user/registration', 'Frontend\Usersystem\RegistrationController@postRegistration');

What is the problem? :o... Thanks for your help <3.

0 likes
4 replies
LJ90's avatar

Did you wrap everything properly in a form tag, like so:

<form method="POST" action="...">
    {{ csrf_field() }}
    <input ...>
    // ...more inputs
    <button type="submit">Submit</button>
</form>

RudolfFussek's avatar
RudolfFussek
OP
Best Answer
Level 1

Sorry, I forgot to insert the complete HTML tag.

This is my HTML Code and I became the error:

<form method="POST" action="{{ URL::to('/user/registration') }}">
    {{ csrf_field() }}
    
    <input type="text" name="name" value="{{ old('name') }}" required >
    <input type="password" name="password" value="{{ old('password') }} required>
</form>
RudolfFussek's avatar

No, the problem is'nt solved.

I have add a button insed the form tag, the same error.

Please or to participate in this conversation.