What does guard in laravel authentication mean?

Source: Internet
Author: User
For example, when reading the document (Chinese), I found the term Guard, which defines "Guard defines how users implement authentication in each request ", there is a "custom guard" section later, and I am forced to. what does this guard mean. What does multi-user authentication mean ?... For example, when reading the document (Chinese), I found the term Guard, which defines "Guard defines how users implement authentication in each request ", there is a "custom guard" section later, and I am forced to. what does this guard mean.
What does multi-user authentication mean? Guards with different names are isolated for different authentication ??
Http://laravelacademy.org/post/3074.html#ipt_kb_toc_3074_23

In addition, what does provide mean ....

Reply content:

For example, when reading the document (Chinese), I found the term Guard, which defines "Guard defines how users implement authentication in each request ", there is a "custom guard" section later, and I am forced to. what does this guard mean.
What does multi-user authentication mean? Guards with different names are isolated for different authentication ??
Http://laravelacademy.org/post/3074.html#ipt_kb_toc_3074_23

In addition, what does provide mean ....

In fact, whether it is Guard or Provide, you can understand it. A plug-in for a specific function.
Laravel is a foreigner and elegant, so he makes different things independent and nice-looking (it seems that there is a language problem)
Then let's talk about the official usage of these things ..
Guard, like the Chinese meaning of this time, is the meaning of Guard, that is, the door Guard ..
Its role is to process an authentication to determine whether each request or call has been logged on or is allowed to pass. In fact, this middleware can also be implemented. However, as an elegant framework, there is naturally an elegant classification ..
You can log on with a password, create a Guard, log on with QQ, and create another Guard. Any login form you want to verify, or interface verification, can be encapsulated into an independent Guard for calling ..

As for provide, it is not the exclusive authentication here. it is the basic core of Laravel. The official translation is called a service provider.
There are only a few agreed methods, which are roughly. Run the boot command when running the service, and register the register and hooks of some items of the service. The main purpose is to provide various services for the framework.
For example, if you create a service for formatting the output, the service will convert all non-formatted values in the output json into formatted values during execution .. Then the service is registered under the output object. It is called ShowMyJSON, and you can use it directly during output ..

I feel confused... Laravel is not easy to understand. Just take it easy. Just like assembling a robot. You just need to install something somewhere.

Take a closer look at the official documentation it: https://laravel.com/docs/5.2/authentication#adding-custom-guards

Or come to my little station https://laravist.com/, for a lot of knowledge have in-depth explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.