<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property int $id
 * @property int $review_id
 * @property int $media_id
 * @property string $origin
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\Media $media
 * @property-read \App\Models\Review $review
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereMediaId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereOrigin($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereReviewId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ReviewMedia whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class ReviewMedia extends Model
{
    protected $table = 'review_media';

    protected $fillable = ['review_id', 'media_id', 'origin'];

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

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