Skip to content

v3.0.0

Choose a tag to compare

@GautierDele GautierDele released this 08 Nov 23:59
25359a7

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() declares Text, 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, Progress and Table, with medians, percentiles, the previous period and a result cache.
  • Confirmations: actions, mutate, destroy, restore and force destroy can answer 428 with a signed token before they run.
  • Search: relation filter groups, aggregates you can sort on, include aliases, @more, text search on LIKE, full-text indexes or Scout engines, instructions with aliases, and Rest::search() outside HTTP with page(), render() and lazy().
  • Writes: whole graphs in one transaction, child delete, a response block, optimistic checks with versioned() (409), deadlock retries, and per-row hooks that also run when only the relations of a row change.
  • Actions: Search, Resources or None targets, search required for the Search target, row checks with authorizeEach(), 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 the KeysOutOfReach event.
  • Details per user: a thin base with ?with= parts, authorized flags, relation operations, detailsMeta() and searchMeta().
  • Limits: list sizes, depths, totals, value lengths, response rows, action jobs and metric groups, all in config/rest.php, refused with one 422 before 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