@php $users = DB::table('users') ->where('id', '!=', Auth::user()->id) ->get(); // dd($users); @endphp
@foreach ($users as $user)
Img
{{ $user->name }}

@if ($user->status == '1')

@else
@endif

@endforeach
Img
User
@if (Auth::user()->status == '1') online @else offline @endif
@php $messages = DB::table('messages')->get(); @endphp
@foreach ($messages as $msg) @php $user = DB::table('users') ->where('id', $msg->sender_id) ->orWhere('id', $msg->receiver_id) ->first(); @endphp @if ($msg->sender_id == Auth::user()->id)

{{ Auth::user()->name }}

{{ $msg->message }}
@else

{{ $user->name }}

{{ $msg->message }}
@endif @endforeach
@vite(['resources/css/app.css', 'resources/js/app.js'])