From e05a8bd954ca68fb6b7a1c2daa8cfdf64c8ac49a Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Thu, 16 May 2024 18:22:32 +1000 Subject: [PATCH] [1.x] Make commands lazy (#601) * Make commands lazy * Fix soft dependency --- composer.json | 3 ++- src/Commands/CreateMiddleware.php | 2 ++ src/Commands/StartSsr.php | 2 ++ src/Commands/StopSsr.php | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 10b4b7ec..832bdb76 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "require": { "php": "^7.3|~8.0.0|~8.1.0|~8.2.0|~8.3.0", "ext-json": "*", - "laravel/framework": "^8.74|^9.0|^10.0|^11.0" + "laravel/framework": "^8.74|^9.0|^10.0|^11.0", + "symfony/console": "^5.3|^6.0|^7.0" }, "require-dev": { "roave/security-advisories": "dev-master", diff --git a/src/Commands/CreateMiddleware.php b/src/Commands/CreateMiddleware.php index 2c8e9376..59bc2981 100644 --- a/src/Commands/CreateMiddleware.php +++ b/src/Commands/CreateMiddleware.php @@ -3,8 +3,10 @@ namespace Inertia\Commands; use Illuminate\Console\GeneratorCommand; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputOption; +#[AsCommand(name: 'inertia:middleware')] class CreateMiddleware extends GeneratorCommand { /** diff --git a/src/Commands/StartSsr.php b/src/Commands/StartSsr.php index a065b198..c7f1215d 100644 --- a/src/Commands/StartSsr.php +++ b/src/Commands/StartSsr.php @@ -5,8 +5,10 @@ use Inertia\Ssr\SsrException; use Illuminate\Console\Command; use Inertia\Ssr\BundleDetector; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Process\Process; +#[AsCommand(name: 'inertia:start-ssr')] class StartSsr extends Command { /** diff --git a/src/Commands/StopSsr.php b/src/Commands/StopSsr.php index a02d89f2..0989bfc0 100644 --- a/src/Commands/StopSsr.php +++ b/src/Commands/StopSsr.php @@ -3,7 +3,9 @@ namespace Inertia\Commands; use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'inertia:stop-ssr')] class StopSsr extends Command { /**