variety of premium plugins

Learn More

bolt

you are reading the documentation for version v3
to check your version use: composer show lara-zeus/bolt

Create Custom Fields

Add any custom fields you want that is available on the filament core or filament plugins.

For example, we want to allow our users to use icon picker in the forms.

First, install the package:

composer require guava/filament-icon-picker

Create bolt field

Create the field using the following command, passing the fully qualified name of the form component:

php artisan make:zeus-field \\Guava\\FilamentIconPicker\\Forms\\IconPicker

Caching

Bolt will automatically list the field in the form builder. There is a cache for all fields, so remember to flush the key bolt.fields

Customization

check out the contract LaraZeus\Bolt\Fields\FieldsContract and see all the available methods.

Disabling

You can turn off any field temporally by adding:

public bool $disabled = true;

Field Title:

public function title(): string
{
return __(class_basename($this));
}

Field Options

you can add any options to be shown on the admin page when creating the form

public static function getOptions(): array
{
return [
Toggle::make('options.is_required')->label(__('Is Required')),
];
}

And to apply these options to the field in the frontend:

public function appendFilamentComponentsOptions($component, $zeusField)
{
parent::appendFilamentComponentsOptions($component, $zeusField);
 
if (isset($zeusField->options['is_required']) && $zeusField->options['is_required']) {
$component = $component->required();
}
}

Disable the options tab

if your field doesn't have any options, you can turn off the options tab by removing the method getOptions or returning false:

public function hasOptions(): bool
{
return false;
}

View the Response

you can control how to view the response on the entries pages

public function getResponse($field, $resp): string
{
return $resp->response;
}