feat: implement search functionality in MusicProductionController, enhance view with search form and localization support for search results

This commit is contained in:
Ümit Tunç
2026-05-20 23:13:21 +03:00
parent 276e4b30ca
commit 33c7b6a51e
4 changed files with 50 additions and 5 deletions
@@ -25,6 +25,22 @@
<h1 class="xl:!text-[2.4rem] !text-[calc(1.365rem_+_1.38vw)] font-semibold !leading-[1.15] !mb-5 xl:!px-14">{{ __('music_productions.meta-index-title') }}</h1>
<p class="lead !text-[1.1rem]">{{ __('music_productions.meta-index-description') }}</p>
<form
action="{{ route('music-productions.index') }}"
method="GET"
role="search"
class="search-form relative !mt-8 w-full max-w-3xl !mx-auto before:content-['\eca5'] before:block before:absolute before:-translate-y-2/4 before:text-[1.05rem] before:!text-[#747ed1] before:z-[1] before:left-5 before:top-2/4 before:font-Unicons"
>
<input
type="search"
name="q"
value="{{ $search ?? request('q') }}"
class="form-control relative block w-full text-[0.95rem] font-medium !text-[#60697b] bg-[rgba(255,255,255,0.95)] shadow-[0_0_1.25rem_rgba(30,34,40,0.08)] rounded-[50rem] border border-solid border-[rgba(8,60,130,0.1)] !pl-12 !pr-5 py-[0.85rem] min-h-[3rem] focus:shadow-[0_0_1.25rem_rgba(116,126,209,0.18)] focus-visible:!border-[#747ed1] placeholder:!text-[#959ca9] placeholder:opacity-100"
placeholder="{{ __('music_productions.search_placeholder') }}"
aria-label="{{ __('music_productions.search_placeholder') }}"
autocomplete="off"
>
</form>
</div>
<!-- /column -->
</div>
@@ -134,7 +150,13 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-16 h-16 text-gray-300 mx-auto !mb-4">
<path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"/>
</svg>
<p class="text-[#aab0bc] text-lg">{{ __('music_productions.empty') }}</p>
<p class="text-[#aab0bc] text-lg">
@if(!empty($search))
{{ __('music_productions.search_no_results', ['query' => $search]) }}
@else
{{ __('music_productions.empty') }}
@endif
</p>
</div>
</div>
</div>