Allow artworks to have one primary category and extra secondaries.
Keep artwork_category as membership, store a deterministic primary_category_id, and let upload plus studio pick up to five additional same-type categories without changing canonical URLs.
This commit is contained in:
@@ -27,6 +27,9 @@ final class ArtworkCreateRequest extends FormRequest
|
||||
'title' => 'required|string|max:150',
|
||||
'description' => 'nullable|string',
|
||||
'category' => 'nullable|integer|exists:categories,id',
|
||||
'primary_category_id' => 'nullable|integer|exists:categories,id',
|
||||
'secondary_category_ids' => 'nullable|array|max:'.(int) config('categories.max_secondary_categories', 5),
|
||||
'secondary_category_ids.*' => 'integer|exists:categories,id',
|
||||
'tags' => 'nullable|string|max:200',
|
||||
'license' => 'nullable|boolean',
|
||||
'is_mature' => 'nullable|boolean',
|
||||
@@ -45,7 +48,7 @@ final class ArtworkCreateRequest extends FormRequest
|
||||
|
||||
private function denyAsNotFound(): void
|
||||
{
|
||||
throw new NotFoundHttpException();
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
private function logUnauthorized(string $reason): void
|
||||
|
||||
Reference in New Issue
Block a user