I have installed OCtoberCMS, and use User Extended plugin to make a profile page.
When i try to use component to show Friends reques, the page throws me an error
Call to a member function take() on array
Here is the function:
public static function listReceivedFriendRequests($limit = 5)
{
$users = new Collection();
$limit = Helpers::unlimited($limit);
$requests = Friend::friendRequests()->take($limit);
foreach ($requests as $user) {
$users->push(UserUtil::getRainlabUser($user->user_that_sent_request));
}
return $users;
}
This happened when user never has an friend request. Onece if they have a friend request this error not show anymore. How can I fix it?
I just tested and make couple of changes. For now is work good, but don`t know is this the best way to do this :D