ERROR: Call to a member function paginate () on array

0

The query if it comes out in the base what does not come out is already in the part of the paginate (); I get error Call to a member function paginate () on array

$usuario=DB::select('select a.id,cedula, a.name, a.apellido,a.usuario_creo,email, perfil, estado,
 (select b.name from users as b where b.id=a.usuario_creo)as nom_creo,
 (select b.apellido from users as b where b.id=a.usuario_creo)as ape_creo,
(select b.name from users as b where b.id=a.usuario_edito)as nom_edito,
(select b.apellido from users as b where b.id=a.usuario_edito)as ape_edito
from users as a where a.eliminar_usuario=?',["NO_ELIMINADO"])->paginate(10);
    
asked by Lioni_Lee 28.09.2018 в 12:00
source

1 answer

0

I was able to solve with the following code:

$usuario=DB::table('users as a')->select('a.id','a.cedula', 'a.name','a.apellido','a.email', 'a.perfil', 'a.estado',
(DB::raw("(select b.name from users as b where b.id=a.usuario_creo)as nom_creo")),
(DB::raw("(select b.apellido from users as b where b.id=a.usuario_creo)as ape_creo")),
(DB::raw("(select b.name from users as b where b.id=a.usuario_edito)as nom_edito")),
(DB::raw("(select b.apellido from users as b where b.id=a.usuario_edito)as ape_edito")))
->where('a.eliminar_usuario','=','NO_ELIMINADO')->paginate(10);
    
answered by 28.09.2018 в 13:14