diff --git a/composer.json b/composer.json index 8a764f8..b30742c 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "license": "MIT", "require": { "php": ">=8.0", - "laravel/nova": "^4.0", + "laravel/nova": "^4.26", "outl1ne/nova-translations-loader": "^5.0" }, "require-dev": { diff --git a/src/Http/Controllers/SettingsController.php b/src/Http/Controllers/SettingsController.php index 11f3c69..65ebd93 100644 --- a/src/Http/Controllers/SettingsController.php +++ b/src/Http/Controllers/SettingsController.php @@ -86,10 +86,10 @@ public function save(NovaRequest $request) $existingRow = $settingsClass::where('key', $field->attribute)->first(); - $tempResource = new \stdClass; + $tempResource = new \Laravel\Nova\Support\Fluent; $field->fill($request, $tempResource); - if (!property_exists($tempResource, $field->attribute)) return; + if (!isset($tempResource->{$field->attribute})) return; if (isset($existingRow)) { $existingRow->value = $tempResource->{$field->attribute}; @@ -166,7 +166,7 @@ protected function fields(Request $request, $path = 'general') protected function makeFakeResource(string $fieldName, $fieldValue) { - $fakeResource = new \stdClass; + $fakeResource = new \Laravel\Nova\Support\Fluent; $fakeResource->{$fieldName} = $fieldValue; return $fakeResource; }