File tree Expand file tree Collapse file tree 3 files changed +39
-5
lines changed
resources/views/filament/pages Expand file tree Collapse file tree 3 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Modules \Email \App \Filament \Pages ;
4
4
5
+ use Filament \Forms \Components \Section ;
6
+ use Filament \Forms \Components \TextInput ;
5
7
use Filament \Pages \Page ;
8
+ use Outerweb \FilamentSettings \Filament \Pages \Settings as BaseSettings ;
6
9
7
- class EmailSettings extends Page
10
+ class EmailSettings extends BaseSettings
8
11
{
9
12
protected static ?string $ navigationIcon = 'heroicon-o-cog ' ;
10
13
@@ -16,4 +19,24 @@ class EmailSettings extends Page
16
19
17
20
protected static ?int $ navigationSort = 4 ;
18
21
22
+
23
+ public function schema (): array
24
+ {
25
+ return [
26
+ Section::make ('Settings ' )
27
+ ->schema ([
28
+
29
+ TextInput::make ('email.hostname ' )
30
+ ->label ('Hostname ' )
31
+ ->helperText ('The hostname of the SMTP server. Example: mail.yourdomain.com ' )
32
+ ->required (),
33
+
34
+ TextInput::make ('email.domain ' )
35
+ ->label ('Domain ' )
36
+ ->helperText ('The domain of the SMTP server. Example: yourdomain.com ' )
37
+ ->required (),
38
+
39
+ ]),
40
+ ];
41
+ }
19
42
}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public function send()
63
63
$ phpMailer ->addAddress ($ this ->to );
64
64
$ phpMailer ->Subject = $ this ->subject ;
65
65
$ phpMailer ->Body = $ this ->body ;
66
-
66
+
67
67
$ sendMail = $ phpMailer ->send ();
68
68
69
69
if ($ sendMail ) {
Original file line number Diff line number Diff line change 1
1
<x-filament-panels::page >
2
2
3
- <div >
4
- Email settings
5
- </div >
3
+ <form wire:submit =" save" >
4
+
5
+ <div class =" mb-4" >
6
+ {{ $this -> form } }
7
+ </div >
8
+
9
+ <x-filament::button
10
+ type =" submit"
11
+ wire:loading.attr =" disabled"
12
+ >
13
+ <span wire:loading.remove >Save</span >
14
+ <span wire:loading >Saving...</span >
15
+ </x-filament::button >
16
+ </form >
6
17
7
18
</x-filament-panels::page >
You can’t perform that action at this time.
0 commit comments