Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Language/database/seeders/68334/Jobs.zip
Назад
PK ���Zij�q UpdateTranslationCodeJob.phpnu �[��� <?php namespace Modules\Language\app\Jobs; 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 UpdateTranslationCodeJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public function __construct( protected $oldCode, protected $newCode, protected $translateableModel ) { } public function handle(): void { $countCreatedModels = 0; $oldModels = $this->translateableModel::where('lang_code', $this->oldCode)->get(); foreach ($oldModels as $oldModel) { $oldModel->lang_code = $this->newCode; $oldModel->save(); $countCreatedModels++; } Log::info("Total { $countCreatedModels } new recordes has been updated on {$this->translateableModel} model for {$this->newCode} Language using Queue"); } } PK ���Zn2c c error_lognu �[��� [07-May-2025 19:09:27 UTC] PHP Fatal error: Trait "Illuminate\Foundation\Bus\Dispatchable" not found in /home/lekhnath/silverray.com.au/Modules/Language/app/Jobs/CreateNewTranslatedDataJob.php on line 13 [07-May-2025 21:33:36 UTC] PHP Fatal error: Trait "Illuminate\Foundation\Bus\Dispatchable" not found in /home/lekhnath/silverray.com.au/Modules/Language/app/Jobs/UpdateTranslationCodeJob.php on line 12 [07-May-2025 21:43:04 UTC] PHP Fatal error: Trait "Illuminate\Foundation\Bus\Dispatchable" not found in /home/lekhnath/silverray.com.au/Modules/Language/app/Jobs/DeleteTranslationDataJob.php on line 12 PK ���Z's�b b CreateNewTranslatedDataJob.phpnu �[��� <?php namespace Modules\Language\app\Jobs; 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; use Modules\Language\app\Traits\TranslateableModelsTrait; class CreateNewTranslatedDataJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, TranslateableModelsTrait; public function __construct( protected $defaultCode, protected $newCode, protected $translateableModel ) { } public function handle(): void { $countCreatedModels = 0; $oldModels = $this->translateableModel::where('lang_code', $this->defaultCode)->get(); $ignoredColumns = $this->getIgnoredColumsArray(); foreach ($oldModels as $oldModel) { if (! $this->translateableModel::where(['id' => $oldModel->id, 'lang_code' => $this->newCode])->exists()) { $newModel = new $this->translateableModel(); $newModel->lang_code = $this->newCode; foreach ($oldModel->toArray() as $key => $value) { if (! in_array($key, $ignoredColumns)) { $newModel->$key = $value; } } $newModel->save(); $countCreatedModels++; } } Log::info("Total {$countCreatedModels} new records have been saved into {$this->translateableModel} model for {$this->newCode} Language using Queue"); } } PK ���ZJ�X`� � DeleteTranslationDataJob.phpnu �[��� <?php namespace Modules\Language\app\Jobs; 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 DeleteTranslationDataJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; /** * Create a new job instance. */ public function __construct( protected $code, protected $translateableModel ) { } /** * Execute the job. */ public function handle(): void { $deleteModels = $this->translateableModel::where('lang_code', $this->code); $countCreatedModels = $deleteModels->count(); $deleteModels->delete(); Log::info("Total { $countCreatedModels } recordes has been deleted into {$this->translateableModel} model for {$this->code} Language"); } } PK ���Zij�q UpdateTranslationCodeJob.phpnu �[��� PK ���Zn2c c k error_lognu �[��� PK ���Z's�b b CreateNewTranslatedDataJob.phpnu �[��� PK ���ZJ�X`� � � DeleteTranslationDataJob.phpnu �[��� PK _ �
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка