app/Http/Controllers/UserController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
     {
        $user = User::
             select('users.id','users.nombre','users.fecha_nacimiento','users.apellido','users.cargo','users.telefono','users.email','users.img_perfil','users.horas_disponible','users.horas_gastadas','roles.display_name as roles_id','areas.nombre as areas_id','users.estado','areas.id as id_area','roles.id as id_rol')->join('roles','roles.id','=','users.roles_id')->join('areas','areas.id','=','users.areas_id')->where('users.estado','1')->get();
       return array('recordsTotal'=>count($user),'recordsFiltered'=>count($user),'data'=>$user);
     }
public function index ( ) { $ user = User :: select ( 'users.id' , 'users.nombre' , 'users.fecha_nacimiento' , 'users.apellido' , 'users.cargo' , 'users.telefono' , 'users.email' , 'users.img_perfil' , 'users.horas_disponible' , 'users.horas_gastadas' , 'roles.display_name as roles_id' , 'areas.nombre as areas_id' , 'users.estado' , 'areas.id as id_area' , 'roles.id as id_rol' ) -> join ( 'roles' , 'roles.id' , '=' , 'users.roles_id' ) -> join ( 'areas' , 'areas.id' , '=' , 'users.areas_id' ) -> where ( 'users.estado' , '1' ) -> get ( ) ; return array ( 'recordsTotal' => count ( $ user ) , 'recordsFiltered' => count ( $ user ) , 'data' => $ user ) ; }
Display a listing of the resource.
Display a listing of the resource .
// $user= User::where('estado',1)->get(); // return response()->json($user);