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

    protected $fillable = [
        'client_id',
        'provider_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);
    }
}
