diff --git a/app/Http/Controllers/Guest/TagController.php b/app/Http/Controllers/Guest/TagController.php index 89fb929f9..f27fa07f0 100644 --- a/app/Http/Controllers/Guest/TagController.php +++ b/app/Http/Controllers/Guest/TagController.php @@ -28,8 +28,13 @@ public function index(Request $request): View $tags = Tag::publicOnly() ->withCount(['links' => fn($query) => $query->publicOnly()]) - ->orderBy($this->orderBy, $this->orderDir) - ->paginate(getPaginationLimit()); + ->orderBy($this->orderBy, $this->orderDir); + + if ($request->input('filter')) { + $tags = $tags->where('name', 'like', '%' . $request->input('filter') . '%'); + } + + $tags = $tags->paginate(getPaginationLimit()); return view('guest.tags.index', [ 'pageTitle' => trans('tag.tags'), diff --git a/resources/views/guest/tags/index.blade.php b/resources/views/guest/tags/index.blade.php index 8b97ea494..ace9c8cee 100644 --- a/resources/views/guest/tags/index.blade.php +++ b/resources/views/guest/tags/index.blade.php @@ -10,10 +10,28 @@