Skip to content

v4.0.0

@josenildotiago josenildotiago tagged this 30 Jul 10:19
--api shipped in 3.0.0 and was never finished. The stubs assume a handlebars
engine -- {{#each columns}}, {{#if (eq type 'string')}} -- that was never
written; substitution has always been str_replace over a flat map, so those
blocks went verbatim into the user's file. Of the 29 placeholders the API
stubs use, 21 were never in the replacement map, {{namespace}} among them:
that is line 3 of the generated ApiController, so the file did not parse.

Valid PHP would not have helped. Since Laravel 11 routes/api.php is only
registered after `php artisan install:api`, which the package never did, so
the generated routes were a dead file on disk. The stub also asked for
auth:sanctum in a starter kit that does not ship Sanctum, and for a
throttle:public-api limiter that does not exist.

So this removes the flag, the interactive prompt, five builders, four path
helpers, the four abstract methods on GeneratorCommand, five stubs, and the
api/validation config keys that nothing read. Passing --api is now a Symfony
error instead of a silent pile of broken files.

Major by the rule written into CLAUDE.md in 3.3.1: removing a documented
Artisan flag is item 1 of the public API, and the rule decides this rather
than a case-by-case argument about whether a broken feature counts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assets 2
Loading