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/ContentApplication.php

<?php

namespace App\Models\Backend;

use App\Models\Backend\ContentApplicationTranslation;
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_applications', key: 'application_id')]
#[Fillable([
    'application_cat',
    'application_status',
    'application_url',
    'application_img',
    'application_sort',
    'created_by',
    'updated_by',
])]
class ContentApplication extends Model
{
    use HasFactory;

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

    /*
    |--------------------------------------------------------------------------
    | RELATIONSHIPS
    |--------------------------------------------------------------------------
    */

    public function translations()
    {
        return $this->hasMany(
            ContentApplicationTranslation::class,
            'application_translation_parent_id',
            'application_id'
        );
    }
}