| Current Path : /var/www/html/redd/app/Models/Backend/ |
| Current File : /var/www/html/redd/app/Models/Backend/ContentPhotoList.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_list', key: 'photo_id')]
#[Fillable([
'photo_gallery_id',
'photo_main',
'photo_parent_id',
'photo_language',
'photo_sort',
'photo_url',
'photo_descr',
'created_by',
'updated_by',
])]
class ContentPhotoList extends Model
{
use HasFactory;
public function translations()
{
return $this->hasMany(self::class, 'photo_parent_id', 'photo_id');
}
public function gallery()
{
return $this->belongsTo(ContentPhotoGallery::class, 'photo_gallery_id', 'gallery_id');
}
protected function casts(): array
{
return [
'photo_gallery_id' => 'integer',
'photo_main' => 'integer',
'photo_parent_id' => 'integer',
'photo_sort' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
}
}