Your IP : 216.73.216.79


Current Path : /var/www/html/redd/app/Models/Backend/
Upload File :
Current File : /var/www/html/redd/app/Models/Backend/ContentPhotoGalleryTranslation.php

<?php

namespace App\Models\Backend;

use App\Models\Backend\ContentPhotoGallery;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

#[Table('content_photo_gallery_translations', key: 'gallery_translation_id')]
#[Fillable([
    'gallery_translation_parent_id',
    'gallery_translation_title',
    'gallery_translation_descr',
    'gallery_translation_main',
    'gallery_translation_language',
    'created_by',
    'updated_by',
])]
class ContentPhotoGalleryTranslation extends Model
{
    use HasFactory;

    protected function casts(): array
    {
        return [
            'gallery_translation_parent_id' => 'integer',
            'gallery_translation_main'       => 'boolean',
            'created_by'                     => 'integer',
            'updated_by'                     => 'integer',
            'created_at'                     => 'datetime',
            'updated_at'                     => 'datetime',
        ];
    }

    public function gallery()
    {
        return $this->belongsTo(
            ContentPhotoGallery::class,
            'gallery_translation_parent_id',
            'gallery_id'
        );
    }
}