I was wondering if it's possible somehow to automatically load all Auth::user() relationships.
Auth::user() returns an instance of my App\Models\Auth\Usuario.php, and inside Usuario.php class I have some relationships with another models.
The way I'm doing it now manually loads the relations with $user->load('relation') but I need to do it in every request.
I was thinking to do something like this in my base Controller:
public function __construct()
{
$user = Auth::user();
$this->relation = $user->load('relation');
}
But It's not exactly what I'm looking for.
There is another/best way to load all the Auth::user() class relationships? Like middleware or something?