Kernel.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. class Kernel extends ConsoleKernel
  6. {
  7. /**
  8. * Define the application's command schedule.
  9. *
  10. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  11. * @return void
  12. */
  13. protected function schedule(Schedule $schedule)
  14. {
  15. $schedule->command('upgrade:daily')
  16. ->dailyAt('00:00')
  17. ->emailOutputTo(config("app.email.ScheduleEmailOutputTo"))
  18. ->emailOutputOnFailure(config("app.email.ScheduleEmailOutputOnFailure"));
  19. }
  20. /**
  21. * Register the commands for the application.
  22. *
  23. * @return void
  24. */
  25. protected function commands()
  26. {
  27. $this->load(__DIR__.'/Commands');
  28. require base_path('routes/console.php');
  29. }
  30. /**
  31. * Get the timezone that should be used by default for scheduled events.
  32. *
  33. * @return \DateTimeZone|string|null
  34. */
  35. protected function scheduleTimezone()
  36. {
  37. return 'Asia/Shanghai';
  38. }
  39. }