36 lines
659 B
PHP
36 lines
659 B
PHP
<?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',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'recommended' => 'boolean',
|
||
|
|
'rating' => 'integer',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function game(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Game::class);
|
||
|
|
}
|
||
|
|
}
|