<?php

namespace App\Models;

use App\Scopes\UserScope;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Models\UserFavorite.
 *
 * @property int                             $id
 * @property int                             $user_id    user_id
 * @property int                             $episode_id 短剧ID
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 *
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite newQuery()
 * @method static \Illuminate\Database\Query\Builder|UserFavorite onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite query()
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereEpisodeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereUserId($value)
 * @method static \Illuminate\Database\Query\Builder|UserFavorite withTrashed()
 * @method static \Illuminate\Database\Query\Builder|UserFavorite withoutTrashed()
 *
 * @mixin \Eloquent
 *
 * @property \App\Models\Episode|null $episode
 *
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite filterUser()
 *
 * @property int $list_id 剧集ID
 *
 * @method static \Illuminate\Database\Eloquent\Builder|UserFavorite whereListId($value)
 */
class UserFavorite extends Model
{
    use HasFactory;
    use SoftDeletes;
    use UserScope;

    protected $table = 'user_favorite';

    public function episode()
    {
        return $this->belongsTo(Episode::class, 'episode_id', 'id');
    }
}
