bluebeetlept/api-toolkit

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

Maintainers

Package info

github.com/bluebeetlept/api-toolkit

pkg:composer/bluebeetlept/api-toolkit

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.3.0 2026-04-25 23:47 UTC

This package is auto-updated.

Last update: 2026-04-26 00:25:51 UTC


README

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

Installation

composer require bluebeetlept/api-toolkit:^1.0@dev

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 in the docs/ directory, powered by Mintlify.

Testing

composer test