Answers for "laravel add csrf methon in ajax"

8

laravel csrf token ajax post

$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});
Posted by: Guest on October-29-2020
0

laravel csrf fields

<form method="POST" action="/profile">
    {{ csrf_field() }}
    ...
</form>
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language