laravel csrf token in form code example
Example 1: laravel csrf token ajax post
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
Example 2: csrf token laravel
{{ csrf_token() }}
{{ csrf_field() }}
Example 3: laravel add crf token form
<form action="{{ url('my-url') }}">
@csrf