Support the ongoing development of Laravel.io →
Requests Session Database
Last updated 1 year ago.
0

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.

0
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)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.