oxbir
2 months ago
451
3
Laravel

Dropzone CSRF token mismatch

Posted 2 months ago by oxbir

I am using Dropzone to upload images using Laravel 5. After Dropzone makes the put call to my URL I get the following error:

dropzone

upload.blade.php

<div class="dropzone" id="drop">

</div>

header

@section('style')
    <link rel="stylesheet" href="{{ asset('themes/css/dropzone.css') }}">
@endsection

script.js

<script src="{{ asset('themes/js/dropzone.js') }}"></script>
<script>
    Dropzone.autoDiscover = false;
    $(document).ready(function(){
        $('#drop').dropzone({
            url: '{{ route('dropzone') }}',
            method: 'post'
        });
    });
</script>

Please sign in or create an account to participate in this conversation.