<?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 $speciality_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\Speciality $speciality
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereProviderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereSpecialityId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality withTrashed(bool $withTrashed = true)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderSpeciality withoutTrashed()
 * @mixin \Eloquent
 */
class ProviderSpeciality extends Model
{
    use HasFactory, SoftDeletes;

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

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

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

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