<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Service extends Model
{
    use HasFactory;

    protected $fillable = [
        'name_en',
        'name_ar', 
        'mini_description_en', 
        'mini_description_ar', 
        'description_en', 
        'description_ar',
        'image',
        'order',
        'page_details',
    ];

    public function getPageDetailsStatusAttribute() {
        return ($this->page_details == 1) ? 'On' : 'Off';
    }

    public function scopeHasPageDetails() {
        return $this->where('page_details', 1);
    }

}
