$realm) { if ($realm['id']) { $this->selectedRealm = $key; break; } } $this->user = Auth::guard('account')->user(); $this->accountId = $this->user->id; } public function setRealm($realmId) { $this->selectedRealm = $realmId; $this->render(); } public function readAllMessages($shopAppealId) { ShopAppeal::find($shopAppealId)->setSeenMessagesForPlayer(); } public function render() { $shopLogs = []; foreach (config('customs.realms') as $key => $realm) { if ($realm['id'] && $key == $this->selectedRealm) { $shopLogs = ShopLog::where('account', $this->accountId)->where('realm_id', $key)->orderBy('time', 'desc')->get(); } } $paymentHistory = ShopCoinsHistory::where('account_id', $this->accountId)->orderBy('id', 'desc')->get(); return view('livewire.profile-payment-history', compact('paymentHistory', 'shopLogs')); } }