Your IP : 216.73.216.79


Current Path : /var/www/html/dynaweb-cms-v1/app/Models/Backend/
Upload File :
Current File : /var/www/html/dynaweb-cms-v1/app/Models/Backend/ContentImage.php

<?php

namespace App\Models\Backend;

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_images', key: 'image_id')]
#[Fillable([
    'image_cat',
    'image_type',
    'image_status',
    'image_title',
    'image_file',
    'image_url',
    'image_sort',
    'image_main',
    'image_parent_id',
    'image_language',
    'created_by',
    'updated_by',
])]
class ContentImage extends Model
{
    use HasFactory;

    public function translations()
    {
        return $this->hasMany(self::class, 'image_parent_id', 'image_id');
    }

    protected function casts(): array
    {
        return [
            'image_sort' => 'integer',
            'image_main' => 'integer',
            'created_at' => 'datetime',
            'updated_at' => 'datetime',
        ];
    }
}