Skip to content

Commit

Permalink
Merge pull request #167 from puzzledmonkey/main
Browse files Browse the repository at this point in the history
Update SettingsController.php for Nova 4.26.0
  • Loading branch information
marttinnotta authored Jun 29, 2023
2 parents 2892485 + 5e0d60e commit 757149c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 757149c

Please sign in to comment.