Level 2
have any solution?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm using dropzone but I have an error for token mis match exception.I'm trying something like this-
<form method="POST" action="/dashboard/post">
<div class="form-group col-lg-4">
<label class="control-label" for="title">Name:</label>
<input type="text" name="title" id="title" class="form-control input--style"
value="" required>
</div>
<div class="form-group col-lg-4">
<label class="control-label" for="details">details:</label>
<textarea type="text" name="title" id="title" required></textarea>
</div>
<div class="form-group col-lg-4 dropzone dropzone-previews" id="dropzone"></div>
<button class="btn" type="submit">Submit</button>
</form>
@section('dropzone')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="{{url('js/dropzone.js')}}"></script>
<script>
Dropzone.autoDiscover = false;
jQuery(document).ready(function () {
$("div#dropzone").dropzone({
url: "/dashboard/properties",
headers: {
'X-CSRFToken': $('meta[name="token"]').attr('content')
}
});
});
</script>
@endsection
Replace your header by-
headers: {
'x-csrf-token': document.querySelectorAll('meta[name=csrf-token]')[0].getAttributeNode('content').value,
},
I think it should be work
Please or to participate in this conversation.