|
2 | 2 |
|
3 | 3 | namespace App\Filament\Admin\Pages; |
4 | 4 |
|
| 5 | +use Filament\Schemas\Schema; |
| 6 | +use Filament\Schemas\Components\Section; |
| 7 | +use Filament\Forms\Components\TextInput; |
| 8 | +use Filament\Forms\Components\Textarea; |
5 | 9 | use App\Settings\GeneralSettings; |
6 | 10 | use Filament\Forms; |
7 | | -use Filament\Forms\Form; |
8 | 11 | use Filament\Pages\SettingsPage; |
9 | 12 |
|
10 | 13 | class ManageGeneralSettings extends SettingsPage |
11 | 14 | { |
12 | | - protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth'; |
| 15 | + protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-cog-6-tooth'; |
13 | 16 |
|
14 | 17 | protected static string $settings = GeneralSettings::class; |
15 | 18 |
|
16 | | - protected static ?string $navigationGroup = 'Settings'; |
| 19 | + protected static string | \UnitEnum | null $navigationGroup = 'Settings'; |
17 | 20 |
|
18 | 21 | protected static ?string $title = 'General Settings'; |
19 | 22 |
|
20 | 23 | protected static ?string $navigationLabel = 'General Settings'; |
21 | 24 |
|
22 | | - public function form(Form $form): Form |
| 25 | + public function form(Schema $schema): Schema |
23 | 26 | { |
24 | | - return $form |
25 | | - ->schema([ |
26 | | - Forms\Components\Section::make('Site Information') |
| 27 | + return $schema |
| 28 | + ->components([ |
| 29 | + Section::make('Site Information') |
27 | 30 | ->schema([ |
28 | | - Forms\Components\TextInput::make('site_name') |
| 31 | + TextInput::make('site_name') |
29 | 32 | ->label('Site Name') |
30 | 33 | ->required() |
31 | 34 | ->maxLength(255), |
32 | | - Forms\Components\TextInput::make('site_email') |
| 35 | + TextInput::make('site_email') |
33 | 36 | ->label('Site Email') |
34 | 37 | ->email() |
35 | 38 | ->required() |
36 | 39 | ->maxLength(255), |
37 | | - Forms\Components\TextInput::make('site_phone') |
| 40 | + TextInput::make('site_phone') |
38 | 41 | ->label('Site Phone') |
39 | 42 | ->tel() |
40 | 43 | ->maxLength(255), |
41 | | - Forms\Components\TextInput::make('site_address') |
| 44 | + TextInput::make('site_address') |
42 | 45 | ->label('Site Address') |
43 | 46 | ->maxLength(255), |
44 | | - Forms\Components\TextInput::make('site_country') |
| 47 | + TextInput::make('site_country') |
45 | 48 | ->label('Country') |
46 | 49 | ->maxLength(255), |
47 | | - Forms\Components\TextInput::make('site_currency') |
| 50 | + TextInput::make('site_currency') |
48 | 51 | ->label('Currency Symbol') |
49 | 52 | ->maxLength(10), |
50 | | - Forms\Components\TextInput::make('site_default_language') |
| 53 | + TextInput::make('site_default_language') |
51 | 54 | ->label('Default Language') |
52 | 55 | ->maxLength(10) |
53 | 56 | ->default('en'), |
54 | 57 | ]) |
55 | 58 | ->columns(2), |
56 | 59 |
|
57 | | - Forms\Components\Section::make('Social Media Links') |
| 60 | + Section::make('Social Media Links') |
58 | 61 | ->description('Add your social media profile URLs') |
59 | 62 | ->schema([ |
60 | | - Forms\Components\TextInput::make('facebook_url') |
| 63 | + TextInput::make('facebook_url') |
61 | 64 | ->label('Facebook URL') |
62 | 65 | ->url() |
63 | 66 | ->maxLength(255), |
64 | | - Forms\Components\TextInput::make('twitter_url') |
| 67 | + TextInput::make('twitter_url') |
65 | 68 | ->label('Twitter URL') |
66 | 69 | ->url() |
67 | 70 | ->maxLength(255), |
68 | | - Forms\Components\TextInput::make('github_url') |
| 71 | + TextInput::make('github_url') |
69 | 72 | ->label('GitHub URL') |
70 | 73 | ->url() |
71 | 74 | ->maxLength(255), |
72 | | - Forms\Components\TextInput::make('youtube_url') |
| 75 | + TextInput::make('youtube_url') |
73 | 76 | ->label('YouTube URL') |
74 | 77 | ->url() |
75 | 78 | ->maxLength(255), |
76 | 79 | ]) |
77 | 80 | ->columns(2), |
78 | 81 |
|
79 | | - Forms\Components\Section::make('Footer') |
| 82 | + Section::make('Footer') |
80 | 83 | ->schema([ |
81 | | - Forms\Components\Textarea::make('footer_copyright') |
| 84 | + Textarea::make('footer_copyright') |
82 | 85 | ->label('Copyright Text') |
83 | 86 | ->required() |
84 | 87 | ->maxLength(500) |
|
0 commit comments