Repository navigation
v3.0.0
Laravel Rest Api 3.0 is a rebuild of the package. Describe a model once, get a complete API: search, mutate, actions, metrics, details and deletes, authorized by your policies and documented through Scramble.
Requirements: PHP 8.3+ and Laravel 13.30+. Applications on Laravel 12 stay on 2.x.
Upgrading from 2.x: read the upgrade guide. It lists every breaking change, area by area.
Highlights
- Typed fields and inputs:
fields()declaresText,Integer,Number,Date,Enum,Json… One declaration drives the filter operators, the validation, the typed values of the responses and the OpenAPI document.Enum::offered()keeps withdrawn cases readable but refuses them on writes. - OpenAPI through Scramble: every endpoint documented with a typed body per resource, field rules, request examples and error responses. The built-in generator is removed.
- Metrics:
Value,Trend,Partition,ProgressandTable, with medians, percentiles, the previous period and a result cache. - Confirmations: actions, mutate, destroy, restore and force destroy can answer
428with a signed token before they run. - Search: relation filter groups, aggregates you can sort on, include aliases,
@more, text search onLIKE, full-text indexes or Scout engines, instructions with aliases, andRest::search()outside HTTP withpage(),render()andlazy(). - Writes: whole graphs in one transaction, child
delete, aresponseblock, optimistic checks withversioned()(409), deadlock retries, and per-row hooks that also run when only the relations of a row change. - Actions: Search, Resources or None targets,
searchrequired for the Search target, row checks withauthorizeEach(), one transaction per run, chunk or row, queued chunks and batches with progress. - Authorization: policies on every resource a request reaches and on every row it writes,
perimeterQuery()at every level, a decision cache, strict mode and theKeysOutOfReachevent. - Details per user: a thin base with
?with=parts, authorized flags, relation operations,detailsMeta()andsearchMeta(). - Limits: list sizes, depths, totals, value lengths, response rows, action jobs and metric groups, all in
config/rest.php, refused with one422before any query. - Translations: every client-facing message under
rest::, shipped in English and French. - Tooling:
rest:quick-start,rest:check, generators that read your tables, and a Laravel Boost skill.
Documentation: https://laravel-rest-api.lomkit.com