70 lines
4.2 KiB
PHP
70 lines
4.2 KiB
PHP
<div class="card-header pe-5" id="kt_drawer_chat_messenger_header">
|
|
<div class="card-title">
|
|
<div class="d-flex justify-content-center flex-column me-3">
|
|
<a href="#" class="fs-4 fw-bold text-gray-900 text-hover-primary me-1 mb-2 lh-1">{{$user->name}}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-body" id="kt_drawer_chat_messenger_body">
|
|
<div class="scroll-y me-n5 pe-5 " data-kt-element="messages" data-kt-scroll="true" data-kt-scroll-activate="true" data-kt-scroll-height="auto" data-kt-scroll-dependencies="#kt_drawer_chat_messenger_header, #kt_drawer_chat_messenger_footer" data-kt-scroll-wrappers="#kt_drawer_chat_messenger_body" data-kt-scroll-offset="0px">
|
|
@foreach($chat as $data)
|
|
@if($data->by == 'User')
|
|
@if($data->user->getAttributes()['profile_image'])
|
|
<?php
|
|
$img = 'public/uploads/profile/img/' . $user->getAttributes()['profile_image'];
|
|
// $img = 'public/uploads/profile/img/profile_image';
|
|
?>
|
|
@else
|
|
@php($img ='https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png')
|
|
@endif
|
|
<div class="d-flex justify-content-start mb-10">
|
|
<div class="d-flex flex-column align-items-start">
|
|
<div class="d-flex align-items-center mb-2">
|
|
<div class="symbol symbol-35px symbol-circle">
|
|
<img alt="Pic" src="{{$img}}" />
|
|
</div>
|
|
<div class="ms-3">
|
|
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary me-1">{{$data->user->name}}</a>
|
|
<!--<span class="text-muted fs-7 mb-1">{{$data->created_at->diffForHumans()}}</span>-->
|
|
<span class="text-muted fs-7 mb-1">{{$data->created_at->format('d/m/Y')}}</span>
|
|
</div>
|
|
</div>
|
|
@if($data->message)
|
|
<div class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start" data-kt-element="message-text">{{$data->message}}</div>
|
|
@else
|
|
<a class="p-5 rounded bg-light-info text-dark fw-semibold mw-lg-400px text-start" data-kt-element="message-text" href="{{route('chat-attachment-download', ['file_name' => $data->filename])}}">Download File</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@else
|
|
@if($data->admin?->getAttributes()['profile_image'])
|
|
<?php
|
|
$img = 'public/uploads/profile/img/' . $data->admin?->getAttributes()['profile_image'];
|
|
?>
|
|
@else
|
|
@php($img ='https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png')
|
|
@endif
|
|
<div class="d-flex justify-content-end mb-10">
|
|
<div class="d-flex flex-column align-items-end">
|
|
<div class="d-flex align-items-center mb-2">
|
|
<div class="me-3">
|
|
<!--<span class="text-muted fs-7 mb-1">{{$data->created_at->diffForHumans()}}</span>-->
|
|
<span class="text-muted fs-7 mb-1">{{$data->created_at->format('d/m/Y')}}</span>
|
|
<a href="#" class="fs-5 fw-bold text-gray-900 text-hover-primary ms-1">{{$data->admin->name}}</a>
|
|
</div>
|
|
<div class="symbol symbol-35px symbol-circle">
|
|
<img alt="Pic" src="{{$img}}" />
|
|
</div>
|
|
</div>
|
|
@if($data->message)
|
|
<div class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end" data-kt-element="message-text">{{$data->message}}</div>
|
|
@else
|
|
<a class="p-5 rounded bg-light-primary text-dark fw-semibold mw-lg-400px text-end" data-kt-element="message-text" href="{{route('chat-attachment-download', ['file_name' => $data->filename])}}">Download File</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</div>
|