Kernel.php 1.2 KB

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