Skip to content

This package is a Filament package that allows you to create a multi-select with two sides.

License

Notifications You must be signed in to change notification settings

lucasgiovanny/filament-multiselect-two-sides

Repository files navigation

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.

About

This package is a Filament package that allows you to create a multi-select with two sides.

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project