@extends('layouts.user_type.guest')
@section('header_title', __('چت'))
@php
$off_navbar = true;
$off_footer = true;
@endphp
@section('content')
@php
$hasChat = !empty($data->chat_id) && !empty($data->chat);
$fileUrl = function ($file) {
if (!$file || empty($file->file_path)) return '';
$path = $file->file_path;
return filter_var($path, FILTER_VALIDATE_URL) ? $path : asset(ltrim($path, '/'));
};
$renderMessageContent = function ($msg) use ($fileUrl) {
$file = $msg->file ?? null;
if ($file) {
$url = $fileUrl($file);
$name = $file->file_name ?: 'file';
$format = strtolower($file->file_format ?: pathinfo($name, PATHINFO_EXTENSION));
if (in_array($format, ['jpg', 'jpeg', 'png', 'webp', 'gif'])) {
return '';
}
if (($msg->message ?? '') === 'video' || in_array($format, ['mp4', 'mov', 'm4v', 'avi', 'mkv'])) {
return '';
}
if (($msg->message ?? '') === 'voice' || in_array($format, ['mp3', 'wav', 'ogg', 'webm', 'mpeg', 'm4a', 'aac'])) {
return '';
}
return ''.e($name).'';
}
return nl2br(e($msg->message));
};
@endphp
{{ __('لیست تمام چتهای شما در سمت صفحه قرار دارد.') }}