splendidkeen
4 months ago
93
13
Laravel

Method Illuminate\Support\Collection::paginate does not exist

Posted 4 months ago by splendidkeen

How can I turn my $monday Collection into a query to paginate it?

$doctor = Auth::user()->meeting()->get(); 
$monday = optional($doctor->map->meeting->flatten()->where('start', '=', '12:00:00'))->paginate(2); 

$monday = optional($doctor->map->meeting->flatten()->where('start', '=', '12:00:00'))->take(2); // works

Currently I get a paginate does not exist, as we can only invoke paginate on a Query, not on a Collection.

Method Illuminate\Support\Collection::paginate does not exist

Please sign in or create an account to participate in this conversation.