ReviewMedia.php 664 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  5. /**
  6. * @property int $id
  7. * @property int $review_id
  8. * @property int $media_id
  9. * @property string $origin
  10. * @property-read \App\Models\Media $media
  11. * @property-read \App\Models\Review $review
  12. */
  13. class ReviewMedia extends Model
  14. {
  15. protected $table = 'review_media';
  16. protected $fillable = ['review_id', 'media_id', 'origin'];
  17. public function review(): BelongsTo
  18. {
  19. return $this->belongsTo(Review::class);
  20. }
  21. public function media(): BelongsTo
  22. {
  23. return $this->belongsTo(Media::class);
  24. }
  25. }