lucasgiovanny/filament-multiselect-two-sides

This package is a Filament package that allows you to create a multiselect with two sides.
85,619 68
Install
composer require lucasgiovanny/filament-multiselect-two-sides
Latest Version:v2.1.2
PHP:^8.1
Older releases:9 · 10 · 11
License:MIT
Last Updated:Aug 21, 2024
Links: GitHub  ·  Packagist
Maintainer: lucasgiovanny

Filament Multiselect Two Sides

Latest Version on Packagist Total Downloads

This package is a Filament plugin that allows you to create a multiselect with two sides.

Filament Multiselector Two Sides

Example

Example of plugin

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607

Version History

Version Released PHP Laravel License
v2.1.2 ^8.1 MIT
v2.1.1 ^8.1 ^9.0|^10.0|^11.0 MIT
v2.1.0 ^8.1 ^9.0|^10.0|^11.0 MIT
v2.0.0 ^8.1 ^9.0|^10.0 MIT
v1.1.2 ^8.1 ^9.0|^10.0 MIT
Pre-releases (1)
Version Released PHP License
v3.0.0-alpha ^8.1 MIT