At the database level, all the users have a profile assigned, when it comes to consulting from the profile model, the users bring it well, but when consulting from the user model the profiles with with () loads only 1 relation for each type of profile and does not load anything for the rest.
User
public function Perfil(){
return $this->belongsTo('App\Perfil','perfil_fk');
}
Profile
public function Users(){
return $this->hasMany('App\User','perfil_fk','id');
}
Other relationships with users work well, including many to many, the user's model is the one that generates authentication by default in laravel.
The problem is with egaer loading At the moment I had to do another query to load the profile, but I really need to do it with -> with ()
$user->Perfil = Perfil::select('nombre','activo')->where('id', $user->perfil_fk)->get()[0];