samedi 11 février 2017

Laravel 5.3-5.4 The Difference between $request->user(); and Auth::user();

I was reviewing some of the code logic on my system and wondered about some things. After a person has logged onto the system you can either use $request->user(); or Auth::user(); to get the user object.

My questions are:

  1. What are the key differences between the two other than the obvious ones?
  2. Is the user being pulled from the database in both cases or is one pulling the user object from some stored cache?
  3. Are both cases leveraging passport's functionality to get the user from the database? or is it being pulled from a mystical storage land that is difficult to find?

Thanks in advance, Cheers!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2l4VRwU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire