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

ruffsaint's avatar

Guys what could be the error with this form

Am getting this error when i submit the form what could be the problem. TokenMismatchException in VerifyCsrfToken.php line 46:



{!! Form::open(array('url' => 'signin', 'class' => 'form-signin')) !!} {!! Form::text('email', null, array('required','class'=>'form-control', 'placeholder'=>'Your e-mail address', 'autofocus'=>'""')) !!} {!! Form::password('password', array('required','class'=>'form-control', 'placeholder'=>'Your Password')) !!}

{!! Form::submit('Login!',array('class'=>'btn btn-lg btn-primary cent')) !!}
    {!!Form::close()!!}
</div>
0 likes
6 replies
TheBlueDragon's avatar

you can add this in your form it solve the problem for me

<input type="hidden" name="_token" value="{!!   csrf_token() !!}" />

i dono exactly why its happen because it happen only with one form other r work fine

davorminchorov's avatar

Form::open() generates a hidden field with the csrf token by default, no need to add it yourself.

bestmomo's avatar

As says @Ruffles Form::open() should generate it, just check in generated HTML that it's done.

absiddiqueLive's avatar

@ruffsaint no error in your form code, it work in my pc. May problem with your mcrypt php extension, check it install and enable or not, if not install and enable

{!! Form::open(array('url' => 'signin', 'class' => 'form-signin')) !!}
{!! Form::text('email', null, array('required','class'=>'form-control', 'placeholder'=>'Your e-mail address', 'autofocus'=>'""')) !!}
{!! Form::password('password', array('required','class'=>'form-control', 'placeholder'=>'Your Password')) !!}
{!! Form::submit('Login!',array('class'=>'btn btn-lg btn-primary cent')) !!}
{!!Form::close()!!}

Please or to participate in this conversation.