<meta name="csrf-token" content="{{ csrf_token() }}" />
//Go to app/Http/Middleware/VerifyCsrfToken.php and add this values
protected $except = [
'/api/*'
];
Laravel ajax solution:
1. "_token": "{{ csrf_token() }}",
2. headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')},
3.$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
<input type="hidden" name="_token" id="token" value="{{ csrf_token() }}">
protected $except = [
'api/*',
];