From ea7418cf3531cd7cffb0a111b3f5bb73e8b3f256 Mon Sep 17 00:00:00 2001 From: Ernest Walzel Date: Thu, 29 Feb 2024 16:27:29 +0100 Subject: [PATCH] Enable command auto-discovery as per current laravel skeleton --- app/Console/Kernel.php | 34 ++++++++++------------------------ routes/console.php | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 routes/console.php diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bc1993920..0b3a0d1a8 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -9,30 +9,6 @@ class Kernel extends ConsoleKernel { - /** - * The Artisan commands provided by your application. - * - * @var array - */ - protected $commands = [ - \App\Console\Commands\OaiPmhHarvest::class, - \App\Console\Commands\MigrateElasticsearch::class, - \App\Console\Commands\ReindexElasticsearch::class, - \App\Console\Commands\SetupElasticsearch::class, - \App\Console\Commands\MakeSitemap::class, - \App\Console\Commands\TestMemory::class, - \App\Console\Commands\MakeSketchbook::class, - \App\Console\Commands\ImportTags::class, - \App\Console\Commands\Inspire::class, - \App\Console\Commands\OaiPmhDownloadImages::class, - \App\Console\Commands\ImportCsv::class, - \App\Console\Commands\ImportIipImages::class, - \App\Console\Commands\ItemsExtractColors::class, - \App\Console\Commands\MatchAuthorities::class, - \App\Console\Commands\MediaLibraryRegenerateResponsiveImages::class, - \App\Console\Commands\GenerateImageRatios::class, - ]; - /** * Define the application's command schedule. * @@ -72,4 +48,14 @@ protected function schedule(Schedule $schedule) }) ->daily(); } + + /** + * Register the commands for the application. + */ + protected function commands(): void + { + $this->load(__DIR__ . '/Commands'); + + require base_path('routes/console.php'); + } } diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 000000000..e05f4c9a1 --- /dev/null +++ b/routes/console.php @@ -0,0 +1,19 @@ +comment(Inspiring::quote()); +})->purpose('Display an inspiring quote');