Skip to content

Commit 2ac2138

Browse files
committed
Merge branch 'v5.0.x'
2 parents 685c5ed + d9e8b2b commit 2ac2138

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

app/Events/SettingsSavedEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SettingsSavedEvent
1616
*
1717
* @return void
1818
*/
19-
public function __construct( public $options, public $inputs, public $class )
19+
public function __construct(public $data, public $settingsClass )
2020
{
2121
// ...
2222
}

app/Services/SettingsPage.php

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Services;
44

5+
use App\Classes\Hook;
56
use App\Events\SettingsSavedEvent;
67
use App\Traits\NsForms;
78
use Illuminate\Http\Request;
@@ -137,17 +138,23 @@ public function saveForm( Request $request )
137138
/**
138139
* @var Options
139140
*/
140-
$options = app()->make( Options::class );
141+
$options = app()->make(Options::class);
142+
$data = [];
143+
$inputs = Hook::filter( SettingsPage::method( 'saveForm' ), $this->getPlainData($request) );
141144

142-
foreach ( $this->getPlainData( $request ) as $key => $value ) {
143-
if ( empty( $value ) ) {
144-
$options->delete( $key );
145+
foreach ( $inputs as $key => $value) {
146+
if ( $value === null ) {
147+
$options->delete($key);
145148
} else {
146-
$options->set( $key, $value );
149+
$options->set($key, $value);
150+
$data[ $key ] = $value;
147151
}
148152
}
149153

150-
event( new SettingsSavedEvent( $options->get(), $request->all(), get_class( $this ) ) );
154+
event( new SettingsSavedEvent(
155+
data: $data,
156+
settingsClass: get_class($this)
157+
) );
151158

152159
return [
153160
'status' => 'success',

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"spatie/laravel-db-snapshots": "^2.2",
3232
"symfony/http-client": "^6.0",
3333
"symfony/mailgun-mailer": "^6.0",
34-
"tormjens/eventy": "^0.8"
34+
"tormjens/eventy": "^0.8",
35+
"vlucas/phpdotenv": "^5.6"
3536
},
3637
"require-dev": {
3738
"laravel/pint": "^1.1.1",

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/scss/light/_floating-notices.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
&.success {
2121
@apply border-success-tertiary bg-success-primary;
2222
h2, p {
23-
@apply text-white;
23+
@apply text-primary;
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)