some progress

This commit is contained in:
2025-06-13 23:06:13 +03:00
parent 621398978a
commit 71dd328431
25 changed files with 594 additions and 126 deletions
+3 -1
View File
@@ -40,6 +40,8 @@ class GameList extends Model
public function games(): BelongsToMany
{
return $this->belongsToMany(Game::class)->withTimestamps();
return $this->belongsToMany(Game::class)
->with(['platforms'])
->withTimestamps();
}
}
+2 -1
View File
@@ -14,6 +14,7 @@ class Rating extends Model
'user_id',
'game_id',
'rating',
'platform',
];
protected $casts = [
@@ -29,4 +30,4 @@ class Rating extends Model
{
return $this->belongsTo(Game::class);
}
}
}
+1
View File
@@ -16,6 +16,7 @@ class Review extends Model
'content',
'recommended',
'rating',
'platform',
];
protected $casts = [
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Wishlist extends Model
{
public const VISIBILITY_PUBLIC = 'public';
public const VISIBILITY_PRIVATE = 'private';
public const VISIBILITY_FRIENDS_ONLY = 'friends_only';
public const VISIBILITIES = [
self::VISIBILITY_PUBLIC,
self::VISIBILITY_PRIVATE,
self::VISIBILITY_FRIENDS_ONLY,
];
protected $fillable = [
'user_id',
'name',
'description',
'visibility',
];
}