├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── bin └── build.js ├── composer.json ├── config └── filachat.php ├── database ├── factories │ └── ModelFactory.php └── migrations │ ├── 00001_create_filachat_agents_table.php.stub │ ├── 00002_create_filachat_conversations_table.php.stub │ └── 00003_create_filachat_messages_table.php.stub ├── postcss.config.cjs ├── resources ├── css │ └── filachat.css ├── dist │ └── .gitkeep ├── js │ └── index.js ├── lang │ ├── ar.json │ └── en │ │ └── filachat.php └── views │ ├── .gitkeep │ └── filachat │ ├── components │ ├── chat-box.blade.php │ ├── chat-list.blade.php │ └── search-conversation.blade.php │ └── index.blade.php ├── src ├── Commands │ ├── FilaChatCommand.php │ └── FilaChatCreateAgentCommand.php ├── Enums │ └── RoleType.php ├── Events │ ├── FilaChatMessageEvent.php │ ├── FilaChatMessageReadEvent.php │ ├── FilaChatMessageReceiverIsAwayEvent.php │ └── FilaChatUserTypingEvent.php ├── Facades │ └── FilaChat.php ├── FilaChat.php ├── FilaChatPlugin.php ├── FilaChatServiceProvider.php ├── Livewire │ ├── ChatBox.php │ ├── ChatList.php │ └── SearchConversation.php ├── Models │ ├── FilaChatAgent.php │ ├── FilaChatConversation.php │ └── FilaChatMessage.php ├── Pages │ └── FilaChat.php ├── Services │ └── ChatListService.php ├── Testing │ └── TestsFilaChat.php └── Traits │ ├── CanGetOriginalFileName.php │ ├── CanValidateAudio.php │ ├── CanValidateDocument.php │ ├── CanValidateImage.php │ ├── CanValidateVideo.php │ └── HasFilaChat.php └── stubs └── .gitkeep /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `filachat` will be documented in this file. 4 | 5 | ## 1.0.0 - 202X-XX-XX 6 | 7 | - initial release 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) jaocero <199ocero@gmail.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FilaChat 2 | 3 |
{{ $selectedConversation->other_person_name }}
14 | @php 15 | if (auth()->id() === $selectedConversation->receiverable_id) { 16 | $isOtherPersonAgent = $selectedConversation->senderable->isAgent(); 17 | } else { 18 | $isOtherPersonAgent = $selectedConversation->receiverable->isAgent(); 19 | } 20 | @endphp 21 |22 | @if ($isOtherPersonAgent) 23 | {{__('Agent')}} 24 | @else 25 | {{__('User')}} 26 | @endif 27 |
28 |68 | 73 |
74 |{{ $message->message }}
118 | @endif 119 | @if ($message->attachments && count($message->attachments) > 0) 120 | @foreach ($message->attachments as $attachment) 121 | @php 122 | $originalFileName = $this->getOriginalFileName($attachment, $message->original_attachment_file_names); 123 | @endphp 124 |149 | {{ $originalFileName }} 150 |
151 |155 | @php 156 | $createdAt = \Carbon\Carbon::parse($message->created_at)->setTimezone(config('filachat.timezone', 'app.timezone')); 157 | 158 | if ($createdAt->isToday()) { 159 | $date = $createdAt->format('g:i A'); 160 | } else { 161 | $date = $createdAt->format('M d, Y g:i A'); 162 | } 163 | @endphp 164 | {{ $date }} 165 |
166 |{{ $message->message }}
174 | @endif 175 | @if ($message->attachments && count($message->attachments) > 0) 176 | @foreach ($message->attachments as $attachment) 177 | @php 178 | $originalFileName = $this->getOriginalFileName($attachment, $message->original_attachment_file_names); 179 | @endphp 180 |205 | {{ $originalFileName }} 206 |
207 |211 | @php 212 | $createdAt = \Carbon\Carbon::parse($message->created_at)->setTimezone(config('filachat.timezone', 'app.timezone')); 213 | 214 | if ($createdAt->isToday()) { 215 | $date = $createdAt->format('g:i A'); 216 | } else { 217 | $date = $createdAt->format('M d, Y g:i A'); 218 | } 219 | @endphp 220 | {{ $date }} 221 |
222 |225 | {{__('Seen at')}} 226 | @php 227 | $lastReadAt = \Carbon\Carbon::parse($message->last_read_at)->setTimezone(config('filachat.timezone', 'app.timezone')); 228 | 229 | if ($lastReadAt->isToday()) { 230 | $date = $lastReadAt->format('g:i A'); 231 | } else { 232 | $date = $lastReadAt->format('M d, Y g:i A'); 233 | } 234 | @endphp 235 | {{ $date }} 236 |
237 | 238 |272 | {{__('No selected conversation')}} 273 |
274 |{{ $conversation->other_person_name }} 58 |
59 |60 | {{ \Carbon\Carbon::parse($conversation->last_message_time)->setTimezone(config('filachat.timezone', 'app.timezone'))->shortAbsoluteDiffForHumans() }} 61 |
62 |65 | @if($conversation->is_sender) 66 | You: 67 | @endif 68 | {{ $conversation->latest_message }} 69 |
70 | @if ($conversation->unread_count > 0) 71 |{{ $message->other_person_name }}
29 |{{ \Carbon\Carbon::parse($message->created_at)->setTimezone(config('filachat.timezone', 'app.timezone'))->format('F j, Y') }}
30 |32 | {{$message->message}} 33 |
34 |{{__('Loading more messages...')}}
44 |52 | {{__('No results found.')}} 53 |
54 |