feat(search): /search?q= across videos, channels and playlists

Add a dedicated SearchController that matches the query against video
title / description / tags / primary language AND any secondary audio
track language (so "arabic" surfaces videos that carry an Arabic track
even if the primary language is English), plus channel name / username
/ bio, plus playlist name / description. Public visibility only.

Results reuse the videos/index view so every card gets the same
component the browse feeds use. A new Channels section renders above
the Videos grid when channel hits exist.

/videos/search is kept as a 301 redirect to /search so bookmarks and
external links stay valid; both the desktop header and mobile overlay
search forms now point at the canonical route, both carry a visually
hidden <label>, both get role="search" and both preserve the current
query in their input.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
ghassanandClaude Opus 4.7 committed 2026-10-21 10:09:40 +03:00
1 parent 6b2a67c4cd
commit 45b5f586ba
5 files changed
+166 -11

No files matched your search

@@ -15,9 +15,10 @@
<div class="yt-header-center d-none d-md-flex">
<div class="yt-search">
<form action="{{ route('videos.search') }}" method="GET" class="yt-search-form">
<input type="text" name="q" class="yt-search-input" placeholder="Search" value="{{ request('q') }}">
<button type="submit" class="yt-search-btn"><i class="bi bi-search"></i></button>
<form action="{{ route('search') }}" method="GET" class="yt-search-form" role="search">
<label for="header-search-input" class="visually-hidden">Search</label>
<input type="search" id="header-search-input" name="q" class="yt-search-input" placeholder="Search" value="{{ request('q') }}" aria-label="Search videos, channels and playlists">
<button type="submit" class="yt-search-btn" aria-label="Submit search"><i class="bi bi-search" aria-hidden="true"></i></button>
</form>
</div>
</div>