Kernel.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. * Define the application's command schedule.
  10. *
  11. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  12. * @return void
  13. */
  14. protected function schedule(Schedule $schedule)
  15. {
  16. $schedule->command('credits:charge')->hourly();
  17. $schedule->command('cp:versioncheck:get')->daily();
  18. $schedule->command('payments:open:clear')->daily();
  19. //log cronjob activity
  20. $schedule->call(function () {
  21. Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - ' . now());
  22. })->everyMinute();
  23. }
  24. /**
  25. * Register the commands for the application.
  26. *
  27. * @return void
  28. */
  29. protected function commands()
  30. {
  31. $this->load(__DIR__ . '/Commands');
  32. require base_path('routes/console.php');
  33. }
  34. }