ldc-legaulois/app/Jobs/UpdateReductions.php

36 lines
772 B
PHP
Raw Normal View History

2021-03-21 22:51:19 +01:00
<?php
namespace App\Jobs;
2021-10-13 12:06:41 +02:00
use App\Models\Reduction;
2021-03-21 22:51:19 +01:00
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class UpdateReductions implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
public $console = null;
public function handle()
{
2021-10-13 12:06:41 +02:00
Reduction::updateBr();
$this->log(__CLASS__ . " Reduction updated successfuly!");
2021-03-21 22:51:19 +01:00
}
private function log(string $message)
{
if ($this->console) {
$this->console->info($message);
}
Log::debug($message);
}
}