Title, when reading a document (Chinese) found the term guard, which is defined in the document "guard defines how the user authenticates in each request", and then there is a "custom Guard" chapter, and then I get confused, what does this Guard mean.
is multi-user authentication The meaning of it? Different names of the guard isolated, different certification??
Http://laravelacademy.org/post/3074.html#ipt_kb_toc_3074_23
Besides, what does provide mean ....
Reply content:
Title, when reading a document (Chinese) found the term guard, which is defined in the document "guard defines how the user authenticates in each request", and then there is a "custom Guard" chapter, and then I get confused, what does this Guard mean.
is multi-user authentication The meaning of it? Different names of the guard isolated, different certification??
Http://laravelacademy.org/post/3074.html#ipt_kb_toc_3074_23
Besides, what does provide mean ....
In fact, whether it is guard or provide, you can understand. A plug-in for a particular feature.
Laravel is a foreigner's thing, pay attention to elegance, so make different things into independent and good-looking things (seems to explain the faulty wordings)
Then let's talk about the official usage of these things.
Guard, as the Chinese meaning of this time, is the meaning of the guard, that is, the janitor.
His role is to deal with a certification, to determine whether each request, call is logged in, or allowed to pass, in fact, this middleware can also be implemented. But, as an elegant framework, nature has an elegant collation.
You can log in with a password, create a GUARD,QQ login, and create another guard. Any login form you want to verify, or interface validation, can be encapsulated as a separate guard to invoke.
As for provide, it is not the exclusive of authentication here, he is the core of the laravel in the comparison of things. Official translations are called service providers.
There are only a few agreed methods in him, roughly. Run this service when executing the boot, and registering some things for this service register as well as hooks or something. The main purpose is to provide a variety of services for the framework.
For example, you create a service that formats the output, which translates the non-character values of the output JSON into character types when executed. The service then registers under the output object. Called Showmyjson, then you can use it directly in the output.
Feel you will listen to confused ... Laravel just contact really bad understanding. Just take it easy. Just like assembling a robot. If you need anything, just put it in a place.
Take a closer look at the official documents: Https://laravel.com/docs/5.2/authentication#adding-custom-guards
Or come to my station https://laravist.com/, a lot of knowledge have in-depth explanation