Kernel.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Console;
  3. use Illuminate\Console\Scheduling\Schedule;
  4. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  5. use Illuminate\Support\Facades\Storage;
  6. class Kernel extends ConsoleKernel
  7. {
  8. /**
  9. * The Artisan commands provided by your application.
  10. *
  11. * @var array
  12. */
  13. protected $commands = [
  14. Commands\ChargeCreditsCommand::class,
  15. Commands\ChargeServers::class,
  16. Commands\DeleteExpiredCoupons::class,
  17. ];
  18. /**
  19. * Define the application's command schedule.
  20. *
  21. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  22. * @return void
  23. */
  24. protected function schedule(Schedule $schedule)
  25. {
  26. $schedule->command('servers:charge')->everyMinute();
  27. $schedule->command('cp:versioncheck:get')->daily();
  28. $schedule->command('payments:open:clear')->daily();
  29. $schedule->command('coupons:delete')->daily();
  30. //log cronjob activity
  31. $schedule->call(function () {
  32. Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - ' . now());
  33. })->everyMinute();
  34. }
  35. /**
  36. * Register the commands for the application.
  37. *
  38. * @return void
  39. */
  40. protected function commands()
  41. {
  42. $this->load(__DIR__ . '/Commands');
  43. require base_path('routes/console.php');
  44. }
  45. }