Support the ongoing development of Laravel.io →
posted 8 years ago
Eloquent Forms
Last updated 2 years ago.
0

On your footer.blade.php Add this :

<script type="text/javascript"> $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); </script>
0

probably you're sending broken html from the controller ?

0

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

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Xmac xmac Joined 28 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.