@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)
  • {{ $chat_date_show }}
  • @endif @if(@$logged_in_usr_id == @$chat_from_user_id)
  • @php $mt_2 = ''; @endphp @if(@$chat_message && @$chat_message != '') @php $mt_2 = 'mt-2'; @endphp

    {!! @$chat_message !!}

    @endif @if(@$chat_file && @$chat_file != '') @php $chat_file_url = asset('uploads/chat_history').'/'.$chat_file; @endphp @endif
    {{ $chat_time }}
    Sender
  • @else
  • @if(@$cht_usr_profile_pic && @$cht_usr_profile_pic != '')
    Receiver
    @else @php $arr_nm = explode(' ', @$cht_usr_name); $fnm = @$arr_nm[0]; $lnm = @$arr_nm[1]; $f_fc = substr(@$fnm, 0, 1); $l_lc = substr(@$fnm, -1); $l_lc = (@$lnm && @$lnm != '') ? substr(@$lnm, 0, 1) : $l_lc; @endphp {{ strtoupper($f_fc.$l_lc) }} @endif
    @php $mt_2 = ''; @endphp @if(@$chat_message && @$chat_message != '') @php $mt_2 = 'mt-2'; @endphp

    {!! @$chat_message !!}

    @endif @if(@$chat_file && @$chat_file != '') @php $chat_file_url = asset('uploads/chat_history').'/'.$chat_file; @endphp @endif
    {{ $chat_time }}
  • @endif @php $old_chat_date = $chat_date; @endphp @endforeach @endif