bolt

Configuration

There are two different sets of configuration, for filament, and for the frontend pages

Filament Configuration

To configure the plugin Bolt, you can pass the configuration to the plugin in adminPanelProvider

These all the available configuration, and their defaults values

Note
All these configurations are optional

1BoltPlugin::make()
2 // the default models, by default Bolt will read from the config file 'zeus-bolt'.
3 // but if you want to customize the models per panel, you can do it here
4 ->models([
5 // ...
6 'Category' => \App\Models\Bolt\Category::class,
7 'Collection' => \App\Models\Bolt\Collection::class,
8 'Field' => \App\Models\Bolt\Field::class,
9 'FieldResponse' => \App\Models\Bolt\FieldResponse::class,
10 'Form' => \App\Models\Bolt\Form::class,
11 'Response' => \App\Models\Bolt\Response::class,
12 'Section' => \App\Models\Bolt\Section::class,
13 'User' => \App\Models\Staff::class,
14 ])
15 
16 ->enums([
17 'FormsStatus' => \App\Enums\Bolt\FormsStatus::class,
18 ])
19 
20 // make the actions floating in create and edit forms
21 ->formActionsAreSticky(true)
22 
23 ->hideResources([
24 FormResource::class
25 ])
26 
27 ->globallySearchableAttributes([
28 // you can return empty array to disable it
29 FormResource::class => ['name']
30 ])
31 
32 ->navigationGroupLabel('Bolt')
33 
34 ->hideNavigationBadges(resource: LaraZeus\Bolt\Resources::CollectionResource)
35 ->showNavigationBadges(resource: LaraZeus\Bolt\Resources::CollectionResource)
36 
37 // if you have custom extension or using thunder
38 ->extensions([
39 \LaraZeus\Thunder\Extensions\Thunder::class,
40 ])
41,

Customize Filament Resources

You can customize all Bolt resources icons and sorting by adding the following code to your AppServiceProvider boot method

1FormResource::navigationSort(100);
2FormResource::navigationIcon('heroicon-o-home');
3FormResource::navigationGroup('New Name');

Show or Hide Badges

To show all navigation badges (default)

1->showNavigationBadges()

To hide all navigation badges

1->hideNavigationBadges()

This will hide only the CollectionResource navigation badge

1->hideNavigationBadges(resource: LaraZeus\Bolt\Resources::CollectionResource)

This will show only the FormResource navigation badge

1->hideNavigationBadges()
2->showNavigationBadges(resource: LaraZeus\Bolt\Resources::CollectionResource)

available resources:

  • CategoryResource,
  • CollectionResource,
  • FormResource,

Frontend Configuration

Use the file zeus-bolt.php, to customize the frontend, like the prefix, domain, and middleware for each content type.

To publish the configuration:

1php artisan vendor:publish --tag=zeus-bolt-config

Custom User Model

By default Bolt will use the default Laravel user model to get the user info:

config('auth.providers.users.model')

If you need to change this to use another model, add the following in your config file: zeus-bolt.php:

1'models' => [
2 //...
3 'User' => AnotherUserModel::class,
4],

Core Fields

By default Bolt discovers all of its own fields, your own custom fields, and the Bolt Pro fields when the package is installed:

1'coreFields' => null,

To use only some of them, list the classes you want:

1'coreFields' => [
2 \LaraZeus\Bolt\Fields\Classes\TextInput::class,
3 \LaraZeus\Bolt\Fields\Classes\Select::class,
4 \LaraZeus\Bolt\Fields\Classes\Toggle::class,
5],

The array is the complete list, and nothing else is discovered. Add the Bolt Pro fields, or your own from the collectors.fields path, to keep them:

1'coreFields' => [
2 \LaraZeus\Bolt\Fields\Classes\TextInput::class,
3 \LaraZeus\BoltPro\Fields\SomeProField::class,
4 \App\Zeus\Fields\MyField::class,
5],

Note
The array sets which fields are offered, not their order. Fields are ordered by the $sort property on the field class, and the first one becomes the default type for new fields. A class you list is skipped if it sets $disabled = true.

Important
The fields are cached, and only flushed for you on the local environment. Anywhere else, flush the cache key before your changes show up:

1php artisan cache:forget bolt.fields

Our Sponsors

Zeus is an open-source project. Thanks to our sponsors for helping maintain these packages.