I'm trying to work with jQuery File Upload and Laravel, everything works fine but when I start uploading file it shows TokenMismatchException.
<form id="fileupload" action="upload" method="POST" enctype="multipart/form-data">
<span class="btn green fileinput-button">
<i class="fa fa-plus"></i>
<span> Add files... </span>
<input type="file" name="files[]" multiple=""> </span>
...
...
</form>
Controller
public function upload(Request $request) {
dd($request);
}
I tried including
<input type="hidden" name="_token" value="{!! csrf_token() !!}">
But then it shows another error:
Error SyntaxError: Unexpected token <