{!! csrf_field() !!}
The rendered html has to be escaped.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone, I'm tusing the dropzone.js into my laravel aplication like this. https://laracasts.com/series/build-project-flyer-with-me/episodes/11 but when I try upload a file get the message : TokenMismatchException in VerifyCsrfToken.php line 67 here is my form
<div class="col-md-9 main" >
@foreach($archivos as $archivo)
@endforeach
<form action="/carpetas/{{$pac->id_pac}}/{{$directorio->nombre}}" class="dropzone" method="POST">
{{csrf_field() }}
</form>
</div>
Hello everyone, I'm tusing the dropzone.js into my laravel aplication like this. https://laracasts.com/series/build-project-flyer-with-me/episodes/11 but when I try upload a file get the message : TokenMismatchException in VerifyCsrfToken.php line 67 here is my form
<div class="col-md-9 main" >
@foreach($archivos as $archivo)
@endforeach
<form action="/carpetas/{{$pac->id_pac}}/{{$directorio->nombre}}" class="dropzone" method="POST">
{{csrf_field() }}
</form>
</div>
My controller is like this
public function subir(){
return "working...";
}
to make a previous ajax call i change VerifyCsrfToken like this :
protected function tokensMatch($request)
{
// If request is an ajax request, then check to see if token matches token provider in
// the header. This way, we can use CSRF protection in ajax requests also.
$token = $request->ajax() ? $request->header('X-CSRF-Token') : $request->input('_token');
return $request->session()->token() == $token;
}
What I'm making wrong please help me.
Greetings
Please or to participate in this conversation.