Kernel.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. * The Artisan commands provided by your application.
  9. *
  10. * @var array
  11. */
  12. protected $commands = [
  13. // 腳本入口
  14. Commands\Lion::class,
  15. ];
  16. /**
  17. * Define the application's command schedule.
  18. *
  19. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  20. *
  21. * @return void
  22. */
  23. protected function schedule(Schedule $schedule)
  24. {
  25. // 腳本必須有序執行
  26. // 針對沒有玩過的人,第一次設定鬧鐘後 24 小時後
  27. // IF > 腳本7先執行 > 由於該任務鬧鐘還沒響 > 所以不會被腳本挑出來處理 > 腳本8接著才執行 > 因此用戶可以自己去關鬧鐘 > DONE
  28. // IF > 腳本8先執行 > 腳本8將提示鬧鈴且修改狀態為未關閉 > 腳本7落入 corner 將鬧鐘關閉並註記為關閉次數為1 > 出問題
  29. $schedule->call(function () {
  30. });
  31. }
  32. /**
  33. * Register the Closure based commands for the application.
  34. *
  35. * @return void
  36. */
  37. protected function commands()
  38. {
  39. require base_path('routes/console.php');
  40. }
  41. }