diff --git a/app/Http/Controllers/PlaylistController.php b/app/Http/Controllers/PlaylistController.php index fff979f620..571355d568 100644 --- a/app/Http/Controllers/PlaylistController.php +++ b/app/Http/Controllers/PlaylistController.php @@ -113,6 +113,7 @@ public function show(Request $request, Playlist $playlist): \Illuminate\Contract WHEN category_id IN (SELECT id from categories where no_meta = TRUE) THEN 'no' END as meta SQL) + ->when($request->has('search'), fn ($query) => $query->where('name', 'LIKE', '%'.str_replace(' ', '%', $request->search).'%')) ->with(['category', 'resolution', 'type', 'user.group']) ->orderBy('name') ->paginate(26); @@ -129,6 +130,7 @@ public function show(Request $request, Playlist $playlist): \Illuminate\Contract }, 'latestPlaylistTorrent' => $playlist->torrents()->orderByPivot('created_at', 'desc')->first(), 'torrents' => $torrents, + 'search' => $request->search, ]); } diff --git a/resources/views/playlist/show.blade.php b/resources/views/playlist/show.blade.php index 292caa71a0..b281d3eee3 100755 --- a/resources/views/playlist/show.blade.php +++ b/resources/views/playlist/show.blade.php @@ -200,7 +200,28 @@ class="playlist__author-avatar"
-

{{ __('torrent.torrents') }}

+
+

{{ __('torrent.torrents') }}

+
+
+
+ + +
+
+
+
@foreach ($torrents as $torrent)