If you do a dd
on Auth::user()->friendRequests()
does it return null?
Also the Laravel error should give you a line number on the compiled template, you can load this up and see where exactly
the variable is being called in the view... should help narrow it down.
public function showFriends()
{
$friends = Auth::user()->friends();
$requests = Auth::user()->friendRequests();
dd($requests);
return view('partials.profile.tabs.friends')
->with('friends', $friends)
->with('requests', $requests);
}
still giving me this error when looking at that view
ErrorException in b6f232bbf42aa25cb3207b233130e734831d1e16.php line 3: Undefined variable: requests (View: C:\Users\Sean\Desktop\wamp64\www\laravel\resources\views\partials\profile\tabs\friends.blade.php) (View: C:\Users\Sean\Desktop\wamp64\www\laravel\resources\views\partials\profile\tabs\friends.blade.php) (View: C:\Users\Sean\Desktop\wamp64\www\laravel\resources\views\partials\profile\tabs\friends.blade.php)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community