@inject('request', 'Illuminate\Http\Request') @extends('backend.layouts.app') @push('after-styles') @endpush @section('content')

@lang('labels.backend.messages.title')

@if(request()->has('thread'))
@csrf
{{$thread->title}}

@if(count($thread->messages) > 0 ) @foreach($thread->messages as $message) @if($message->sender_id == auth()->user()->id)

{{$message->body}}

{{\Carbon\Carbon::parse($message->created_at)->format('h:i A | M d Y')}}
@else

{{$message->body}}

{{\Carbon\Carbon::parse($message->created_at)->format('h:i A | M d Y')}}
@endif @endforeach @endif
@else
@csrf

{{trans('labels.backend.messages.select_recipients')}}:

{!! Form::select('recipients[]', $teachers, (request('teacher_id') ? request('teacher_id') : old('recipients')), ['class' => 'form-control select2', 'multiple' => 'multiple']) !!}

{{trans('labels.backend.messages.start_conversation')}}

{{----}}
@endif
@endsection @push('after-scripts') @endpush