[PHP] On Laravel Authentication and providers of guards

From the brief document is concerned, there are some abstraction.

Personal feeling, not for most conceptual understanding mainly from the documents is not about design ideas, but the actual operation.

 

Read full document, in general, can give you the most accurate intuition, and local generally more literal translation or with an understanding of nature.

https://laravel.com/docs/6.x/authentication#introduction

Authentication (the Authentication) assembly is configured config / auth.php, used to distinguish between different mechanisms of authentication behavior, is customizable,

This is one of design ideas.

 

Laravel authentication service consists of two parts, that is, guards and providers.

 

guards in accordance with the meaning of a document, for example, give you a feeling for where, session, file, redis determine the authentication data storage?

If that is the case, there is no need called the guards, called storage than the more direct?

 

Reason to judge guards just a term only, is equivalent to the way, what is the specific use of guards, named their own needs, it can be fileGuards, redisGuards, databaseGuards, mixGuards, firstGuards ...

 

You can now look at the providers, which most of us understand the functional meaning of the service provider, then this is the decision to achieve certification services of the guards, who decide how the method of data transfer.

providers and some guards process is linked makes sense, guards need to providers, providers can belong guards want.

 

I believe that here, then go auth.php actual configuration, these are specific cases under design ideas, do you agree?

 

Link: https://www.cnblogs.com/farwish/p/11790152.html

Guess you like

Origin www.cnblogs.com/farwish/p/11790152.html