@foreach ($messages as $message)
  • @if ($message->sender_id == $user->id) @if($user->profile_photo != "") @else @endif @else @if($chatUser->profile_photo != "") @else @endif @endif
    @if ($message->file) @if (strtolower(pathinfo($message->file, PATHINFO_EXTENSION)) == 'jpg' || strtolower(pathinfo($message->file, PATHINFO_EXTENSION)) == 'png' || strtolower(pathinfo($message->file, PATHINFO_EXTENSION)) == 'gif') @else
    {{ $message->message }}

    @php echo App\Http\Controllers\Chats\WebHomeController::bytesToHuman(File::size(public_path($message->file))); @endphp

    @endif @else

    {{ $message->message }}

    @endif

    {{ date('d M y, h:i a', strtotime($message->created_at)) }}

    @if ($message->sender_id == $user->id)
    {{ $user->firstname }} {{ $user->lastname }}
    @else
    {{ $chatUser->firstname }} {{ $chatUser->lastname }}
    @endif
  • @endforeach