- How do I install sven/artisan-shortcuts in a Laravel app?
- Install it as a dev dependency with composer require --dev sven/artisan-shortcuts. Laravel package auto-discovery registers the service provider, so no manual provider entry is needed. Then publish the config file with php artisan vendor:publish and define your shortcut map. Pin the exact version you validate.
- Does sven/artisan-shortcuts support Laravel 10, 11, and 12?
- There is no reliable official support statement for current Laravel versions: the last tagged release was 2020-08-16, well before Laravel 10, 11, and 12. Treat compatibility as something to verify empirically on your target Laravel and PHP 8.2/8.3 matrix rather than assume. Because the package is small, a fork or vendored copy is roughly a day of work if upstream proves incompatible. Pin the version and add it to your Laravel upgrade checklist.
- How do I define a shortcut in the artisan-shortcuts config file?
- Publish the package config, then define a map of shortcut name to Artisan command string, for example fresh mapped to migrate:fresh or deploy mapped to your deploy command. After that you run php artisan followed by the shortcut name. Keep the set curated to genuinely frequent commands so the config stays readable. Document the shortcuts in your README and onboarding notes.
- Can artisan-shortcuts forward arguments and options to the target command?
- The provided assessment flags argument and option forwarding as an open question, so do not assume that php artisan your-shortcut --flag passes options through to the target command. The package maps a shortcut name to an Artisan command, but the exact forwarding behavior is not documented in the context available here. Test it explicitly in a scratch app with the arguments and options your team actually uses. If forwarding is unsupported, prefer native command aliases or custom commands for those cases.
- Does sven/artisan-shortcuts work with php artisan config:cache and optimize?
- Config-cache compatibility is called out as one of the highest-risk behaviors to validate. After defining shortcuts, run php artisan config:cache and php artisan optimize, then confirm that artisan list and your shortcuts still resolve correctly. Also clear the cache and retest to catch bootstrap-order issues. If shortcuts are used in CI or deploy scripts, include these checks in the pipeline.
- What happens when a shortcut name collides with an existing Artisan command?
- Shortcut resolution when a name collides with an existing command is explicitly listed as a risk to test. Deliberately create a shortcut that shadows a built-in Artisan command and one that shadows a package-provided command, then observe which one wins. The documented context does not specify whether the package overrides, defers, or errors, so confirm the behavior on your target version. Avoid names that clash with commands used in CI, deploys, or the scheduler.
- Can I restrict artisan-shortcuts to local development and keep it out of production?
- The safest pattern is to install the package with require-dev and use shortcuts only in local development, keeping them out of production and deployment paths. The assessment notes the risk is minimal when confined to local development and materially higher if it leaks into deployment. If CI or deploy scripts must consume the shortcuts, promote the package to a runtime dependency, pin the exact version, and add it to the CI matrix. Also decide explicitly whether it may load in production at all.
- Is sven/artisan-shortcuts still maintained?
- Effectively unmaintained since its last tagged release on 2020-08-16, with 55 stars and zero dependents, so plan to own it. The codebase is small, so budget roughly half a day to a day to fork or vendor it once, then expect near-zero ongoing effort. Assign an internal owner and re-evaluate on every Laravel major upgrade. If upstream breaks, vendoring the source or replacing it with native alternatives is straightforward.
- How does artisan-shortcuts register shortcuts, and can it break other Artisan commands?
- It is an auto-discovered service provider that reads a config map of shortcut name to Artisan command and registers those shortcuts at Artisan bootstrap. The assessment notes the exact mechanism, an ArtisanStarting listener versus generated command classes, should be confirmed. Because it hooks console bootstrap, a misbehaving package can affect every Artisan command, which cascades into CI, deploy scripts, and scheduler invocations. Confining it to local development keeps the blast radius small.
- What are native alternatives to Artisan Shortcuts?
- Native options include custom Artisan commands with the aliases property, Composer scripts, and a Makefile, all of which avoid an extra dependency. If you only need a handful of shortcuts, those built-in approaches may be simpler and are maintained with Laravel itself. For behavior closer to this package, you can vendor its small source into your application. The assessment also suggests checking for a maintained fork before committing to upstream.