Skip to content

Releases: shipsaas/laravel-resource-reducer

v1.1.1

13 Mar 14:29
Compare
Choose a tag to compare

Release v1.1.1

There was a missing configuration in the composer.json, v1.1.1 would fix that 🥹

Apologies for the noise.

v1.1.0

13 Mar 14:25
Compare
Choose a tag to compare

Release v1.1.0

Adds support for Laravel 11.x ❤️

Laravel resource reducer is supporting 10.x & 11.x 😎

v1.0.0 - Initial Release

07 Sep 13:43
Compare
Choose a tag to compare

Release v1.0.0 - Initial Release

Laravel Resource Reducer is finally out and ready to use.

Documentation: https://reducer.shipsaas.tech/

Installation

composer require shipsaas/laravel-resource-reducer

Usage

Backend

class UserResource extends JsonReducerResource
{
    public function definitions(Request $request): array
    {
        return [
            'id' => fn () => $this->id,
            'email' => fn () => $this->email,
            'created_at' => fn () => $this->created_at,
        ];
    }
}

Consumer

http://api/users?_fields[]=id,_fields[]=email // an array of users(id, email) will be returned (no other fields)

Cheers ❤️