fix: refactored the codebase

This commit is contained in:
2026-08-20 23:00:47 +02:00
parent 6f47ed0674
commit a77f74911d
64 changed files with 2864 additions and 1739 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Resources;
use App\Data\Rooms\RoomPageData;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CurrentPlayerResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
/** @var RoomPageData $pageData */
$pageData = $this->resource;
$player = $pageData->currentPlayer;
return [
'id' => $player->id,
'name' => $player->name,
'is_moderator' => $player->is_moderator,
'current_vote' => $pageData->currentVote,
];
}
}