dskripchenko/laravel-api
Laravel package for rapidly building REST APIs with automatic routing, request validation, filtering, pagination, and consistent JSON responses—plus OpenAPI docs generation to keep your endpoints documented as they grow.
What it is. dskripchenko/laravel-api bundles three capabilities into one opinionated package: (1) versioned API routing, (2) OpenAPI 3.0 document generation driven directly from PHPDoc — explicitly avoiding annotation classes and hand-maintained YAML — and (3) CRUD scaffolding plus "middleware cascades" for stacking middleware per route/version. The differentiated thesis is the doc generation: annotation-based tooling (zircote/swagger-php + L5-Swagger) is verbose and pollutes controllers, while hand-written YAML drifts. PHPDoc-as-source-of-truth is the same bet dedoc/scramble makes, so this package is entering a space with at least one credible, better-known alternative.
Architecture fit. The package follows conventional Laravel package shape — service provider, publishable config, artisan commands — so it slots into the framework's idioms rather than fighting them. Treating API versioning as a first-class routing concept (version prefix + per-version documentation) is genuinely useful for teams running v1/v2 concurrently, a scenario most doc tools handle poorly. The CRUD scaffolding is dev-time codegen and carries no production runtime footprint. The middleware cascade abstraction is the piece most likely to become a "framework on top of a framework": convenient, but it hides Laravel's native middleware ordering from developers who will debug it at 2 a.m.
Integration feasibility. Install is a one-line Composer require, so the cost of evaluation is low. The real feasibility question is inference quality: mapping PHP type declarations, Eloquent relationships, and FormRequest validation rules into accurate OpenAPI schemas is where PHPDoc-driven generators either succeed or produce documentation that is confidently wrong. That cannot be judged from the README — it requires a spike against a representative controller. Secondary checks: route:cache and config:cache compatibility, Laravel Octane behavior, and whether doc generation runs at build time (preferred) or request time.
Technical risk. High, and mostly non-technical in origin. Thirteen stars, a score of ~19/100, and a repository field of "unknown" mean there is no community validation, no visible issue history to gauge responsiveness, and no ability to complete supply-chain due diligence from the provided metadata. The listed last release of 2026-10-01 is either a future-dated artifact or a data-quality problem — either way, provenance must be confirmed before this enters a dependency graph. The effective bus factor is one. Adopting this is a bet on a maintainer, not on a project.
Key questions for the maintainer/spike:
FormRequest::rules() and Eloquent casts/relations, or only raw PHPDoc?L5-Swagger/Scramble installs?Stack fit. Best suited to a Laravel 10/11 + PHP 8.1+ codebase that already exposes a versioned JSON API and lacks documentation, or whose documentation has drifted. Teams with heavy annotation investment or an established Scramble setup get less value and more conflict surface. If the platform is Laravel-adjacent (Lumen, or Laravel with a separate gateway), confirm the routing assumptions hold.
Migration path. Incremental and reversible — this is the package's strongest practical attribute. Nothing forces a big-bang conversion: install, point it at a single versioned route group, generate docs, and diff the output against the current contract by hand or with a spec-comparison tool. If output quality is unacceptable, uninstall and lose a day. If acceptable, expand version group by version group. For teams on annotations, the migration is per-endpoint rewriting to PHPDoc conventions rather than a mechanical transform; budget accordingly, and run both generators in parallel during transition so the published spec never regresses.
Compatibility. Verify three things explicitly before committing: (1) that middleware cascade ordering composes predictably with existing global and route middleware; (2) that route caching and config caching still work in the deploy pipeline; (3) that generated specs do not collide with any existing /docs or /api-docs endpoint or Swagger UI route. Also confirm behavior under Octane if the target services use it — static state in a doc generator is a classic source of cross-request leakage.
Sequencing.
Recommendation. Treat as a tactical, well-scoped experiment, not a strategic dependency. Proceed only if the spike shows strong inference from validation rules and Eloquent models; otherwise default to Scramble for the same "no annotations" benefit with materially better community support.
Maintenance. The dominant cost is documentation discipline, not the package itself. Once PHPDoc is the source of truth, every controller change carries an implicit spec change, and skipping a docblock becomes a silent contract regression. Enforce with static analysis and a CI spec diff. On the dependency side, pin the exact version, mirror the repository internally, and review the diff of every upgrade — at 13 stars there is no crowd to absorb a bad release.
Support. Community-only, no commercial backing, minimal visible issue history. Assume no external support and assign an internal owner (one backend engineer, named) who is accountable for upgrades and for arbitrating spec-vs-code disputes. Budget a fallback: if the maintainer goes dormant, the escape hatch is forking the generator or migrating to Scramble — both are days of work, not weeks, which keeps the risk bounded.
Scaling. Runtime cost should be nil if specs are generated at build time and served statically; confirm this, because request-time generation would put reflection and docblock parsing on the hot path. The team-level scaling limit is more relevant: as the number of controllers and API versions grows, the generator's inference and merge behavior gets stressed, and one maintainer's throughput becomes the ceiling on how fast the org can adopt new PHP features the package doesn't recognize.
Failure modes to watch.
route:cache failure surfacing only in production deploys, not locally.Ramp-up. Low to moderate. Any Laravel developer installs and runs it in under an hour; the real learning curve is the package's PHPDoc dialect — what it recognizes, what it ignores, and how to express responses, enums, and errors without annotations. That knowledge will live with one or two people unless it is written down. Produce a short internal style guide and a reference controller before onboarding the wider team, and expect the first version groups to take noticeably longer than later ones.
How can I help you explore Laravel packages today?