/** * Display a listing of the resource. * * @return Response */ public function index() { // $authuser = Auth::user(); //Super query $cobrosPorConfirmar = CobroPendiente::whereNull('referenciaPago')->orWhere('referenciaPago', '')->orderBy('fecha', 'desc'); //$cobrosConfirmados = CobroPendiente::whereNotNull('referenciaPago')->Where('referenciaPago', '!=', '')->orderBy('fecha', 'desc')->get(); //$cobrospordenados = $cobrosPorConfirmados->merge($cobrosPorConfirmar); //return $cobrospordenados->paginate(10); //$cobrospordenados = $cobrosPorConfirmados->merge($cobrosPorConfirmar); $cobrospordenados = CobroPendiente::whereNotNull('referenciaPago')->orWhere('referenciaPago', '!=', '')->orderBy('fecha', 'desc')->unionAll($cobrosPorConfirmar->getQuery())->get(); return View::make('administracion.pages.pagospendientes.index')->with(array('listaPagosPendientes' => $cobrospordenados, 'usuarioimg' => $authuser->imagen, 'usuarionombre' => $authuser->nombre, 'usuarioid' => $authuser->id)); }