when i try to paginate results passed from the logged in user I get the error:
$message = Auth::user()->Notifications()->orderBy('created_at', 'desc')->get()
->groupBy(function($date) {
return Carbon::parse($date->created_at)->format('M d'); // grouping by day
})
->paginate(2);
Call to undefined method Illuminate\Database\Eloquent\Collection::paginate()
what is the problem and how can I paginate my object array?