From db5b9abb461de78977fc9a18142881f836ca4488 Mon Sep 17 00:00:00 2001 From: nanaya Date: Fri, 22 May 2026 21:28:32 +0900 Subject: [PATCH] Add ranked play user history model --- app/Models/MatchmakingUserEloHistory.php | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/Models/MatchmakingUserEloHistory.php diff --git a/app/Models/MatchmakingUserEloHistory.php b/app/Models/MatchmakingUserEloHistory.php new file mode 100644 index 00000000000..73e3cc02436 --- /dev/null +++ b/app/Models/MatchmakingUserEloHistory.php @@ -0,0 +1,51 @@ +. Licensed under the GNU Affero General Public License v3.0. +// See the LICENCE file in the repository root for full licence text. + +declare(strict_types=1); + +namespace App\Models; + +use Illuminate\Database\Eloquent\Relations\BelongsTo; + +/** + * @property int $id + * @property Multiplayer\Room $room + * @property int $room_id + * @property MatchmakingPool $pool + * @property int $pool_id + * @property User $user + * @property int $user_id + * @property User $opponent + * @property int $opponent_id + * @property string $result + * @property int $elo_before + * @property int $elo_after + * @property \Carbon\Carbon|null $created_at + * @property \Carbon\Carbon|null $updated_at + */ +class MatchmakingUserEloHistory extends Model +{ + protected $table = 'matchmaking_user_elo_history'; + + public function opponent(): BelongsTo + { + return $this->belongsTo(User::class, 'opponent_id'); + } + + public function pool(): BelongsTo + { + return $this->belongsTo(MatchmakingPool::class); + } + + public function room(): BelongsTo + { + return $this->belongsTo(Multiplayer\Room::class, 'room_id'); + } + + public function user(): BelongsTo + { + return $this->belongsTo(User::class, 'user_id'); + } +}