12345678910111213141516171819202122232425 |
- <?php
- namespace App\HttpModels;
- use App\Models\Pro;
- class ProModel {
- public $uid;
- public $name;
- public $type;
- public $avatarFile;
- public $is_active_and_visible;
- public $lobbies = [];
- public function __construct(Pro $pro)
- {
- $this->uid = $pro->uid;
- $this->name = $pro->name_display;
- $this->type = $pro->pro_type;
- $this->avatarFile = $pro->profile_picture_base64;
- $this->is_active_and_visible = $pro->is_currently_clocked_in;
- foreach ($pro->lobbies()->where('lobby.is_active',true)->get() as $lobby) {
- $this->lobbies[] = new LobbyModel($lobby);
- }
- }
- }
|