wip filter

This commit is contained in:
salam committed 2026-01-10 13:17:09 +01:00
1 parent c4d7f2e6ee
commit d2caac4bcc
20 files changed
+567 -119

No files matched your search

-50
View File
@@ -2,26 +2,12 @@
namespace App\Livewire;
use App\Models\Client;
use App\Models\Sport;
use App\Models\User;
use Illuminate\Support\Facades\Route;
use Livewire\Component;
class TopMenuItems extends Component
{
public $clients = [];
public ?string $client = '';
public $sports = [];
public $sport_id = 0;
public $sporticon = '';
public $iconcolor = '';
public $current = '';
protected $listeners = [
@@ -31,20 +17,6 @@ class TopMenuItems extends Component
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();
}
@@ -53,21 +25,6 @@ class TopMenuItems extends Component
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]);
@@ -81,11 +38,4 @@ class TopMenuItems extends Component
$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()');
}
}