php - laravel controller, parameter problem in front of method parameters
仅有的幸福
仅有的幸福 2017-06-23 09:11:14
0
3
798

There is a login method in the login controller, and there is a LoginRequest in front of its formal parameter $request. Through the built-in function of phpstorm, I found that clicking it can jump to a LoginRequest.php file, which stores user login restrictions. Conditions and corresponding error messages, what is the name of this usage? In which chapter of the manual can I view it?

仅有的幸福
仅有的幸福

reply all(3)
迷茫

Laravel service container instance tutorial - in-depth understanding of Inversion of Control (IoC) and Dependency Injection (DI)

typecho

This is called Form Request, which means that before the request enters the controller, the request can be verified and authorized.

https://laravel.com/docs/5.4/...

滿天的星座

This is very basic. First of all, if you want to use this, you need to use the request file you want at the front of the controller. If you look at the top of your code, there must be a loginrequest code. You will use this below. For verification, just import it directly. The last step is to edit the loginrequest file to implement the verification rules. This prevents the code from being too lengthy and complex, and separates the various operations clearly. You can find it by searching in the document, just look for the part with request. Haha

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template