murilochianfa/laravel-command-blocker
Blocks specified Artisan commands from running in Laravel, letting you disable dangerous or unwanted console commands per environment. Lightweight package for adding command-level guardrails to your app.
Architecture fit
laravel-command-blocker is a conventional Laravel package (service provider + publishable config) that acts as a guardrail at the Artisan layer, preventing listed console commands from executing. It is architecturally low-impact: no database schema, no queue workers, no external services, no middleware in the HTTP path. It slots in alongside existing Laravel bootstrapping and can be added or removed without touching application code.
Integration feasibility
Straightforward. composer require, publish the config, enumerate the commands to block. Realistic effort is measured in hours, not days, and can be validated entirely in a staging environment. No cross-team dependencies beyond whoever owns deployment/runbook conventions.
Technical risk
Key questions
list-style command or boot-time warning — that lets us verify the effective blocklist per environment?Artisan::call) and scheduler-driven commands, or only CLI entry?Stack fit Native Laravel/PHP, Composer-distributed. Fits an existing Laravel stack with zero infrastructure change. No new runtime, no new secret store, no network egress.
Migration path
Greenfield adoption — nothing to migrate. Recommended path: pilot in staging with a blocklist derived from an audit of destructive/irreversible commands actually present in the app (migrate:fresh, migrate:refresh, db:wipe, db:seed in prod, queue clear/flush, cache clear where it causes incidents).
Compatibility
v1.0.1 is a patch release over v1.0.0 — semver-safe, no breaking changes, no deprecations, no new features. Pin to ^1.0.1 to guarantee you get the missing-command fix rather than the v1.0.0 behavior. Confirm the Laravel major version in use is supported before committing.
Sequencing
Maintenance Low code surface, but ownership rests with a single upstream maintainer. Pin the version, watch the repository for releases, and budget a periodic review (e.g., quarterly) to re-verify the blocklist still matches reality after package upgrades.
Support Community-only. No vendor SLA. Acceptable for a non-critical guardrail; not acceptable as the sole protection around irreversible data operations.
Scaling Negligible. Boot-time check, no per-request or per-job cost. Scales fine across environments and app instances with no additional infrastructure.
Failure modes
Ramp-up Under a day for an engineer familiar with Laravel. The learning cost is not the package; it is establishing the verification discipline (proving the block fires, and proving the blocklist has no stale entries) that the package itself does not provide.
How can I help you explore Laravel packages today?