### Install filament-general-settings via Composer Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Install the package via Composer. Requires Filament v3.x; for Filament v4.x use the 2.x branch. ```bash composer require joaopaulolndev/filament-general-settings:^3.0 ``` -------------------------------- ### Custom tabs and fields configuration Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Example configuration for adding custom tabs and fields using the 'show_custom_tabs' and 'custom_tabs' keys. Demonstrates field types from TypeFieldEnum and their options. ```php use Joaopaulolndev\FilamentGeneralSettings\Enums\TypeFieldEnum; return [ 'show_application_tab' => true, 'show_analytics_tab' => true, 'show_seo_tab' => true, 'show_email_tab' => true, 'show_social_networks_tab' => true, 'expiration_cache_config_time' => 60, 'show_custom_tabs'=> true, 'custom_tabs' => [ 'more_configs' => [ 'label' => 'More Configs', 'icon' => 'heroicon-o-plus-circle', 'columns' => 1, 'fields' => [ 'custom_field_1' => [ 'type' => TypeFieldEnum::Text->value, 'label' => 'Custom Textfield 1', 'placeholder' => 'Custom Field 1', 'required' => true, 'rules' => 'required|string|max:255', ], 'custom_field_2' => [ 'type' => TypeFieldEnum::Select->value, 'label' => 'Custom Select 2', 'placeholder' => 'Select', 'required' => true, 'options' => [ 'option_1' => 'Option 1', 'option_2' => 'Option 2', 'option_3' => 'Option 3', ], ], 'custom_field_3' => [ 'type' => TypeFieldEnum::Textarea->value, 'label' => 'Custom Textarea 3', 'placeholder' => 'Textarea', 'rows' => '3', 'required' => true, ], 'custom_field_4' => [ 'type' => TypeFieldEnum::Datetime->value, 'label' => 'Custom Datetime 4', 'placeholder' => 'Datetime', 'seconds' => false, ], 'custom_field_5' => [ 'type' => TypeFieldEnum::Boolean->value, 'label' => 'Custom Boolean 5', 'placeholder' => 'Boolean' ], 'custom_field_6' => [ 'type' => TypeFieldEnum::RichEditor->value, 'label' => 'Custom Rich Editor 6', 'toolbarButtons' => ['bold', 'italic', 'link', 'bulletList', 'orderedList'], ], ] ], ] ]; ``` -------------------------------- ### Publish assets Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Optionally publish assets, for example to show images in default email providers. ```bash php artisan vendor:publish --tag="filament-general-settings-assets" ``` -------------------------------- ### Register FilamentGeneralSettingsPlugin in AdminPanelProvider Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Add the FilamentGeneralSettingsPlugin to the Filament AdminPanelProvider. This is the minimal setup required to enable the general settings page. ```php use Joaopaulolndev\FilamentGeneralSettings\FilamentGeneralSettingsPlugin; ... ->plugins([ FilamentGeneralSettingsPlugin::make() ]) ``` -------------------------------- ### Publish and run migrations Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Publish and run the package migrations to create the general settings table. ```bash php artisan vendor:publish --tag="filament-general-settings-migrations" php artisan migrate ``` -------------------------------- ### Publish views Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Optionally publish the package views for customization. ```bash php artisan vendor:publish --tag="filament-general-settings-views" ``` -------------------------------- ### Enable logo and favicon Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Set 'show_logo_and_favicon' to true in the published config file to enable the logo and favicon feature. ```php return [ // Other configuration settings... 'show_logo_and_favicon' => true, ]; ``` -------------------------------- ### Publish config file Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Publish the configuration file for the package. ```bash php artisan vendor:publish --tag="filament-general-settings-config" ``` -------------------------------- ### Run tests with composer test Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Run the test suite for the package using Composer. ```bash composer test ``` -------------------------------- ### Publish translations Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Optionally publish the package translation files. ```bash php artisan vendor:publish --tag="filament-general-settings-translations" ``` -------------------------------- ### Default config file Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Default published configuration file. Controls which tabs are shown and the cache expiration time in minutes. ```php return [ 'show_application_tab' => true, 'show_analytics_tab' => true, 'show_seo_tab' => true, 'show_email_tab' => true, 'show_social_networks_tab' => true, 'expiration_cache_config_time' => 60, ]; ``` -------------------------------- ### Configure FilamentGeneralSettingsPlugin with custom parameters Source: https://github.com/joaopaulolndev/filament-general-settings/blob/3.x/README.md Configure the plugin with optional parameters: access control, sort order, icon, navigation group, title, and navigation label. The canAccess callback restricts access to users with id 1. ```php ->plugins([ FilamentGeneralSettingsPlugin::make() ->canAccess(fn() => auth()->user()->id === 1) ->setSort(3) ->setIcon('heroicon-o-cog') ->setNavigationGroup('Settings') ->setTitle('General Settings') ->setNavigationLabel('General Settings'), ]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.