Problem page date by rank laravel 5.5


I know that handling paging with a single parameter, I can handle it with a simple appends, like this.

public function bestado(Request $request)
         $valorestado = $request->valorestado;
         $consultarea=usuarios::where('estado', $valorestado)->paginate(6);
         $usuariosOpciones=usuarios::pluck('usuario_ad', 'user_id')->unique();
         return  view('usuario.consultareas',compact('consultarea','usuariosOpciones'));

But if I want to handle the paging with a date by range, there would be two parameters, if I try to handle it with append, as for example, it does not work.

   public function fecha(Request $request)
        $usuarios=usuarios::whereBetween('created_at', [$valoruno, $valordos])->paginate(10);
        $usuarios->appends(['valoruno'=>$valoruno, 'valordos'=>$valordos]);
        $usuariosOpciones=usuarios::pluck('usuario_ad', 'user_id')->unique();
        return  view('usuario.index',compact('usuarios','usuariosOpciones'));

How can I handle paging with a range of dates?

asked by zereft 15.11.2018 в 02:40

0 answers