realty/app/Http/Controllers/API/v1/UserController.php
/**
     * Display a listing of the resource.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
Display a listing of the resource .
public function index(Request $request)
    {
        $this->authorize('viewAny', User::class);
        $filter = new UsersFilter($request);
        return UserResource::collection(
            auth()->user()
                ->company
                ->users()
                ->filter($filter)->paginate()
        );
    }
public function index ( Request $ request ) { $ this -> authorize ( 'viewAny' , User :: class ) ; $ filter = new UsersFilter ( $ request ) ; return UserResource :: collection ( auth ( ) -> user ( ) -> company -> users ( ) -> filter ( $ filter ) -> paginate ( ) ) ; }
Display a listing of the resource.
Display a listing of the resource .