@php $base_path = asset('dist/images'); $default_usr_pic = $base_path."/"."profile-default.png"; $log_in_usr_pic = $default_usr_pic; if(@$logged_in_usr_ppic && @$logged_in_usr_ppic != '') { $base_path = asset('uploads/users_profile_pic'); $log_in_usr_pic = $base_path."/".$logged_in_usr_ppic; } if(@$chat_wth_usr_info) { $f_nm = trim(@$chat_wth_usr_info->first_name); $l_nm = trim(@$chat_wth_usr_info->last_name); $cht_usr_name = ucwords(strtolower(trim(@$f_nm.' '.@$l_nm))); $profile_pic = trim(@$chat_wth_usr_info->profile_pic); $cht_usr_profile_pic = ''; if(@$profile_pic && @$profile_pic != '') { $cht_usr_profile_pic = asset('uploads/users_profile_pic').'/'.@$profile_pic; $cht_usr_profile_pic = (@file_exists(public_path().'/uploads/users_profile_pic/'.@$profile_pic)) ? $cht_usr_profile_pic : ''; } } @endphp @if(@$chat_msg_list) @php $old_chat_date = ''; @endphp @foreach(@$chat_msg_list as $cht_msg) @php $chat_id = @$cht_msg->id; $chat_from_user_id = @$cht_msg->from_user_id; $chat_to_user_id = @$cht_msg->to_user_id; $chat_message = trim(@$cht_msg->message); $chat_file = trim(@$cht_msg->file); $chat_dt_tm = strtotime(trim(@$cht_msg->created_at)); $curr_date = date('Y-m-d'); $chat_date = date('Y-m-d', $chat_dt_tm); $chat_date_show = ($chat_date == $curr_date) ? 'Today' : date('F j, Y', $chat_dt_tm); $chat_time = date('g:i A', $chat_dt_tm); $seen_by_receiver = strtoupper(trim(@$cht_msg->seen_by_receiver)); $seen_class = (@$seen_by_receiver == 'Y') ? 'text-success' : ''; @endphp @if($old_chat_date != $chat_date)
@endif @if(@$logged_in_usr_id == @$chat_from_user_id) @else @endif @php $old_chat_date = $chat_date; @endphp @endforeach @endif