<?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 $client_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\Client $client
 * @property-read \App\Models\Provider $provider
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereClientId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereProviderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock withTrashed(bool $withTrashed = true)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ProviderClientBlock withoutTrashed()
 * @mixin \Eloquent
 */
class ProviderClientBlock extends Model
{
    use HasFactory, SoftDeletes;

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

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
        'deleted_at' => 'datetime',
    ];

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

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