Repository navigation
v3.0.1
A patch release of 3.0: fixes only, no new feature. Upgrade with composer update lomkit/laravel-rest-api.
Fixes
Authorization
- An
updatepolicy now sees the new foreign key of a row moved under a parent or owner that the same request creates.Changes::target($key)gives the row a foreign key points to: the stored row, or the unsaved row of acreateentry. The check runs once, before any write. - A
syncentry withpivotvalues checks the link of the rows it keeps attached, like anupdateof that pivot row. - The update constraints of a resource (
prohibitedOnUpdate(),requiredOnUpdate()) also apply to therelationsofattach,detach,syncandtoggleentries. - An action with
authorizeEach()runs on the rows its checks read, and the checks stop as soon as the rows go over$maxResources. - The
DenialsRendererlists no404denial in a403response.
Search and metrics
Datefilters compare by day on SQLite, so aY-m-dcolumn matches its own date.- Two includes without alias that load the same relation are a
422that asks for an alias (only the last one was kept). - A MySQL or MariaDB
websearchmade of excluded words only returns the rows without these words, as on PostgreSQL. - A metric cached with
cacheScope('global')keys its result on the perimeters and theauthorizationCacheContext()of every resource the search reaches.
Mutations
totals.entriescounts a nested relation list and its key lists once for each row of the parent entry.attachof a row that is already attached is a422.
Responses and requests
- A
BooleanorDateTimefield on a column without cast renders through the Laravel cast of its type (true/false,2026-02-10T09:30:00.000000Z), with the date format andserializeDate()of the model. - Request input that is not valid UTF-8 is a
422on its path. - An empty
REST_AUTHORIZATIONS_CACHE_STORE=uses the default cache store.
Generators
- Generated fields check a unique column on update too, ignoring the row being updated.
- Generated
encryptedcolumns are neither filterable nor sortable.
Behaviour changes to check
- Values of
BooleanandDateTimefields on columns without cast change format:1becomestrue, and a stored datetime is returned in UTC ISO 8601. - Requests that the previous release accepted and that are now a
422: two unaliased includes of one relation,attachof an attached row, nested lists overtotals.entriesonce multiplied by their parent rows, link entries whoserelationsbreak an update constraint.
Documentation: https://laravel-rest-api.lomkit.com