Change your email preferences function
public function emailPreferences()
{
return $this->hasOne('EmailPreference');
}
Then update your call
$user = Auth::user();
echo '<pre>';
print_r($user->emailPreferences);
exit;
When you call $user->email_preferences, Eloquent will try and call $user->emailPreferences() but because this method doesn't exist, it'll return null. See here for more info.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community