what 's problem in my question ??
Aug 24, 2015
7
Level 2
pagination with union in Laravel
i have problem when try pagination tow union table
$page = Input::get('page', 1);
$paginate = 10;
$members = DB::table("members")
->select("id", "first_name", "last_name", "email", "created_at")
->where("site_id", $id);
$users = DB::table("users")
->select("id", "first_name", "last_name", "email", "created_at")
->where("site_id", $id)
->union($members)
->get();
$slice = array_slice($users, $paginate * ($page - 1), $paginate);
$data = Paginator::make($slice, count($users), $paginate);
return View::make('your_view_name',compact('data'));
this error appear
Class Illuminate\Support\Facades\Paginator does not exist
Please or to participate in this conversation.