Файловый менеджер - Редактировать - /home/c7lekhnath/silverray.com.au/Modules/Testimonial/app/Models/Testimonial.php
Назад
<?php namespace Modules\Testimonial\app\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; class Testimonial extends Model { use HasFactory; /** * The attributes that are mass assignable. */ protected $fillable = [ 'image', 'status', ]; public function getNameAttribute(): ?string { return $this->translation->name; } public function getDesignationAttribute(): ?string { return $this->translation->designation; } public function getCommentAttribute(): ?string { return $this->translation->comment; } public function translation(): ?HasOne { return $this->hasOne(TestimonialTranslation::class)->where('lang_code', getSessionLanguage()); } public function getTranslation($code): ?TestimonialTranslation { return $this->hasOne(TestimonialTranslation::class)->where('lang_code', $code)->first(); } public function translations(): ?HasMany { return $this->hasMany(TestimonialTranslation::class, 'testimonial_id'); } public function scopeActive($query) { return $query->where('status', 1); } public function scopeInactive($query) { return $query->where('status', 0); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.20 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка