Kernel.php 974 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. //log cronjob activity
  19. $schedule->call(function () {
  20. Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - '.now());
  21. })->everyMinute();
  22. }
  23. /**
  24. * Register the commands for the application.
  25. *
  26. * @return void
  27. */
  28. protected function commands()
  29. {
  30. $this->load(__DIR__.'/Commands');
  31. require base_path('routes/console.php');
  32. }
  33. }