Skip to content
Merged

Dev #3510

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions app/Nova/GetInvolvedPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
Loading