amzad78692 / filament-app-settings
v1.0.2
2025-09-10 09:33 UTC
Requires
- filament/filament: ^4.0
- outerweb/settings: ^1.1
README
This package adds a way to interact with outerweb/settings in Filament.
Installation
You can install the package via composer:
composer require amzad78692/filament-app-settings
You can install the package via composer:
php artisan settings:install
Usage
Create a settings page at 'app/Filament/Pages/Settings.php':
<?php namespace App\Filament\Pages; use Amzad78692\FilamentAppSettings\Pages\SettingsPage; use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\Tabs; use Filament\Schemas\Components\Tabs\Tab; use Illuminate\Contracts\Support\Htmlable; class Settings extends SettingsPage { public function schema(): array { return [ Tabs::make('Settings') ->schema([ Tab::make('General') ->schema([ TextInput::make('general.website_name.en') ->label(__('Website name') . '(en)'), TextInput::make('general.website_name.ar') ->label(__('Website name') . '(ar)'), FileUpload::make('general.logo') ->image() ->directory('settings'), FileUpload::make('general.favicon') ->image() ->directory('settings'), ])->columns(2), Tab::make('Contact') ->schema([ TextInput::make('contact.email') ->email(), TextInput::make('contact.mobile') ->tel() ->telRegex('/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\.\/0-9]*$/'), TextInput::make('contact.whatsapp') ->tel() ->telRegex('/^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\.\/0-9]*$/'), TextInput::make('contact.address'), ])->columns(2), ]), ]; } }
Changing the navigation label
You can change the navigation label by overriding the getNavigationLabel
method:
namespace App\Filament\Pages; use Amzad78692\FilamentAppSettings\Pages\SettingsPage; class Settings extends SettingsPage { public static function getNavigationLabel(): string { return 'Custom label'; } }
Changing the page title
You can change the page title by overriding the getTitle
method:
namespace App\Filament\Pages; use Amzad78692\FilamentAppSettings\Pages\SettingsPage; class Settings extends SettingsPage { public function getTitle(): string { return 'Custom title'; } }