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

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

    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);
    }
}
