Home >PHP Framework >Laravel >How to remove token verification in laravel

How to remove token verification in laravel

WBOY
WBOYOriginal
2022-06-06 10:13:272053browse

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.

How to remove token verification in laravel

#The operating environment of this article: Windows 10 system, Laravel version 6, Dell G3 computer.

How to remove token verification in laravel

Method 1:

Add function method handle in verifyCsrfTkoen.php of middleware to disable token in the entire project;

How to remove token verification in laravel

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

How to remove token verification in laravel

Extended knowledge:

Comment out the selected line and the entire project can turn off tokens

How to remove token verification in laravel

[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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is guard in laravelNext article:What is guard in laravel