toggle client button
This commit is contained in:
1 parent
3b8cebf10a
commit
49b1eba348
5 files changed
+59
-12
No files matched your search
@@ -64,6 +64,31 @@ class EventResource extends Resource
|
|||||||
$query->whereHas('event_user_star');
|
$query->whereHas('event_user_star');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auth()->user()->all_only_none) {
|
||||||
|
switch (auth()->user()->bookmaker_id) {
|
||||||
|
case 10:
|
||||||
|
$field = 'magnig_id';
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
$field = 'magken_id';
|
||||||
|
break;
|
||||||
|
case 35:
|
||||||
|
$field = 'lognig_id';
|
||||||
|
break;
|
||||||
|
case 36:
|
||||||
|
$field = 'logcol_id';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (auth()->user()->all_only_none) {
|
||||||
|
case 1:
|
||||||
|
$query->where($field, 1);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$query->where($field, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
|
if (in_array('odds_2ways', EventsTable::$bettype_settings)) {
|
||||||
$query->with('odds_2ways.bookmaker');
|
$query->with('odds_2ways.bookmaker');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,9 +60,15 @@ class BettypeToggle extends Component
|
|||||||
$this->dispatch('refreshBettypeMenu');
|
$this->dispatch('refreshBettypeMenu');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toggleFilter()
|
public function toggelAllOnlyNone()
|
||||||
{
|
{
|
||||||
User::where('id', auth()->user()->id)->update(['no_filter' => DB::raw('!no_filter')]);
|
|
||||||
|
$user = User::where('id', auth()->user()->id)->first();
|
||||||
|
$user->all_only_none++;
|
||||||
|
if ($user->all_only_none == 3) {
|
||||||
|
$user->all_only_none = 0;
|
||||||
|
}
|
||||||
|
$user->save();
|
||||||
|
|
||||||
$this->dispatch('refreshBettypeMenu');
|
$this->dispatch('refreshBettypeMenu');
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
|||||||
'sport_id',
|
'sport_id',
|
||||||
'star',
|
'star',
|
||||||
'is_multiline_direct',
|
'is_multiline_direct',
|
||||||
'no_filter',
|
'all_only_none',
|
||||||
'bookmaker_id',
|
'bookmaker_id',
|
||||||
'provider_id',
|
'provider_id',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ return new class extends Migration
|
|||||||
$table->boolean('has_email_authentication')->default(false);
|
$table->boolean('has_email_authentication')->default(false);
|
||||||
$table->boolean('stars')->default(false);
|
$table->boolean('stars')->default(false);
|
||||||
$table->boolean('is_multiline_direct')->default(false);
|
$table->boolean('is_multiline_direct')->default(false);
|
||||||
$table->boolean('no_filter')->default(false);
|
$table->boolean('all_only_none')->default(false);
|
||||||
$table->timestamp('app_verified_at')->nullable();
|
$table->timestamp('app_verified_at')->nullable();
|
||||||
|
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
|
|||||||
@@ -1,14 +1,30 @@
|
|||||||
<div class="flex flex-row gap-3">
|
<div class="flex flex-row gap-3">
|
||||||
|
|
||||||
{{-- <x-filament::button size="xs"
|
@switch(auth()->user()->all_only_none)
|
||||||
wire:click="toggleFilter"
|
@case(0)
|
||||||
:hidden="auth()->user()->is_multiline_direct ? false : true"
|
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="gray" icon="phosphor-gps"
|
||||||
:tooltip="auth()->user()->no_filter ? 'Comparing filters are disabled' : 'Comparing filters are active'"
|
tooltip="Showing with and without {{ auth()->user()->bookmaker->name }}">
|
||||||
:color="auth()->user()->no_filter ? 'primary' : 'gray'"
|
</x-filament::button>
|
||||||
:icon="auth()->user()->no_filter ? 'phosphor-funnel-x' : 'phosphor-funnel'">
|
@break
|
||||||
</x-filament::button> --}}
|
|
||||||
|
|
||||||
<x-filament::button size="xs" wire:click="toggleMultiline" :tooltip="auth()->user()->is_multiline_direct ? 'Multiline slots are disabled' : 'Multiline slots are active'" :color="auth()->user()->is_multiline_direct ? 'primary' : 'gray'" :icon="auth()->user()->is_multiline_direct ? 'phosphor-not-equals' : 'phosphor-equals'">
|
@case(1)
|
||||||
|
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="info" icon="phosphor-gps-fix"
|
||||||
|
tooltip="Showing only with {{ auth()->user()->bookmaker->name }}">
|
||||||
|
</x-filament::button>
|
||||||
|
@break
|
||||||
|
|
||||||
|
@case(2)
|
||||||
|
<x-filament::button size="xs" wire:click="toggelAllOnlyNone" color="warning" icon="phosphor-gps-slash"
|
||||||
|
tooltip="Showing only without {{ auth()->user()->bookmaker->name }}">
|
||||||
|
</x-filament::button>
|
||||||
|
@break
|
||||||
|
|
||||||
|
@default
|
||||||
|
@endswitch
|
||||||
|
|
||||||
|
|
||||||
|
<x-filament::button size="xs" wire:click="toggleMultiline" :tooltip="auth()->user()->is_multiline_direct ? 'Multiline slots are disabled' : 'Multiline slots are active'" :color="auth()->user()->is_multiline_direct ? 'primary' : 'gray'"
|
||||||
|
:icon="auth()->user()->is_multiline_direct ? 'phosphor-not-equals' : 'phosphor-equals'">
|
||||||
</x-filament::button>
|
</x-filament::button>
|
||||||
|
|
||||||
<x-filament::button size="xs" tooltip="Toggle favorits" wire:click="toggleStar" :color="auth()->user()->stars ? 'primary' : 'gray'"
|
<x-filament::button size="xs" tooltip="Toggle favorits" wire:click="toggleStar" :color="auth()->user()->stars ? 'primary' : 'gray'"
|
||||||
|
|||||||
Reference in new issue
Block a user