On your footer.blade.php Add this :
<script type="text/javascript"> $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); </script>Hi, jst send token
like this:
$.ajax({
method: "POST",
url: {your url},
data: {data: {your some data}, _token: "{{ csrf_field() }}"}
});
But better way, I advise to add the url in exception fot CSRFtoken Middleware. App\Http\Middleware\VerifyCsrfToken.php
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community