Combobox plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Combobox

Community

Side by side combobox multiselect field.

Tags: Forms Form Field
Supported versions:
5.x 4.x 3.x
Jesús García avatar Author: Jesús García

Package health

Beta

Automated checks of this plugin's Composer package

82 / 100
Security 68
Maintenance 100
Ecosystem 100
13 checks
  • Passed: Current Laravel version supported — Package dependencies resolve together with current Laravel 13.0.
  • Passed: Current PHP version supported — Constraint ^8.2 supports current PHP 8.5.
  • Skipped: Current Symfony version supported
  • Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
  • Passed: Commit and release recency — Active: last commit 178 days ago; last release 178 days ago.
  • Passed: composer.lock not committed by library composer.lock is absent from the released dist archive.
  • Passed: Dist archive is lean
  • Skipped: GitHub Actions pinned to SHA
  • Passed: Open security advisories
  • Passed: Dependabot PR responsiveness — No open Dependabot PRs.
  • Failed: Dependabot or Renovate configured No dependency updater configuration found. View details on Plumb
  • Skipped: Dependency update cooldown configured
  • Failed: Provides a security policy View details on Plumb
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 2 days ago

Documentation

Version:

Side by side combobox multiselect field to use in your FilamentPHP forms.

Cover

#Installation

You can install the package via composer:

composer require novadaemon/filament-combobox

This package supports Filament 3.x and 4.x

#Usage

Simply use the component as you'd use any other Filament field. It's especially perfect for the resource view page where it blends right in.

use Novadaemon\FilamentCombobox\Combobox;

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('vegetables')
                ->options([
                    'carrot' => 'Carrot',
                    'potato' => 'Potato',
                    'tomato' => 'Tomato',
                ])
            ]);
    }
}

Since the Combobox component extends the Filament\Forms\Components\Select class, it is possible to use almost all methods of the parent component.

#Integrating with an Eloquent relationship

use Novadaemon\FilamentCombobox\Combobox;

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
            ]);
    }
}

#Customize

#Enabling search in the boxes

use Novadaemon\FilamentCombobox\Combobox;

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
                ->boxSearchs()
            ]);
    }
}

The boxSearchs method accepts a boolean or closure callback function.

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
                ->boxSearchs(fn() => auth()->user()->isAdmin())
            ]);
    }
}

#Modifying the height of the component

Yo can change the height of the component using the height method:

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
                ->height('500px')
            ]);
    }
}

#Customize the label of the boxes

Changing the label of the boxes:

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
                ->optionsLabel('Available categories')
                ->selectedLabel('Selected categories')
            ]);
    }
}

Hiding the label on the boxes:

class FileResource extends Resource
{
    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Combobox::make('categories')
                ->relationship('categories', 'name')
                ->showLabels(false)
            ]);
    }
}

#Translations

Optionally, you can publish the translations using

php artisan vendor:publish --tag="filament-combobox-translations"

Now, yo can modify or add custom translation files.

#Contributing

Contributing is pretty chill and is highly appreciated! Just send a PR and/or create an issue!

#Credits

#License

The MIT License (MIT). Please see License File for more information.

#Screenshot

Screenshot

The author

Jesús García avatar Author: Jesús García

Trying to be a programmer for more than 10 years. Passionate about web technologies, PHP and Laravel.

Plugins
2
Stars
81

From the same author