@foreach($messages as $message)
  • @if (($message->from_user_id == Auth::id())) @else @foreach ($userdata as $item) @if (($message->from_user_id== $item->id)) @endif @endforeach @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\HomeController::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->from_user_id== Auth::id()))
    {{(Auth::user()->name)}}
    @else @foreach ($userdata as $item) @if (($message->from_user_id== $item->id))
    {{$item->name}}
    @endif @endforeach @endif
  • @endforeach