First stable release.
Added
- Model resources.
#[RestResource(model: …)]on a controller extending
RestControllerregistersindex,show,store,updateand
destroy.onlyandexceptswitch individual actions on or off.
updateanswers to bothPUTandPATCHwith one set of rules. - Job APIs.
#[RestJob(key: …)]on a controller extending
JobControllerregisters aPOSTthat starts a run and returns its id, a
GETthat reports the progress, and an optionalDELETEthat cancels it.
The counters are read live from Laravel's batch, so the jobs report
nothing themselves, andtotalmay grow while the run is going. - Typed job payloads.
JobDatacarries the input of a run,JobResult
is filled in by the chain.updateResult()writes under a row lock, so
jobs running at the same time cannot overwrite each other. - Declarative filters. Request classes declare which filters a listing
accepts. Single operators (EqualsFilter,LikeFilter,BetweenFilter
and friends) or whole groups (IdFilter,StringFilter,NumericFilter,
DateFilter,BooleanFilter). Unknown fields, operators and sort columns
are rejected with 422 and a message naming what was allowed. - An OpenAPI document at a configurable route, generated from the
registered routes. Request bodies come from the validation rules, response
schemas from the table columns of the model, and filters appear as one
deepObjectparameter per field. Which routes need a token is derived
from their middleware. rest-api:prune-jobsremoves finished runs.
Notes
- Every class is extensible: nothing is
final, no method or property is
private. See the "Extension points" section of the README. - Responses are flat JSON. Pagination is reported in the
X-Total-Count,
X-Page,X-Per-Page,X-Last-PageandLinkheaders.