<?php
namespace App\Models;

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

class Layanan extends Model
{
    use HasFactory;
    protected $guarded = [];

    public function paket()
    {
        return $this->belongsToMany(Paket::class, 'paket_layanans', 'layanan_id', 'paket_id');
    }

    public function kategori()
    {
        return $this->belongsTo(Kategori::class, 'kategori_id');
    }

    // Menambahkan relasi ke model Provider
    public function provider()
    {
        return $this->belongsTo(Provider::class, 'provider_id'); // Menyesuaikan dengan kolom provider_id pada tabel layanan
    }
}
