bluebeetle/api-toolkit

JSON:API compliant toolkit for building REST APIs with Laravel.

Maintainers

Package info

github.com/bluebeetlept/api-toolkit

pkg:composer/bluebeetle/api-toolkit

Transparency log

Statistics

Installs: 820

Dependents: 0

Suggesters: 0

Stars: 14

Open Issues: 1

v0.8.1 2026-05-25 12:56 UTC

README

Tests Code Analysis License

JSON:API compliant toolkit for building REST APIs with Laravel.

Installation

composer require bluebeetle/api-toolkit

Quick Start

Define a resource:

final class ProductResource extends Resource
{
    protected string $model = Product::class;

    public function attributes(Product $product): array
    {
        return [
            'name' => $product->name,
            'code' => $product->code,
        ];
    }
}

Use it in a controller:

final class ListController
{
    public function __invoke(Request $request)
    {
        return QueryBuilder::for(Product::class, $request)
            ->fromResource(ProductResource::class)
            ->paginate();
    }
}

Documentation

Full documentation is available at bluebeetle.pt/open-source/docs/api-toolkit.

Testing

composer test

Credits

License

Licensed under the MIT license.