From dda07616958e20eca18767a20d5ec8e9d90fd18c Mon Sep 17 00:00:00 2001 From: bernardhanna Date: Wed, 15 Apr 2026 11:33:25 +0100 Subject: [PATCH] qc changes --- app/Nova/GetInvolvedPage.php | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/app/Nova/GetInvolvedPage.php b/app/Nova/GetInvolvedPage.php index 95c87a4f1..dce6e9412 100644 --- a/app/Nova/GetInvolvedPage.php +++ b/app/Nova/GetInvolvedPage.php @@ -42,17 +42,12 @@ public static function authorizedToViewAny(Request $request): bool public static function indexQuery(NovaRequest $request, $query) { - return $query->where('path', '/get-involved'); + return $query->where('path', '/get-involved')->orWhere('unique_identifier', 'get-involved'); } public static function relatableQuery(NovaRequest $request, $query) { - return $query->where('path', '/get-involved'); - } - - public static function authorizedToCreate(Request $request): bool - { - return false; + return $query->where('path', '/get-involved')->orWhere('unique_identifier', 'get-involved'); } public function fields(Request $request): array @@ -112,4 +107,25 @@ public function fields(Request $request): array Textarea::make('Meta Keywords')->nullable(), ]; } + + public static function authorizedToCreate(Request $request): bool + { + return true; + } + + public static function redirectAfterCreate(NovaRequest $request, $resource) + { + return '/resources/' . static::uriKey() . '/' . $resource->id; + } + + public static function fill(NovaRequest $request, $model) + { + $model->path = $model->path ?: '/get-involved'; + $model->unique_identifier = $model->unique_identifier ?: 'get-involved'; + $model->language = $model->language ?: 'en'; + $model->link_type = $model->link_type ?: 'internal_link'; + $model->name = $model->name ?: 'Get Involved'; + + return parent::fill($request, $model); + } }