|
@@ -31,14 +31,10 @@ class CollectionController extends Controller
|
|
|
public function detail($slug)
|
|
|
{
|
|
|
|
|
|
-
|
|
|
- // Check if the $slug is numeric (ID), if so, fetch by ID
|
|
|
- if (is_numeric($slug)) {
|
|
|
- $tag = SitePageTag::find($slug); // Find by ID
|
|
|
- } else {
|
|
|
- // Otherwise, find by slug
|
|
|
- $tag = SitePageTag::where('slug', $slug)->first();
|
|
|
- }
|
|
|
+ // Find the tag by either slug or id
|
|
|
+ $tag = SitePageTag::where('slug', $slug)
|
|
|
+ ->orWhere('id', $slug)
|
|
|
+ ->first();
|
|
|
|
|
|
|
|
|
if (!$tag) {
|