2025-04-12 17:18:33 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
|
|
class Review extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'user_id',
|
|
|
|
|
'game_id',
|
|
|
|
|
'content',
|
|
|
|
|
'recommended',
|
|
|
|
|
'rating',
|
2026-02-22 20:02:34 +02:00
|
|
|
'platform_id',
|
2025-04-12 17:18:33 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'recommended' => 'boolean',
|
|
|
|
|
'rating' => 'integer',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function user(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function game(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Game::class);
|
|
|
|
|
}
|
2026-02-22 20:02:34 +02:00
|
|
|
|
|
|
|
|
public function platform(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Platform::class);
|
|
|
|
|
}
|
2025-04-12 17:18:33 +03:00
|
|
|
}
|