Laravel turn off CSRF verification

CSRF verification has been added after Laravel5.2.
The app/Http/Kernel.php file has the following configuration:
insert image description here

global shutdown

// \App\Http\Middleware\VerifyCsrfToken::class

Partially closed

Open the VerifyCsrfToken class file and find the following:
insert image description here
Suppose your route is /login, just write the route address here, you can skip CSRF verification
as follows I want the route at the beginning of api to not do csrf verification, just add 'api /*' will do.
insert image description here

Guess you like

Origin blog.csdn.net/Quiet_tomcat/article/details/91946925