|
@@ -1,6 +1,7 @@
|
|
<?php namespace App\Console;
|
|
<?php namespace App\Console;
|
|
|
|
|
|
use Exception;
|
|
use Exception;
|
|
|
|
+use Illuminate\Console\Scheduling\Schedule;
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
|
|
class Kernel extends ConsoleKernel {
|
|
class Kernel extends ConsoleKernel {
|
|
@@ -15,26 +16,15 @@ class Kernel extends ConsoleKernel {
|
|
];
|
|
];
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Run the console application.
|
|
|
|
|
|
+ * Define the application's command schedule.
|
|
*
|
|
*
|
|
- * @param \Symfony\Component\Console\Input\InputInterface $input
|
|
|
|
- * @param \Symfony\Component\Console\Output\OutputInterface $output
|
|
|
|
- * @return int
|
|
|
|
|
|
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
|
|
+ * @return void
|
|
*/
|
|
*/
|
|
- public function handle($input, $output = null)
|
|
|
|
|
|
+ protected function schedule(Schedule $schedule)
|
|
{
|
|
{
|
|
- try
|
|
|
|
- {
|
|
|
|
- return parent::handle($input, $output);
|
|
|
|
- }
|
|
|
|
- catch (Exception $e)
|
|
|
|
- {
|
|
|
|
- $this->reportException($e);
|
|
|
|
-
|
|
|
|
- $this->renderException($output, $e);
|
|
|
|
-
|
|
|
|
- return 1;
|
|
|
|
- }
|
|
|
|
|
|
+ $schedule->artisan('foo')
|
|
|
|
+ ->hourly();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|