This commit is contained in:
salam committed 2026-02-02 12:07:53 +01:00
1 parent 51a195e657
commit ff43f231f0
3 files changed
+34 -26

No files matched your search

@@ -37,10 +37,17 @@ class ListEvents extends ListRecords
$this->removeTableFilters();
}
// public function updateStar(): void
// {
// $this->tableFilters['events']['filter_stars'] = auth()->user()->filter_stars;
// }
public function updateStar(): void
{
// $filters = $this->table->getFilters();
$filters = $this->getTable()->getFilters();
dd($filters['filter_stars']->getState());
$filter_stars = $filters['filter_stars']->getState();
$this->tableFilters['events']['filter_stars'] = ! $filter_stars;
}
// public function updateNote(): void
// {
+21 -15
View File
@@ -16,6 +16,12 @@ class BettypeToggle extends Component
'refreshBettypeMenu' => '$refresh',
];
protected $filter_star = false;
protected $filter_note = false;
protected $filter_notify = false;
public function boot()
{
$this->bettype_toggles = [];
@@ -46,23 +52,23 @@ class BettypeToggle extends Component
$this->dispatch('refreshBettypeMenu');
}
// public function toggleStar()
// {
// User::where('id', auth()->user()->id)->update(['filter_stars' => DB::raw('!filter_stars')]);
// $this->dispatch('filterStarFilter');
// }
public function toggleStar()
{
$this->filter_star = ! $this->filter_star;
$this->dispatch('filterStarFilter', ['filter', $this->filter_star]);
}
// public function toggleNote()
// {
// User::where('id', auth()->user()->id)->update(['filter_notes' => DB::raw('!filter_notes')]);
// $this->dispatch('filterNotificationFilter');
// }
public function toggleNote()
{
User::where('id', auth()->user()->id)->update(['filter_notes' => DB::raw('!filter_notes')]);
$this->dispatch('filterNotificationFilter');
}
// public function toggleNotification()
// {
// User::where('id', auth()->user()->id)->update(['filter_notification' => DB::raw('!filter_notification')]);
// $this->dispatch('filterStarFilter');
// }
public function toggleNotification()
{
User::where('id', auth()->user()->id)->update(['filter_notification' => DB::raw('!filter_notification')]);
$this->dispatch('filterStarFilter');
}
public function toggleShowPartner()
{
@@ -45,19 +45,14 @@
@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 ? 'info' : 'gray'"
:icon="auth()->user()->is_multiline_direct ? 'phosphor-not-equals' : 'phosphor-equals'">
</x-filament::button>
<x-filament::button color="gray" outlined x-on:click="$wire.set('tableFilters', {'filter_stars': {'value': '1'}})"
:icon="auth()->user()->filter_stars ? 'phosphor-star-fill' : 'phosphor-star'">
<x-filament::button size="xs" tooltip="Filter favorits" wire:click="toggleStar" :color="$this->filter_star ? 'info' : 'gray'"
:icon="$this->filter_star ? 'phosphor-star-fill' : 'phosphor-star'">
</x-filament::button>
{{-- <x-filament::button size="xs" tooltip="Filter favorits" wire:click="toggleStar" :color="auth()->user()->filter_stars ? 'info' : 'gray'"
:icon="auth()->user()->filter_stars ? 'phosphor-star-fill' : 'phosphor-star'">
</x-filament::button> --}}
<x-filament::button size="xs" tooltip="Filter notes" wire:click="toggleNote" :color="auth()->user()->filter_notes ? 'info' : 'gray'"
:icon="auth()->user()->filter_notes ? 'phosphor-note-fill' : 'phosphor-note'">
</x-filament::button>