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