So, I have a “noms” relation in provider model, i want, if role is manager, to return all models from noms.
I have this:
{
return $this->hasMany(Nom::class);
}
want something like:
{
if($this->role === "manager"){
return Nom::all
}
return $this->hasMany(Nom::class);
}
New contributor