@extends('adminlte::page') @section('title', 'Chat') @section('content')
@if ($message = Session::get('success')) {{ $message }} @endif
Chat for user #{{$user->name}}
@foreach($chat as $message)
@if($message['type'] == 'admin')
{{$message['created_at']}}
{{$message['message']}}
U
@else
{{substr($message->sender->name, 0, 1)}}
{{$message['created_at']}}
{{$message['message']}}
@endif
@endforeach
@csrf @if ($errors->has('message')) {{ $errors->first('message') }} @endif
@section('css') @stop @section('js') @endsection @stop