From de7b31e2d4712d38fc30668f9fbedb2f06fe72ad Mon Sep 17 00:00:00 2001 From: bernardhanna Date: Wed, 11 Feb 2026 16:43:05 +0000 Subject: [PATCH] Refactor button update handling in GirlsInDigitalPage to use nonPersistedButtonUpdates property. Add instance method annotations for authorizedToUpdate and authorizedToDelete in GirlsInDigitalFaqItem to align with Laravel\Nova\Resource requirements. --- app/Nova/GirlsInDigitalFaqItem.php | 2 ++ app/Nova/GirlsInDigitalPage.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Nova/GirlsInDigitalFaqItem.php b/app/Nova/GirlsInDigitalFaqItem.php index 2b3350b59..942678002 100644 --- a/app/Nova/GirlsInDigitalFaqItem.php +++ b/app/Nova/GirlsInDigitalFaqItem.php @@ -42,11 +42,13 @@ public static function authorizedToCreate(Request $request): bool return true; } + /** Must be instance method to match Laravel\Nova\Resource::authorizedToUpdate (non-static). */ public function authorizedToUpdate(Request $request): bool { return true; } + /** Must be instance method to match Laravel\Nova\Resource::authorizedToDelete (non-static). */ public function authorizedToDelete(Request $request): bool { return true; diff --git a/app/Nova/GirlsInDigitalPage.php b/app/Nova/GirlsInDigitalPage.php index cf02e2a46..43911469e 100644 --- a/app/Nova/GirlsInDigitalPage.php +++ b/app/Nova/GirlsInDigitalPage.php @@ -345,16 +345,16 @@ private function getButtonField(string $key, string $field) private function fillButtonField(\App\GirlsInDigitalPage $model, string $key, string $field, $value): void { try { - if (! isset($model->_button_updates)) { - $model->_button_updates = []; + if (! isset($model->nonPersistedButtonUpdates)) { + $model->nonPersistedButtonUpdates = []; } - if (! isset($model->_button_updates[$key])) { - $model->_button_updates[$key] = []; + if (! isset($model->nonPersistedButtonUpdates[$key])) { + $model->nonPersistedButtonUpdates[$key] = []; } if ($field === 'enabled' || $field === 'open_new_tab') { $value = (bool) $value; } - $model->_button_updates[$key][$field] = $value; + $model->nonPersistedButtonUpdates[$key][$field] = $value; } catch (\Throwable $e) { \Illuminate\Support\Facades\Log::error('GirlsInDigital button field fill failed: ' . $key . '.' . $field, [ 'exception' => $e->getMessage(),