@if ($message->user_id) @else @endif

{!! $message->subject !!}

{!! $message->message !!}
@if ($attachment = optional($message->attachments)->first()) @endif
@unless($message->user_id) @endunless
{{-- Replies --}} @foreach ($message->replies->sortBy('created_at') as $msg)
@if ($msg->customer_id) @else @endif

{!! $msg->reply !!}

@if ($attachment = optional($msg->attachments)->first()) @endif
@if ($msg->customer_id) @endif
@endforeach
{!! Form::open(['route' => ['message.reply', $message], 'files' => true, 'id' => 'conversation-form', 'data-toggle' => 'validator']) !!}
{!! Form::textarea('reply', null, ['class' => 'form-control form-control flat', 'placeholder' => trans('theme.placeholder.message'), 'rows' => '3', 'maxlength' => 500, 'required']) !!}
{!! Form::button(trans('theme.button.send_message'), ['type' => 'submit', 'class' => 'btn btn-info flat pull-right']) !!} {!! Form::close() !!}