<?php

namespace App\Models;

use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Services extends Model
{
    use HasFactory;
    use HasSlug;
    use SoftDeletes;

    protected $table = 'services';
    protected $primaryKey = 'id';

    protected $fillable = [
        'service_id',
        'name',
        'code',
        'price',
        'parent_category',
        'sub_category',
        'price_variant',
        'featured_image',
        'featured_image_url',
        'status'
    ];
    
    public function getSlugOptions() : SlugOptions
    {
        return SlugOptions::create()
            ->generateSlugsFrom('name')
            ->saveSlugsTo('slug');
    }

 
}
