@extends('admin.layouts.master') @section('content') @php $search_q = isset($search_q) ? $search_q : null; $requestLabel = isset(request()->route()->parameters['label']) ? request()->route()->parameters['label'] : 1; @endphp
@include('admin.message._left_nav')

{{ $search_q ? trans('app.search_result') : get_msg_folder_name_from_label($requestLabel) }}

{!! Form::open(['route' => 'search.message', 'method' => 'get', 'id' => 'form', 'data-toggle' => 'validator']) !!}
{!! Form::text('q', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.placeholder.search'), 'required']) !!}
{!! Form::close() !!}
@if ($search_q)
{{ trans('app.search_result_for') . " '" . $search_q . "'" }}
@endif
@if ($messages->count()) {{ $messages->links('admin.partials._pagination_btn') }} @endif
@forelse($messages as $message) @empty

{{ trans('app.no_data_found') }}

@endforelse
@if ($message->isUnread()) {!! highlightWords($message->getSenderName(), $search_q) . ' | ' . highlightWords($message->getSenderEmail(), $search_q) !!} @else {!! highlightWords($message->getSenderName(), $search_q) . ' | ' . highlightWords($message->getSenderEmail(), $search_q) !!} @endif {!! highlightWords($message->subject, $search_q) !!} - {!! highlightWords(Str::limit(strip_tags($message->message), 160 - strlen($message->subject)), $search_q) !!} @if ($message->isUnread()) {!! $message->statusName() !!} @endif @if ($message->about()) {!! $message->about() !!} @endif @if ($message->replies_count) {{ $message->replies_count }} @endif @if ($message->hasAttachments()) @endif {{ $message->updated_at->diffForHumans() }}
@if ($messages->count()) {{ $messages->links('admin.partials._pagination_btn') }} @endif


@endsection