Файловый менеджер - Редактировать - /home/clickysoft/public_html/assets.clickysoft.net/app/Console/Commands/NotifyOnAssetEOL.php
Назад
<?php namespace App\Console\Commands; use App\Models\Asset; use App\Notifications\AssetEOLNotification; use Carbon\Carbon; use Illuminate\Console\Command; use Mail; class NotifyOnAssetEOL extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'notify:asset-eol'; /** * The console command description. * * @var string */ protected $description = 'Notify admin when any asset is about to reach its EOL.'; /** * Execute the console command. */ public function handle() { $today = Carbon::today(); $assets = Asset::where( 'eol_date', $today->toDateString() )->get(); // $orgAdmin = User::where('organization_id', auth()->user()->organization_id)->where('is_org_admin', 1)->first(); // if ($orgAdmin) { // $orgAdmin->notify(new MaintenanceRequestNotification($maintenanceRequest)); // } if (count($assets) > 0) { Mail::to("admin@artassets.com")->send(new AssetEOLNotification($assets)); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка