user()->client_id)->pluck('sport')->first(); $this->sports = Sport::whereIn('id', $cps)->pluck('name', 'id'); $this->sporticon = Sport::where('id', auth()->user()->sport_id)->pluck('icon')->first(); $this->iconcolor = Sport::where('id', auth()->user()->sport_id)->pluck('color')->first(); $this->sport_id = auth()->user()->sport_id; $this->clients = Client::pluck('name', 'id')->all(); $this->client = Client::where('id', auth()->user()->client_id)->pluck('name')->first(); $this->current = Route::currentRouteName(); } public function render() { return view('livewire.top-menu-items'); } public function swop($client_id) { $bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first(); $bookmaker_id = array_shift($bookmakers); User::where('id', auth()->user()->id)->update(['bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]); $this->js('window.location.reload()'); } public function swopSport() { User::where('id', auth()->user()->id)->update(['sport_id' => $this->sport_id]); $this->js('window.location.reload()'); } }