Method: 1. Add the handle function method in "verifyCsrfTkoen.php" of middleware to disable tokens in the entire project; 2. Use "protected $except=['Shield routes that do not submit tokens']" in Just block some routes and disable them.
#The operating environment of this article: Windows 10 system, Laravel version 6, Dell G3 computer.
Method 1:
Add function method handle in verifyCsrfTkoen.php of middleware to disable token in the entire project;
Method 2:
is defined in protected $except = ['Shield routes that do not require token submission'], this can Blocking some routes in the project does not require the use of tokens, making it more flexible to use
Extended knowledge:
Comment out the selected line and the entire project can turn off tokens
[Related recommendations: laravel video tutorial]
The above is the detailed content of How to remove token verification in laravel. For more information, please follow other related articles on the PHP Chinese website!