<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * @property int $id
 * @property int $provider_id
 * @property int $service_type_id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read \App\Models\Provider $provider
 * @property-read \App\Models\ServiceType $serviceType
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereProviderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereServiceTypeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType withTrashed(bool $withTrashed = true)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderServicesType withoutTrashed()
 * @mixin \Eloquent
 */
class ProviderServicesType extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'provider_id',
        'service_type_id',
    ];

    protected $casts = [
        'provider_id'     => 'integer',
        'service_type_id' => 'integer',
    ];

    public function provider(): BelongsTo
    {
        return $this->belongsTo(Provider::class);
    }

    public function serviceType(): BelongsTo
    {
        return $this->belongsTo(ServiceType::class);
    }
}
