2021-06-05 09:26:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console;
|
|
|
|
|
|
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
|
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
|
|
class Kernel extends ConsoleKernel
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Define the application's command schedule.
|
|
|
|
*
|
2023-01-05 17:01:42 +00:00
|
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
2021-06-05 09:26:32 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function schedule(Schedule $schedule)
|
|
|
|
{
|
2023-02-01 20:03:20 +00:00
|
|
|
$schedule->command('credits:charge')->hourly();
|
2023-01-13 17:57:35 +00:00
|
|
|
$schedule->command('cp:versioncheck:get')->daily();
|
2023-02-02 22:21:52 +00:00
|
|
|
$schedule->command('payments:open:clear')->daily();
|
2021-06-05 09:26:32 +00:00
|
|
|
|
|
|
|
//log cronjob activity
|
|
|
|
$schedule->call(function () {
|
2023-02-02 22:19:08 +00:00
|
|
|
Storage::disk('logs')->put('cron.log', 'Last activity from cronjobs - ' . now());
|
2021-06-05 09:26:32 +00:00
|
|
|
})->everyMinute();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the commands for the application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function commands()
|
|
|
|
{
|
2023-02-02 22:19:08 +00:00
|
|
|
$this->load(__DIR__ . '/Commands');
|
2021-06-05 09:26:32 +00:00
|
|
|
|
|
|
|
require base_path('routes/console.php');
|
|
|
|
}
|
|
|
|
}
|