Laravel CSRF-Token en vue
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
Smiling Starling
<head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
</head>
<meta name="csrf-token" content="{{ csrf_token() }}" />
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
</script>
{{ csrf_token() }}
{{ csrf_field() }}
<form method="POST" action="/profile">
@csrf
<input name="name">
<button type="submit">send</button>
</form>
//In laravel 7. Open file \App\Http\Middleware\VerifyCsrfToken.php
//Disable for all routes
protected $except = [
'*',
];
//Disable for some routes
protected $except = [
'mobile/*',
'news/articles',
];
//I searched for a long time how to disable CSRF completely,
//there are many identical examples but they do not help