From 0b740d5b6db09c421f16160fe600756cc95ebaf5 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 20 Mar 2024 07:08:32 +1100 Subject: [PATCH] [4.x] Make commands lazy (#264) * Make commands lazy * Fix soft dependency --- composer.json | 3 ++- src/AuthCommand.php | 2 ++ src/ControllersCommand.php | 2 ++ src/UiCommand.php | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6c5bd02..8ad118f 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "illuminate/console": "^9.21|^10.0|^11.0", "illuminate/filesystem": "^9.21|^10.0|^11.0", "illuminate/support": "^9.21|^10.0|^11.0", - "illuminate/validation": "^9.21|^10.0|^11.0" + "illuminate/validation": "^9.21|^10.0|^11.0", + "symfony/console": "^6.0|^7.0" }, "require-dev": { "orchestra/testbench": "^7.35|^8.15|^9.0", diff --git a/src/AuthCommand.php b/src/AuthCommand.php index ed525f6..9498193 100644 --- a/src/AuthCommand.php +++ b/src/AuthCommand.php @@ -4,7 +4,9 @@ use Illuminate\Console\Command; use InvalidArgumentException; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'ui:auth')] class AuthCommand extends Command { /** diff --git a/src/ControllersCommand.php b/src/ControllersCommand.php index a36960c..228ddd1 100644 --- a/src/ControllersCommand.php +++ b/src/ControllersCommand.php @@ -5,8 +5,10 @@ use Illuminate\Console\Command; use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Finder\SplFileInfo; +#[AsCommand(name: 'ui:controllers')] class ControllersCommand extends Command { /** diff --git a/src/UiCommand.php b/src/UiCommand.php index 8f76979..0ae12cc 100644 --- a/src/UiCommand.php +++ b/src/UiCommand.php @@ -4,7 +4,9 @@ use Illuminate\Console\Command; use InvalidArgumentException; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'ui')] class UiCommand extends Command { /**