This commit is contained in:
salam committed 2026-10-04 15:25:03 +02:00
1 parent 9bcd4432c6
commit 6f92f9e1d5
1209 files changed
+220940

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Livewire;
use App\Models\Provider;
use App\Models\Sport;
use App\Models\User;
use Illuminate\Support\Facades\Route;
use Livewire\Component;
class TopMenuItems extends Component
{
public $current = '';
protected $listeners = [
'refreshMapperLeft' => '$refresh',
'refreshMapperRight' => '$refresh',
];
protected string $sport = '';
public function mount()
{
$this->current = Route::currentRouteName();
}
public function setUser()
{
$user = User::find(auth()->user()->id);
$this->sport = Sport::where('id', $user->sport_id)->value('name');
}
public function render()
{
return view('livewire.top-menu-items', ['sport' => $this->sport]);
}
public function swopBookmaker($bookmaker_id)
{
$provider_id = Provider::where('bookmaker_id', $bookmaker_id)->value('id');
User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'partner_bookmaker_id' => auth()->user()->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('refreshMapperRight');
}
}