[This answer is more suitable for newer versions of Laravel (namely Laravel 5)]
The first time Auth::user() called, it will retrieve the results from the database and save them in a variable.
But on subsequent calls, it will extract the results from the variable.
This can be seen from the following code in framemwork:
public function user() { ...
Now, if we make changes to the model, the changes will automatically reflect on the object. It will not contain old values. Therefore, it is usually not necessary to retrieve data from the database.
However, there are some rare circumstances in which it would be useful to reuse data from the database (for example, make sure the database uses the default values ββor if changes were made to the model by another request). To do this, run the fresh() method as follows:
Auth::user()->fresh()
Yahya Uddin
source share