Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Tax/app/Models/Tax.php
Назад
<?php namespace Modules\Tax\app\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Factories\HasFactory; class Tax extends Model { use HasFactory; protected $fillable = ['slug','percentage', 'status']; // make a accessor for translation public function getTitleAttribute(): ?string { return $this->translation->title; } public function translation(): ?HasOne { return $this->hasOne(TaxTranslation::class)->where('lang_code', getSessionLanguage()); } public function getTranslation($code): ?TaxTranslation { return $this->hasOne(TaxTranslation::class)->where('lang_code', $code)->first(); } public function translations(): ?HasMany { return $this->hasMany(TaxTranslation::class, 'tax_id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка