Could you please add <meta name="csrf-token" content="{{ csrf_token() }}"> to the master.blade.php?
What's the use of this? Laravel automatically inserts csrf token into your user's session, and you only really need them on form pages, as described in the docs too.
Using LaravelCollective Form library even does adding tokens on forms automatically.
Laravel also checks for CSRF tokens on ajax requests. And if you have no forms on the page, the only way to pass the token to the script is via meta tag.
Aah okay, didn't know that.
A meta tag is only one way to achieve this. I do not want to force one way by adding this tag to the template.
You can easily add this to the template yourself by creating a new blade template with the following contents:
@extends('adminlte::page')
@section('css')
<meta name="csrf-token" content="{{ csrf_token() }}">
@stop
Save this for example as resources/views/layouts/app.blade.php and then use @extends('layouts.app') instead of @extends('adminlte::page')
We're using this one to be able to have multiple css sections:
@extends('adminlte::page')
@push('css')
<meta name="csrf-token" content="{{ csrf_token() }}">
@endpush
Most helpful comment
A meta tag is only one way to achieve this. I do not want to force one way by adding this tag to the template.
You can easily add this to the template yourself by creating a new blade template with the following contents:
Save this for example as
resources/views/layouts/app.blade.phpand then use@extends('layouts.app')instead of@extends('adminlte::page')