From de1c1faaa761a9d61f2fa78edc5e86c62639b955 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Sun, 23 May 2021 00:40:12 +0200 Subject: [PATCH] register component in AppServiceProvider automatically --- src/Commands/Component.php | 12 ++++++++++++ src/Commands/ComponentCommand.php | 6 ++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 src/Commands/Component.php diff --git a/src/Commands/Component.php b/src/Commands/Component.php new file mode 100644 index 0000000..f1c0db8 --- /dev/null +++ b/src/Commands/Component.php @@ -0,0 +1,12 @@ +line("✨ Component app/Airwire/{$name}.php has been created!\n"); - - $this->warn("🚧 Don't forget to register the component! Add the following line to AppServiceProvider:"); - $this->line("\n\n Airwire::component('" . Str::snake($name) . "', {$name}::class);\n\n"); + Component::register($name); + $this->line("✨ Component app/Airwire/{$name}.php has been created and registered!\n"); } }