Skip to content

I wish there was an *except* method #185

@nanadjei

Description

@nanadjei

The way "only" is available I wish there was an "except" or "exclude" method as well. That can be handy if you have a large amount of data to return and you can't want to go through the pain of adding all those data just to exclude only one data. Like so;

 return responder()->success(User::all())->only('id', 'name', 'height', 'dob', 'hair_color', 'gender', 'contact', 'email', 'residential_address', 'country_of_residence')->respond();

Then you can;

 return responder()->success(User::all())->exclude('create_at', 'updated_at')->respond();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions