Files
api-extranetwork/app/Console/Commands/ApplicationLanguageFiles/ApplicationFillTableLanguageKey.php
ExtraNetwork e5c4b6aa13 first commit
2026-05-12 17:04:54 +03:00

49 lines
1.4 KiB
PHP

<?php
namespace App\Console\Commands\ApplicationLanguageFiles;
use App\Core\Service\LanguageBaseService;
use App\Exceptions\ApiErrorException;
use Illuminate\Console\Command;
use Exception;
use Illuminate\Support\Facades\Log;
class ApplicationFillTableLanguageKey extends Command
{
protected $signature = 'cron:create-application-fill-table-language-key'; // read table name column, update table key column
protected $description = '';
private $languageBaseService;
public function __construct(
LanguageBaseService $languageBaseService
)
{
$this->languageBaseService = $languageBaseService;
parent::__construct();
}
public function handle()
{
try {
$this->info(date('Y-m-d H:i:s') . ' : ' . date('Y-m-d') . ' LANGUAGE BASE START');
$process = $this->languageBaseService->fillApplicationLanguageKeys();
if($process['status'] != 'success'){
throw new Exception($process['message']) ;
}
$this->info(date('Y-m-d H:i:s') . ' : ' . date('Y-m-d') . ' LANGUAGE BASE FINISHED');
} catch (Exception $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error($message);
$this->error(date('Y-m-d H:i:s') . ' : ' . date('Y-m-d') . ' ERROR: ' . $message);
}
}
}