I have 2 variables both querying the same model. I want to now merge these 2 separate datasets into a variable called $events and then paginate on it.
$archivedEvents = EventModel::where('start_date', '<', Carbon::now())->where('is_private', '=', false); $privateEvents = EventModel::whereIn('id', $userEventIDs)->where('is_private', '=', true); // TODO: Merge $events->paginate(5, ['*'], $eventsPage, null);
How can i do this?
Note the paginate needs to look exactly like above ( use same variables), i have tried manually creating a new paginator but not sure how it resembles ->paginate() function.