Level 24
Try this:
$results->setCollection($results->filter(function($item) {
return $item->id != \Auth::user()->id;
}));
I have the following code.
$results = $user->paginate(3);
if(\Auth::check()){
$results = $results->filter(function($item) {
return $item->id != \Auth::user()->id;
});
}
On my blade page I get an error about $results->links() method not existing.
If i just run this code I do not get that error.
$results = $user->paginate(3);
Try this:
$results->setCollection($results->filter(function($item) {
return $item->id != \Auth::user()->id;
}));
Please or to participate in this conversation.