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
|
|
|
|
{
|
2022-06-16 12:54:42 +00:00
|
|
|
/**
|
|
|
|
* The Artisan commands provided by your application.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $commands = [
|
|
|
|
Commands\ChargeCreditsCommand::class,
|
|
|
|
Commands\ChargeServers::class,
|
2023-05-18 19:51:10 +00:00
|
|
|
Commands\DeleteExpiredCoupons::class,
|
2022-06-16 12:54:42 +00:00
|
|
|
];
|
|
|
|
|
2021-06-05 09:26:32 +00:00
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
2022-06-16 12:54:42 +00:00
|
|
|
$schedule->command('servers:charge')->everyMinute();
|
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();
|
2023-05-18 19:51:10 +00:00
|
|
|
$schedule->command('coupons:delete')->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');
|
|
|
|
}
|
|
|
|
}
|