lucasgiovanny / filament-multiselect-two-sides
This package is a Filament package that allows you to create a multiselect with two sides.
Fund package maintenance!
lucasgiovanny
Installs: 39 923
Dependents: 1
Suggesters: 0
Security: 0
Stars: 68
Watchers: 1
Forks: 7
Open Issues: 4
Requires
- php: ^8.1
- filament/filament: ^3.0
- filament/forms: ^3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-11-21 13:24:49 UTC
README
This package is a Filament plugin that allows you to create a multiselect with two sides.
Example
Installation
You can install the package via composer:
composer require lucasgiovanny/filament-multiselect-two-sides
Optionally, you can publish the translations:
php artisan vendor:publish --tag="filament-multiselect-two-sides-translations"
Usage
use LucasGiovanny\FilamentMultiselectTwoSides\Forms\Components\Fields\MultiselectTwoSides; return $form ->schema([ MultiselectTwoSides::make('roles') ->options([ 'admin' => 'Admin', 'manager' => 'Manager', 'user' => 'User', ]), ]);
Setting labels
MultiselectTwoSides::make('roles') ->options([ 'admin' => 'Admin', 'manager' => 'Manager', 'user' => 'User', ] ]) ->selectableLabel('Available Roles') ->selectedLabel('Selected Roles'),
Enabling the search
By default, the search is disabled. To enable it, use the enableSearch
method.
MultiselectTwoSides::make('roles') ->options([ 'admin' => 'Admin', 'manager' => 'Manager', 'user' => 'User', ]) ->enableSearch(),
Setting the default selected options
MultiselectTwoSides::make('roles') ->options([ 'admin' => 'Admin', 'manager' => 'Manager', 'user' => 'User', ]) ->default(['admin', 'manager']),
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
The MIT License (MIT). Please see License File for more information.