diff --git a/Modules/CircleContacts/README.md b/Modules/CircleContacts/README.md index 2ed8307..4a1ea60 100644 --- a/Modules/CircleContacts/README.md +++ b/Modules/CircleContacts/README.md @@ -1,4 +1,4 @@ -![Screenshot](https://github.com/tomatophp/circle-contacts/blob/master/art/cover.png) +![Screenshot](https://github.com/tomatophp/circle-contacts-module/blob/master/art/cover.png) # Circle Contacts diff --git a/Modules/CircleInvoices/README.md b/Modules/CircleInvoices/README.md index 7c297f8..b44df41 100644 --- a/Modules/CircleInvoices/README.md +++ b/Modules/CircleInvoices/README.md @@ -1,3 +1,5 @@ +![Screenshot](https://github.com/tomatophp/circle-invoices-module/blob/master/art/cover.png) + # Circle Invoices Invoices Generator With Custom Templates, to generate public invoices and your customer can download it diff --git a/Modules/CircleInvoices/art/cover.png b/Modules/CircleInvoices/art/cover.png new file mode 100644 index 0000000..088aea5 Binary files /dev/null and b/Modules/CircleInvoices/art/cover.png differ diff --git a/Modules/CircleXO/App/Http/Controllers/ProfileController.php b/Modules/CircleXO/App/Http/Controllers/ProfileController.php index af24c3f..2aee1f9 100644 --- a/Modules/CircleXO/App/Http/Controllers/ProfileController.php +++ b/Modules/CircleXO/App/Http/Controllers/ProfileController.php @@ -71,8 +71,26 @@ public function followers(Request $request) public function messages(Request $request) { - return view('circle-xo::profile.messages', [ - 'table' => (new AccountContactTable(auth('accounts')->id())) + + $messages = AccountContact::query(); + $messages->where('account_id', auth('accounts')->id()); + $messages->orderBy('id', 'desc'); + $messages->groupBy('sender_id'); + if($request->has('search') && $request->get('search')){ + $messages->whereHas('sender', function($query) use ($request){ + $query->where('name', 'LIKE', '%'.$request->get('search').'%'); + }); + } + $chats = $messages->paginate(20); + + $getSelectedChat = null; + if($request->has('chat') && $request->get('chat')){ + $getSelectedChat = AccountContact::find($request->get('chat')); + } + + return view('circle-xo::profile.messages',[ + 'chats' => $chats, + 'getSelectedChat' => $getSelectedChat ]); } @@ -81,6 +99,11 @@ public function message(Request $request, AccountContact $message) return view('circle-xo::profile.message', compact('message')); } + public function messageInfoProfile(Request $request, $profile) + { + return view('circle-xo::profile.message-profile-info'); + } + public function qr() { $qr = QrCode::format('png') diff --git a/Modules/CircleXO/resources/views/profile/message-profile-info.blade.php b/Modules/CircleXO/resources/views/profile/message-profile-info.blade.php new file mode 100644 index 0000000..bf51fcc --- /dev/null +++ b/Modules/CircleXO/resources/views/profile/message-profile-info.blade.php @@ -0,0 +1,44 @@ + +
+ +
+
Abdelmjid Saber
+
@AbdelmjidSaber
+
+ +
+ +
+ + + +
diff --git a/Modules/CircleXO/resources/views/profile/messages.blade.php b/Modules/CircleXO/resources/views/profile/messages.blade.php index 406488e..0c26cff 100644 --- a/Modules/CircleXO/resources/views/profile/messages.blade.php +++ b/Modules/CircleXO/resources/views/profile/messages.blade.php @@ -1,15 +1,172 @@ + + +
+ +
+
- - - - - - - - - - - +
+
+ + {{-- sidebar --}} + + + @php $lastMessage = $getSelectedChat ?: $chats->first(); @endphp + {{-- message center --}} +
+ {{-- chat heading --}} +
+
+ {{-- toggle for mobile --}} + +
+ +
+
+
+
{{ $lastMessage->sender?->name ??__('Anonymous') }}
+
Online
+
+
+ +
+ + {{-- chats bubble --}} +
+ +
+ +
+
{{ $lastMessage->sender?->name ?? __('Anonymous') }}
+
{{ $lastMessage->sender?->username }}
+
+
+ + {{__('View profile')}} + +
+
+ +
+ @php + $chatMessages = \Modules\CircleXO\App\Models\AccountContact::query() + ->where('account_id', auth('accounts')->user()->id) + ->where('sender_id', $lastMessage->sender_id) + ->orWhere('account_id', $lastMessage->sender_id) + ->where('sender_id', auth('accounts')->user()->id) + ->orderBy('created_at', 'asc') + ->get(); + + @endphp + + + @if($chatMessages->count() < 1) +
+ {{ __('No Messages Here!') }} +
+ @endif + + @foreach($chatMessages as $chatMessage) + @if($chatMessage->sender_id == auth('accounts')->user()->id) + {{-- received --}} +
+ + + +
{{ $chatMessage->message }}
+
+ @else + {{-- sent --}} +
+ + + +
+ {{ $chatMessage->message }} +
+
+ @endif + @endforeach +
+
+ + @if($lastMessage->sender) + {{-- sending message area --}} + +
+
+ + +
+
+
+ + @endif +
+
+
+ +
diff --git a/Modules/CircleXO/routes/web.php b/Modules/CircleXO/routes/web.php index 4f60d2c..fce88c7 100644 --- a/Modules/CircleXO/routes/web.php +++ b/Modules/CircleXO/routes/web.php @@ -61,6 +61,7 @@ Route::get('/followers', [ProfileController::class, 'followers'])->name('followers'); Route::get('/messages', [ProfileController::class, 'messages'])->name('messages'); Route::get('/messages/{message}', [ProfileController::class, 'message'])->name('messages.show'); + Route::get('/messages/info/{profile}', [ProfileController::class, 'messageInfoProfile'])->name('messages.profile-info.show'); Route::get('/edit/social-accounts', [ProfileController::class, 'socialAccounts'])->name('social-accounts.show'); Route::post('/edit/social-accounts', [ProfileController::class, 'socialAccountsUpdate'])->name('social-accounts.update'); Route::get('/edit/password', [ProfileController::class, 'password'])->name('password.show'); diff --git a/config/database.php b/config/database.php index f8e8dcb..2913ce4 100644 --- a/config/database.php +++ b/config/database.php @@ -52,7 +52,7 @@ 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, + 'strict' => false, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),