Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasgiovanny/filament-multiselect-two-sides
This package is a Filament package that allows you to create a multi-select with two sides.
https://github.com/lucasgiovanny/filament-multiselect-two-sides
Last synced: 4 days ago
JSON representation
This package is a Filament package that allows you to create a multi-select with two sides.
- Host: GitHub
- URL: https://github.com/lucasgiovanny/filament-multiselect-two-sides
- Owner: lucasgiovanny
- License: mit
- Created: 2023-02-22T09:17:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T12:49:24.000Z (4 months ago)
- Last Synced: 2024-12-11T11:13:29.571Z (11 days ago)
- Language: PHP
- Homepage:
- Size: 595 KB
- Stars: 69
- Watchers: 1
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome-filament - lucasgiovanny/filament-multiselect-two-sides - A multiselect field with two sides. (Fields)
README
# Filament Multiselect Two Sides
[![Latest Version on Packagist](https://img.shields.io/packagist/v/lucasgiovanny/filament-multiselect-two-sides.svg?style=flat-square)](https://packagist.org/packages/lucasgiovanny/filament-multiselect-two-sides)
[![Total Downloads](https://img.shields.io/packagist/dt/lucasgiovanny/filament-multiselect-two-sides.svg?style=flat-square)](https://packagist.org/packages/lucasgiovanny/filament-multiselect-two-sides)This package is a Filament plugin that allows you to create a multiselect with
two sides.![Filament Multiselector Two Sides](art/multiselect.png)
### Example
![Example of plugin](art/animate.gif)## Installation
You can install the package via composer:
```bash
composer require lucasgiovanny/filament-multiselect-two-sides
```Optionally, you can publish the translations:
```bash
php artisan vendor:publish --tag="filament-multiselect-two-sides-translations"
```## Usage
```php
use LucasGiovanny\FilamentMultiselectTwoSides\Forms\Components\Fields\MultiselectTwoSides;return $form
->schema([
MultiselectTwoSides::make('roles')
->options([
'admin' => 'Admin',
'manager' => 'Manager',
'user' => 'User',
]),
]);```
### Setting labels
```php
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.
```php
MultiselectTwoSides::make('roles')
->options([
'admin' => 'Admin',
'manager' => 'Manager',
'user' => 'User',
])
->enableSearch(),
```### Setting the default selected options
```php
MultiselectTwoSides::make('roles')
->options([
'admin' => 'Admin',
'manager' => 'Manager',
'user' => 'User',
])
->default(['admin', 'manager']),
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](./.github/SECURITY.md) on how to report security vulnerabilities.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.