Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Single Action Resource Controllers For Laravel Laravel Package

clean-bandits/single-action-resource-controllers-for-laravel

Organize Laravel resourceful routes into single-action (invokable) controllers. This package gives each resource action—index, show, store, update, destroy—its own focused controller class, keeping your app clean, explicit, and easy to maintain.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package sits in the scaffolding layer of a Laravel application: a service provider plus one or more Artisan commands that emit single-action (invokable) controller classes, and likely accompanying stubs. That is the shallowest possible integration surface — it does not touch the request lifecycle, container bindings, routing, or persistence. For a codebase already organized around invokable controllers, it codifies an existing convention; for one organized around resourceful controllers, it introduces a competing convention that must be decided on deliberately rather than adopted incidentally.

Integration feasibility. Install cost is near zero: composer require --dev, optional stub publishing, one command per resource action. The real feasibility question is not technical but stylistic — does the generated output match our house style (namespace layout, return types, form-request injection, resource/response classes, strict types, final classes)? If the generated code requires manual cleanup on every invocation, the tool's value collapses to roughly the value of a snippet library.

Technical risk. Distinguish two axes:

  • Runtime risk: negligible. Dev-only dependency, no production code path, no attack surface, no performance implication.
  • Supply-chain and longevity risk: elevated. Three stars, zero dependents, and a single small vendor mean effectively no community validation. The package is a thin wrapper over make:controller --invokable plus stubs; its entire value can be replicated in an afternoon by publishing our own stubs. The failure mode that actually hurts is abandonment: an unmaintained dev dependency becomes friction at the next Laravel major upgrade, and because it is --dev it often escapes the dependency-review process entirely.

Key questions to resolve before adoption.

  1. What exact command signatures and options does it expose, and do they collide with existing generators or our own Artisan commands?
  2. Does it generate routes, or controllers only? If controllers only, the routing convention (explicit Route::get per action vs. a resource-style macro) remains ours to solve.
  3. What are the declared illuminate/* and PHP version constraints, and do they cover the versions we run and the next major?
  4. Are stubs publishable and are they compatible with our static analysis (PHPStan/Larastan level), formatter (Pint), and test scaffolding (Pest/PHPUnit)?
  5. Is there a test suite in the repository, and does CI exercise multiple Laravel versions?
  6. What is the maintainer's release cadence and issue-response history — is the "last release" date a real release or metadata noise?
  7. Does it support multi-word and nested resources correctly (Admin/User/UpdateUserController), which is where naive generators break?

Integration Approach

Stack fit. Ideal fit is a Laravel 10+ application that has already chosen action-per-controller as its HTTP layer convention, uses attribute or explicit routing, and has a code-review culture that will reject drifted generated code. Poor fit is a team mid-migration, or one where resourceful controllers are the documented standard — introducing a second convention creates review ambiguity with no offsetting benefit.

Migration path. There is no migration obligation. Existing resourceful controllers do not need to be rewritten; the package can be adopted for new resources only, which is the correct sequencing anyway. If a codebase does want to converge, convert one controller per PR, keeping the route names stable so the frontend and any URL contracts are unaffected. Treat controller splitting as a refactor, not a modernization initiative — it changes file layout, not behavior.

Compatibility. Verify three layers: (a) Laravel/PHP version constraints against our matrix; (b) generated output against our static analysis and formatter — a generator that emits code failing our own CI is worse than no generator; (c) coexistence with other dev tooling (IDE helpers, laravel-ide-helper, route caching — the latter unaffected since this is build-time only).

Sequencing.

  1. Spike on a throwaway branch: install, generate two or three real resources (including a nested one), diff the output against our conventions.
  2. If output requires meaningful manual editing, publish and fork the stubs locally or copy the pattern outright — a ~200-line internal generator has a lower total cost of ownership than a zero-dependent external package.
  3. If output is clean, add to composer.json require-dev with a caret constraint, document the command in the team's contributor guide, and add a CI job that runs the generator and asserts the result passes lint and static analysis. That last step is what keeps the convention from decaying.
  4. Roll out to new work only; revisit back-conversion after one quarter of real usage.

Operational Impact

Maintenance. Ongoing burden is minimal in the normal case — no config to tune, no runtime behavior to monitor, upgrades are occasional. The concentrated cost is at Laravel major releases: a stalled dev dependency either blocks the upgrade or forces a fork. Budget for that as a known future task rather than discovering it under upgrade pressure.

Support. There is no support channel beyond GitHub issues on a three-star repository. Internal ownership is mandatory: someone on the team must be able to read the provider, understand the stubs, and patch or fork them. That is a low bar, but it must be assigned, not assumed.

Scaling. The tool itself scales trivially — generator execution is milliseconds and affects only developer machines and CI. What does not scale automatically is the convention: at ten controllers the pattern is self-evident, at a hundred you need a documented, enforced file and namespace layout (e.g., App\Http\Controllers\{Resource}\{Action}{Resource}Controller), or the directory becomes inconsistent and the generator's value disappears. Enforce via a CI check or a naming test, not via documentation alone.

Failure modes.

  • Stale stubs after a framework upgrade generating code that no longer matches framework idioms or fails static analysis — mitigated by the CI generate-and-lint job above.
  • Silent abandonment — pinned version becomes incompatible; detect by tracking the repo, not just the lockfile.
  • Convention drift — half the team hand-writes controllers; the generator becomes decorative. Address with review checklists, not tooling.
  • Command or namespace collision with an existing generator, producing confusing partial output.
  • False confidence — generating correct file structure but missing cross-cutting concerns (authorization, validation, response shaping) that the team then forgets to add because the scaffold "looked complete."

Ramp-up. Under an hour for any Laravel developer: one command, one documented path convention, one example in the repo. The larger ramp cost is organizational — agreeing on the convention before the first PR, not learning the command.

Verdict. Technically benign, strategically marginal. Given three stars, zero dependents, and a value proposition that is essentially "stubs plus a command," this is worth a one-day spike and a documented convention, but not worth a durable dependency without an internal owner and a CI guardrail. The most likely correct outcome is adopting the pattern while vendoring or writing the generator in-house.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log