Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Dec 22, 2023
1 parent 101ac2e commit 94cd797
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions app/Tables/Columns/ServiceChipsColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Closure;
use Filament\Tables\Columns\Column;
use Filament\Tables\Columns\Concerns;
use Illuminate\Support\Collection;

class ServiceChipsColumn extends Column
{
Expand All @@ -29,4 +30,11 @@ public function getSize(mixed $state): string | null
'state' => $state,
]);
}

public function getServices(): Collection
{
return collect($this->getState())
->filter(fn ($service) => $service->is_visible)
->dump();
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
@php
$services = $getState()->filter(fn($service) => $service->is_visible);
@endphp

<div {{ $attributes->merge($getExtraAttributes(), escape: false)->class('flex flex-wrap gap-2') }}>
@foreach ($services as $service)
@foreach ($getServices() as $service)
<x-chip
:size="$getSize($state)"
:color="$service->is_available ? 'primary' : 'gray'"
Expand Down

0 comments on commit 94cd797

Please sign in to comment.