diff --git a/app/Console/Commands/CatchUnoptimizedMedia.php b/app/Console/Commands/CatchUnoptimizedMedia.php new file mode 100644 index 00000000..01b8f79c --- /dev/null +++ b/app/Console/Commands/CatchUnoptimizedMedia.php @@ -0,0 +1,47 @@ +take(50)->get(); + foreach($medias as $media) { + ImageOptimize::dispatch($media); + } + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8c51585..bb5923aa 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,8 +24,8 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - // $schedule->command('inspire') - // ->hourly(); + $schedule->command('media:optimize') + ->hourly(); } /**