I'm trying to return the user name who submitted an article, but unable to access this via an eloquent relationship.
Models/Thing
public function users()
{
return $this->belongsTo(User::class);
}
with user_id stored in the things
table
However this dump isn't returning user data: dd($this->thing->users->name);
Error:
Attempt to read property "name" on null