Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Console/Kernel.php
Назад
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use App\Models\ProductLicense; use Carbon\Carbon; use Illuminate\Support\Facades\Log; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ // \Laravelista\LumenVendorPublish\VendorPublishCommand::class, ]; /** * Define the application's command schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { // $schedule->command('inspire')->hourly(); $licenses = ProductLicense::get(); $schedule->call(function () use($licenses){ foreach($licenses as $license){ $now = Carbon::now(); $endDate = Carbon::parse($license->end_date); $result = $now->gt($endDate); if($result == "true"){ $license->days_left = 0; $license->save(); }else{ $count = $now->diffInDays($endDate); $license->days_left = $count+1; $license->save(); } } })->everyMinute(); // $schedule->command('database:backup')->everyMinute(); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка