update
This commit is contained in:
@@ -264,35 +264,6 @@ class BrowseGalleryController extends \App\Http\Controllers\Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function legacyCategory(Request $request, ?string $group = null, ?string $slug = null, ?string $id = null)
|
||||
{
|
||||
if ($id !== null && ctype_digit((string) $id)) {
|
||||
$category = Category::with('contentType')->find((int) $id);
|
||||
if (! $category || ! $category->contentType) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return redirect($category->url, 301);
|
||||
}
|
||||
|
||||
$contentSlug = strtolower((string) $group);
|
||||
if (! in_array($contentSlug, self::CONTENT_TYPE_SLUGS, true)) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$target = '/' . $contentSlug;
|
||||
$normalizedSlug = trim((string) $slug, '/');
|
||||
if ($normalizedSlug !== '') {
|
||||
$target .= '/' . strtolower($normalizedSlug);
|
||||
}
|
||||
|
||||
if ($request->query()) {
|
||||
$target .= '?' . http_build_query($request->query());
|
||||
}
|
||||
|
||||
return redirect($target, 301);
|
||||
}
|
||||
|
||||
private function presentArtwork(Artwork $artwork): object
|
||||
{
|
||||
$primaryCategory = $artwork->categories->sortBy('sort_order')->first();
|
||||
|
||||
Reference in New Issue
Block a user