'$refresh', 'reload_data_right' => '$refresh', ]; public function mount() { $cps = Client::where('id', auth()->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) { $providers = Client::where('id', $client_id)->pluck('provider')->first(); $provider_id = array_shift($providers); $bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first(); $bookmaker_id = array_shift($bookmakers); User::where('id', auth()->user()->id)->update(['sport_id' => 1, 'provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]); $this->js('window.location.reload()'); } public function swopBookmaker($bookmaker_id) { User::where('id', auth()->user()->id)->update(['bookmaker_id' => $bookmaker_id]); $this->js('window.location.reload()'); } public function swopProvider($provider_id) { User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id]); $this->dispatch('reload_data_right'); } public function swopSport() { User::where('id', auth()->user()->id)->update(['sport_id' => $this->sport_id]); $this->js('window.location.reload()'); } }