Skip to content

v3.0.1

Choose a tag to compare

@GautierDele GautierDele released this 10 Nov 11:50
e3f0011

A patch release of 3.0: fixes only, no new feature. Upgrade with composer update lomkit/laravel-rest-api.

Fixes

Authorization

  • An update policy 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 a create entry. The check runs once, before any write.
  • A sync entry with pivot values checks the link of the rows it keeps attached, like an update of that pivot row.
  • The update constraints of a resource (prohibitedOnUpdate(), requiredOnUpdate()) also apply to the relations of attach, detach, sync and toggle entries.
  • An action with authorizeEach() runs on the rows its checks read, and the checks stop as soon as the rows go over $maxResources.
  • The DenialsRenderer lists no 404 denial in a 403 response.

Search and metrics

  • Date filters compare by day on SQLite, so a Y-m-d column matches its own date.
  • Two includes without alias that load the same relation are a 422 that asks for an alias (only the last one was kept).
  • A MySQL or MariaDB websearch made 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 the authorizationCacheContext() of every resource the search reaches.

Mutations

  • totals.entries counts a nested relation list and its key lists once for each row of the parent entry.
  • attach of a row that is already attached is a 422.

Responses and requests

  • A Boolean or DateTime field 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 and serializeDate() of the model.
  • Request input that is not valid UTF-8 is a 422 on 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 encrypted columns are neither filterable nor sortable.

Behaviour changes to check

  • Values of Boolean and DateTime fields on columns without cast change format: 1 becomes true, 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, attach of an attached row, nested lists over totals.entries once multiplied by their parent rows, link entries whose relations break an update constraint.

Documentation: https://laravel-rest-api.lomkit.com