![]() When you start a new application, Laravel provides a way to include boilerplate code for user registration/login/forgot password functionality, plus the authentication middleware and an easy way to protect routes so they’re only available to logged-in users. Laravel handles user authentication by default through its ‘auth’ middleware. ![]() When the controller returns a response, the response again goes through all response middlewares in sequence before it’s passed to the web server. Once all active middlewares are applied, the request (which might be modified at this point) arrives at the controller that’s responsible for handling it. When each middleware is applied, the framework calls its handle() which allows you to read the request, modify/tweak it if necessary and continue with the next middleware (or, under certain conditions, redirect the user or deny access). Middlewares are applied sequentially (like pipes in Unix). There are two types of middleware: request middlewares (applied before the HTTP request goes to the controller) and response middlewares (applied after the controller generates a response and before the response goes to the Web server).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |