Kernel.php 928 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Console;
  3. use App\Console\Commands\AddMessageRule;
  4. use App\Console\Commands\Apollo;
  5. use App\Console\Commands\UpdateMessageRule;
  6. use Illuminate\Console\Scheduling\Schedule;
  7. use Laravel\Lumen\Console\Kernel as ConsoleKernel;
  8. class Kernel extends ConsoleKernel
  9. {
  10. /**
  11. * The Artisan commands provided by your application.
  12. *
  13. * @var array
  14. */
  15. protected $commands = [
  16. AddMessageRule::class,
  17. UpdateMessageRule::class,
  18. Apollo::class
  19. ];
  20. /**
  21. * Define the application's command schedule.
  22. *
  23. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  24. * @return void
  25. */
  26. protected function schedule(Schedule $schedule)
  27. {
  28. $path = storage_path('logs/'.date('Y-m-d').'-schedule.log');
  29. $schedule->command('message:add')
  30. ->everyMinute()
  31. ->withoutOverlapping()->appendOutputTo($path);
  32. }
  33. }