Tuner Docs

A Laravel package to fine-tune your APIs.

View on GitHub
📚 Documentation

Configuration

By default, Tuner enables most features with minimal setup.
However, you can override the default behavior in your Eloquent models by defining specific configuration methods.



Projection

Define which fields are allowed for projection.

protected function getProjectableFields(): array
{
    return ['*']; // Allow all fields
}


Sorting

Define which fields can be sorted.

protected function getSortableFields(): array
{
    return ['*']; // Allow sorting on all fields
}


Define which fields are searchable.

protected function getSearchableFields(): array
{
    return ['*']; // Allow searching on all fields
}


Filtering

Define which fields are filterable.

protected function getFilterableFields(): array
{
    return ['*']; // Allow filtering on all fields
}


Limiting

Control whether the model can be limited with the limit modifier.

protected function limitable(): bool
{
    return true; // Enable limit for this model
}


Pagination

Control whether the model can use pagination with the per-page modifier.

protected function paginatable(): bool
{
    return true; // Enable pagination for this model
}


Notes

protected function getSortableFields(): array
{
    return ['id', 'name', 'created_at'];
}