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 columns are allowed for projection.
protected function getProjectableColumns(): array
{
return ['*']; // Allow all columns
}
Sorting
Define which columns can be sorted.
protected function getSortableColumns(): array
{
return ['*']; // Allow sorting on all columns
}
Search
Define which columns are searchable.
protected function getSearchableColumns(): array
{
return ['*']; // Allow searching on all columns
}
Filtering
Define which columns are filterable.
protected function getFilterableColumns(): array
{
return ['*']; // Allow filtering on all columns
}
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
- ['*'] means all columns are allowed.
- Replace ['*'] with an array of specific columns to restrict usage. Example:
protected function getSortableColumns(): array
{
return ['id', 'name', 'created_at'];
}
- limitable() and paginatable() are simple on/off switches — return true to enable, false to disable.