Have you tried belongsTo instead? I'm assuming this a one-to-one relationship.
ddimaria said:
Have you tried belongsTo instead? I'm assuming this a one-to-one relationship.
No, more than one account can have the same type, so it's not one-to-one.
try
public function type() {
return belongsTo('App\\AccountType', 'account_id', 'id');
}
and access it by
{{ $user->type->web_descr }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community