diff --git a/composer.json b/composer.json index 50b20d6d..10ed81dc 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "flowframe/laravel-trend": "^0.1.5", "guava/filament-icon-picker": "^2.0", "lara-zeus/accordion": "^1.0", - "lara-zeus/core": "^3.0", + "lara-zeus/core": "^3.1", "ryangjchandler/blade-tabler-icons": "^2.2" }, "require-dev": { diff --git a/composer.lock b/composer.lock index a6098d9c..19cfdffd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dcc558221642dafa9e472c54973d8a64", + "content-hash": "1f0bed2ff6f97197f36ce58d2fb08c21", "packages": [ { "name": "alperenersoy/filament-export", @@ -8851,16 +8851,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.47.1", + "version": "v3.48.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "173c60d1eff911c9c54322704623a45561d3241d" + "reference": "a92472c6fb66349de25211f31c77eceae3df024e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/173c60d1eff911c9c54322704623a45561d3241d", - "reference": "173c60d1eff911c9c54322704623a45561d3241d", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a92472c6fb66349de25211f31c77eceae3df024e", + "reference": "a92472c6fb66349de25211f31c77eceae3df024e", "shasum": "" }, "require": { @@ -8930,7 +8930,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.47.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.48.0" }, "funding": [ { @@ -8938,7 +8938,7 @@ "type": "github" } ], - "time": "2024-01-16T18:54:21+00:00" + "time": "2024-01-19T21:44:39+00:00" }, { "name": "guzzlehttp/psr7", @@ -10320,29 +10320,29 @@ }, { "name": "pestphp/pest", - "version": "v2.31.0", + "version": "v2.32.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "3457841a9b124653edcfef1d5da24e6afe176f79" + "reference": "ac5d6c1f6754b4a6b4d16d825e5ebd4725a4f779" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/3457841a9b124653edcfef1d5da24e6afe176f79", - "reference": "3457841a9b124653edcfef1d5da24e6afe176f79", + "url": "https://api.github.com/repos/pestphp/pest/zipball/ac5d6c1f6754b4a6b4d16d825e5ebd4725a4f779", + "reference": "ac5d6c1f6754b4a6b4d16d825e5ebd4725a4f779", "shasum": "" }, "require": { "brianium/paratest": "^7.3.1", - "nunomaduro/collision": "^7.10.0|^8.0.1", + "nunomaduro/collision": "^7.10.0|^8.1.0", "nunomaduro/termwind": "^1.15.1|^2.0.0", "pestphp/pest-plugin": "^2.1.1", "pestphp/pest-plugin-arch": "^2.6.1", "php": "^8.1.0", - "phpunit/phpunit": "^10.5.5" + "phpunit/phpunit": "^10.5.7" }, "conflict": { - "phpunit/phpunit": ">10.5.5", + "phpunit/phpunit": ">10.5.7", "sebastian/exporter": "<5.1.0", "webmozart/assert": "<1.11.0" }, @@ -10373,7 +10373,8 @@ "Pest\\Plugins\\Snapshot", "Pest\\Plugins\\Verbose", "Pest\\Plugins\\Version", - "Pest\\Plugins\\Parallel" + "Pest\\Plugins\\Parallel", + "Pest\\Plugins\\JUnit" ] }, "phpstan": { @@ -10412,7 +10413,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v2.31.0" + "source": "https://github.com/pestphp/pest/tree/v2.32.0" }, "funding": [ { @@ -10424,7 +10425,7 @@ "type": "github" } ], - "time": "2024-01-11T15:33:20+00:00" + "time": "2024-01-20T13:48:00+00:00" }, { "name": "pestphp/pest-plugin", @@ -11601,16 +11602,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.5", + "version": "10.5.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" + "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e5c5b397a95cb0db013270a985726fcae93e61b8", + "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8", "shasum": "" }, "require": { @@ -11682,7 +11683,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.7" }, "funding": [ { @@ -11698,7 +11699,7 @@ "type": "tidelift" } ], - "time": "2023-12-27T15:13:52+00:00" + "time": "2024-01-14T16:40:30+00:00" }, { "name": "pimple/pimple", diff --git a/src/Fields/Classes/Toggle.php b/src/Fields/Classes/Toggle.php index 626a677a..2d573de5 100644 --- a/src/Fields/Classes/Toggle.php +++ b/src/Fields/Classes/Toggle.php @@ -4,10 +4,15 @@ use Filament\Forms\Components\Grid; use Filament\Forms\Components\Hidden; +use Filament\Tables\Columns\Column; +use Filament\Tables\Columns\IconColumn; use Guava\FilamentIconPicker\Forms\IconPicker; +use Illuminate\Database\Eloquent\Builder; use LaraZeus\Accordion\Forms\Accordion; use LaraZeus\Accordion\Forms\Accordions; use LaraZeus\Bolt\Fields\FieldsContract; +use LaraZeus\Bolt\Models\Field; +use LaraZeus\Bolt\Models\Response; class Toggle extends FieldsContract { @@ -96,4 +101,19 @@ public function appendFilamentComponentsOptions($component, $zeusField, bool $ha return $component->live(); } + + public function TableColumn(Field $field): ?Column + { + return IconColumn::make('zeusData.' . $field->id) + ->label($field->name) + ->boolean() + ->searchable(query: function (Builder $query, string $search): Builder { + return $query + ->whereHas('fieldsResponses', function ($query) use ($search) { + $query->where('response', 'like', '%' . $search . '%'); + }); + }) + ->getStateUsing(fn (Response $record) => $this->getFieldResponseValue($record, $field)) + ->toggleable(); + } }