@extends('backend.layouts.layout-2') @section('page-title', trans('app.volunteerApplications')) @section('page-heading', trans('app.volunteerApplications')) @section('content')

{{$user_name}}

Recent

@php $selected_user_id = @$_GET['user_id']; @endphp @foreach (\App\Models\ChatMessage::orderBy('created_at', 'DESC')->when($selected_user_id, function ($query,$selected_user_id) { return $query->where('user_id', $selected_user_id); })->get()->unique('user_id') as $chat) @endforeach
@foreach (\App\Models\ChatMessage::where('user_id', @$_GET['user_id'])->where('admin_id', \Auth::user()->id)->get() as $chat) @if ($chat->sent_from != \Auth::user()->id)
sunil

{{ $chat->message }}

{{ $chat->created_at->diffForHumans() }}

@endif @if ($chat->sent_from == \Auth::user()->id)

{{ $chat->message }}

{{ $chat->created_at->diffForHumans() }}
@endif @endforeach
@if(@$_GET['user_id'])
@csrf
@endif
@endsection