app/DataTables/UsersDataTable.php
/**
     * Get the query object to be processed by dataTables.
     *
     * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder|\Illuminate\Support\Collection
     */
Get the query object to be processed by dataTables.
Get the query object to be processed by dataTables .
public function query()
    {
	    $users = Kardex::select();
	    return $this->applyScopes($users);
    }
public function query ( ) { $ users = Kardex :: select ( ) ; return $ this -> applyScopes ( $ users ) ; }
Get the query object to be processed by dataTables.
Get the query object to be processed by dataTables .
//	    $users = Kardex::select('name as Nombre', 'ap_patern as Apellido', 'ci as Carnet', //		    \DB::raw('(CASE WHEN sex <> 0 THEN "Hombre" ELSE "Mujer" END) as Genero'), //		    \DB::raw('(CASE WHEN user_type = 1 THEN "Admin" WHEN user_type = 2 THEN "Empleado" ELSE "Usuario" END) as Cargo') //	    );