Files
gamelog/app/Models/Review.php
T

16 lines
598 B
PHP
Raw Normal View History

2026-05-29 00:33:00 +03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Review extends Model
{
protected $fillable = ['user_id','game_id','rating','body','has_spoilers','helpful_count'];
protected $casts = ['has_spoilers'=>'boolean'];
public function user(): BelongsTo { return $this->belongsTo(User::class); }
public function game(): BelongsTo { return $this->belongsTo(Game::class); }
public function votes(): HasMany { return $this->hasMany(ReviewVote::class); }
}