<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ProviderService extends Model
{
    protected $fillable = [
        'vendor_type_id', 'name', 'description', 'icon', 'fixed_price', 'is_active'
    ];

    protected $casts = [
        'fixed_price' => 'decimal:2',
        'is_active'   => 'boolean',
    ];

    public function vendorType()
    {
        return $this->belongsTo(VendorType::class);
    }

    public function vendors()
    {
        return $this->belongsToMany(Vendor::class, 'vendor_provider_services');
    }
}
