File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 10
10
use Filament \Pages \Concerns ;
11
11
use Filament \Pages \Page ;
12
12
use Filament \Support \Exceptions \Halt ;
13
+ use Glorand \Model \Settings \Contracts \SettingsManagerContract ;
13
14
use Quadrubo \FilamentModelSettings \Exceptions \HasModelSettingsNotImplementedException ;
14
15
use Quadrubo \FilamentModelSettings \Pages \Contracts \HasModelSettings ;
15
16
@@ -74,9 +75,7 @@ public function save(): void
74
75
75
76
$ this ->callHook ('beforeSave ' );
76
77
77
- $ settings = $ this ->getSettingRecord ()->settings ();
78
-
79
- $ settings ->apply ((array ) $ data );
78
+ $ this ->handleRecordUpdate ($ this ->getSettingRecord ()->settings (), $ data );
80
79
81
80
$ this ->callHook ('afterSave ' );
82
81
} catch (Halt $ exception ) {
@@ -117,6 +116,14 @@ protected function mutateFormDataBeforeSave(array $data): array
117
116
return $ data ;
118
117
}
119
118
119
+ /**
120
+ * @param array<string, mixed> $data
121
+ */
122
+ protected function handleRecordUpdate (SettingsManagerContract $ settings , array $ data ): SettingsManagerContract
123
+ {
124
+ return $ settings ->apply ((array ) $ data );
125
+ }
126
+
120
127
/**
121
128
* @return array<Action | ActionGroup>
122
129
*/
You can’t perform that action at this time.
0 commit comments