Skip to content

Commit

Permalink
Enable command auto-discovery
Browse files Browse the repository at this point in the history
as per current laravel skeleton
  • Loading branch information
eronisko committed Feb 29, 2024
1 parent d90c35f commit ea7418c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
34 changes: 10 additions & 24 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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');
}
}
19 changes: 19 additions & 0 deletions routes/console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;

/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/

Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');

0 comments on commit ea7418c

Please sign in to comment.