@extends('layouts.master', [ 'title' => 'খুঁজুন: ' . request('q') . ' - ' . config('app.name'), 'description' => 'আপনার অনুসন্ধান "' . request('q') . '" এর ফলাফল। সর্বশেষ খবর এবং সংবাদ পড়ুন আমাদের অনলাইন নিউজ পোর্টালে।', ]) @php $highlightSearchTerm = function (?string $text, ?string $query): string { $value = $text ?? ''; $keyword = trim((string) $query); if ($keyword === '') { return e($value); } $pattern = '/' . preg_quote($keyword, '/') . '/iu'; $segments = @preg_split($pattern, $value, -1, PREG_SPLIT_DELIM_CAPTURE); if (!is_array($segments)) { return e($value); } $html = ''; foreach ($segments as $segment) { if ($segment === '') { continue; } if (@preg_match($pattern, $segment) === 1) { $html .= '' . e($segment) . ''; } else { $html .= e($segment); } } return $html; }; @endphp @section('content')
{{-- Breadcrumb --}} @component('components.breadcrumb', [ 'items' => [ ['label' => 'খুঁজুন: ' . request('q'), 'url' => null] ] ]) @endcomponent {{-- Search Header --}}

@if(request('q')) "{{ request('q') }}" এর ফলাফল @else খুঁজুন @endif

@if(request('q'))
{{ $posts->total() }}টি ফলাফল পাওয়া গেছে
@php $q = request('q'); @endphp
@endif
{{-- Search Filters --}} @if(request('q')) {{-- Results --}}
@forelse($posts as $post)
@if($post->thumbnail_url) {{ $post->title }} @endif
@if($post->category) {{ $post->category->name_bn }} @endif

{!! $highlightSearchTerm($post->title, request('q')) !!}

@if($post->excerpt)

{!! $highlightSearchTerm(Str::limit(strip_tags($post->excerpt), 200), request('q')) !!}

@endif
@if($post->author) {{ $post->author->name }} @endif {{\Carbon\Carbon::parse($post->published_at)->locale('bn_BD')->isoFormat('j MMMM Y') }} {{ number_format($post->views_count) }} পঠিত
@empty

কোনো ফলাফল পাওয়া যায়নি

"{{ request('q') }}" এর জন্য কোনো পোস্ট পাওয়া যায়নি। অন্য কিছু খুঁজে দেখুন।

হোমপেজে ফিরুন
@endforelse
{{-- Pagination --}} @if($posts->hasPages())
{{ $posts->appends(request()->query())->links('pagination::bootstrap-5') }}
@endif {{-- Related Searches --}} @if(isset($relatedSearches) && $relatedSearches->count() > 0) @endif @else {{-- Empty Search State --}}

খুঁজতে শুরু করুন

আপনি যা খুঁজছেন তা খুঁজে পেতে নিচের ট্যাগগুলো ব্রাউজ করতে পারেন।

@endif
@endsection