Releases: shipsaas/laravel-resource-reducer
Releases · shipsaas/laravel-resource-reducer
v1.1.1
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
v1.0.0 - Initial Release
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 ❤️