Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
If PR laravel/laravel#4260 is accepted we will no longer need window.Laravel
- Loading branch information
020b783
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DrowningElysium I have read the issue where this was removed, but I do not understand why it was removed. Could you elaborate for me?
020b783
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cannonb4ll I removed it as in the docs it said that adding the csrf meta tag is enough https://laravel.com/docs/5.4/csrf#csrf-x-csrf-token, while this is not the case if you created your layout manually but do wish to use the out of the box js. So you have to generate first the app layout before you can find out that you need to use a object with the token inside to be able to use the out of the box script.
020b783
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah alright, thank you! I still have a project which utilises the JS object in the header, shouldn't be any harm I recon right?
020b783
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah if you just use the old csrf = window.Laravel.csrf then you are fine to use an object. Everyone can choose what they want still.