Commit 3b5284e1adc486bf90f93af11e7cfe5413081a0a
Exists in
master
uncommited files
Showing 34 changed files Side-by-side Diff
- app/Http/Controllers/Admin/MsgAnswersController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/HomeController.php
- app/Http/Controllers/WorkerController.php
- app/Mail/MassSendingMessages.php
- app/Models/Chat.php
- app/Models/Message.php
- app/Models/MessagesRequests.php
- database/migrations/2024_08_05_094303_create_message_requests_table.php
- database/migrations/2024_08_09_071214_alter_table_messages.php
- database/migrations/2024_08_09_072423_alter_table_chats.php
- public/assets/css/tailwind.output_new.css
- public/css/general.css
- public/css/style_may2024.css
- resources/views/admin/message/index.blade.php
- resources/views/chats/chats_list.blade.php
- resources/views/emails/added_mass_sending_messages.blade.php
- resources/views/employers/dialog.blade.php
- resources/views/employers/send_all.blade.php
- resources/views/info_company_new.blade.php
- resources/views/js/favorite-worker.blade.php
- resources/views/layout/admin.blade.php
- resources/views/modals/admin/messages/rejecte_message.blade.php
- resources/views/modals/admin/messages/send_message.blade.php
- resources/views/modals/admin/modal_buttons/close.blade.php
- resources/views/modals/admin/modal_buttons/green.blade.php
- resources/views/modals/admin/modal_buttons/red.blade.php
- resources/views/modals/chats/answer_from_admin_chat.blade.php
- resources/views/resume.blade.php
- resources/views/resume/resume_blocks.blade.php
- resources/views/svg/logo_icon.blade.php
- resources/views/worker.blade.php
- resources/views/workers/dialog.blade.php
- routes/web.php
app/Http/Controllers/Admin/MsgAnswersController.php
... | ... | @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin; |
4 | 4 | |
5 | 5 | use App\Http\Controllers\Controller; |
6 | 6 | use App\Models\Message; |
7 | +use App\Models\MessagesRequests; | |
7 | 8 | use App\Models\User; |
8 | 9 | use Illuminate\Database\Eloquent\Builder; |
9 | 10 | use Illuminate\Http\Request; |
... | ... | @@ -97,6 +98,21 @@ class MsgAnswersController extends Controller |
97 | 98 | |
98 | 99 | } |
99 | 100 | |
101 | + public function reject_message(Request $request) | |
102 | + { | |
103 | + $message_request_id = $request->get('id'); | |
104 | + $message_request = MessagesRequests::find($message_request_id); | |
105 | + $message_request->update(['is_rejected' => now()]); | |
106 | + return response()->json(['success' => true]); | |
107 | + } | |
108 | + | |
109 | + public function send_message(Request $request) | |
110 | + { | |
111 | + $message_request_id = $request->get('id'); | |
112 | + MessagesRequests::send_message($message_request_id); | |
113 | + return response()->json(['success' => true]); | |
114 | + } | |
115 | + | |
100 | 116 | public function admin_messages(Request $request) { |
101 | 117 | if ($request->ajax()) { |
102 | 118 | $msg = Message::find($request->id); |
... | ... | @@ -107,23 +123,16 @@ class MsgAnswersController extends Controller |
107 | 123 | $id_admin = Auth::user()->id; |
108 | 124 | $users = User::query()->OrderBy('name')->where('is_bd', '=', '0')->get(); |
109 | 125 | |
110 | - $Msgs = Message::with('user_from')->with('user_to') //->with('response') | |
111 | - ->where(function($query) use ($id_admin) { | |
112 | - $query->where('user_id', '=', $id_admin) | |
113 | - ->orWhere('to_user_id', '=', $id_admin); | |
114 | - }); | |
115 | - | |
116 | - $find_key = ''; | |
117 | - $find_cat = ''; | |
118 | - | |
119 | - $Msgs = $this->filter($Msgs, $request, $find_key, $find_cat); | |
120 | - | |
121 | - $Msgs = $Msgs->orderByDesc('created_at')->paginate(5); | |
126 | + $Msgs = MessagesRequests::query() | |
127 | + ->with('user') | |
128 | + ->orderByDesc('created_at') | |
129 | + ->paginate(10) | |
130 | + ; | |
122 | 131 | |
123 | 132 | if ($request->ajax()) |
124 | 133 | return view('admin.message.index_ajax', compact('Msgs', 'id_admin', 'users')); |
125 | 134 | else |
126 | - return view('admin.message.index', compact('Msgs', 'id_admin', 'users', 'find_key', 'find_cat')); | |
135 | + return view('admin.message.index', compact('Msgs', 'id_admin', 'users')); | |
127 | 136 | } |
128 | 137 | |
129 | 138 | public function messages_sql(Request $request) { |
app/Http/Controllers/EmployerController.php
... | ... | @@ -10,6 +10,7 @@ use App\Http\Requests\MessagesRequiest; |
10 | 10 | use App\Http\Requests\VacancyRequestEdit; |
11 | 11 | use App\Mail\MailCreateEmployer; |
12 | 12 | use App\Mail\MailSotrudnichestvo; |
13 | +use App\Mail\MassSendingMessages; | |
13 | 14 | use App\Mail\SendAllMessages; |
14 | 15 | use App\Models\Ad_employer; |
15 | 16 | use App\Models\ad_response; |
... | ... | @@ -21,6 +22,7 @@ use App\Models\Job_title; |
21 | 22 | use App\Models\Like_worker; |
22 | 23 | use App\Models\Message; |
23 | 24 | use App\Models\Worker; |
25 | +use App\Models\MessagesRequests; | |
24 | 26 | use Carbon\Carbon; |
25 | 27 | use Illuminate\Auth\Events\Registered; |
26 | 28 | use Illuminate\Database\Eloquent\Builder; |
... | ... | @@ -340,12 +342,13 @@ class EmployerController extends Controller |
340 | 342 | |
341 | 343 | $chats = Chat::get_user_chats($user_id); |
342 | 344 | $user_type = 'employer'; |
345 | + $admin_chat = false; | |
343 | 346 | |
344 | - return view('employers.messages', compact('chats','user_id', 'user_type')); | |
347 | + return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); | |
345 | 348 | } |
346 | 349 | |
347 | 350 | // Диалог между пользователями |
348 | - public function dialog(Request $request, User_Model $user1, User_Model $user2) { | |
351 | + public function dialog(Chat $chat, Request $request) { | |
349 | 352 | // Получение параметров. |
350 | 353 | if ($request->has('ad_employer')){ |
351 | 354 | $ad_employer = $request->get('ad_employer'); |
... | ... | @@ -353,29 +356,12 @@ class EmployerController extends Controller |
353 | 356 | $ad_employer = 0; |
354 | 357 | } |
355 | 358 | |
356 | - if (isset($user2->id)) { | |
357 | - $companion = User_Model::query()->with('workers')-> | |
358 | - with('employers')-> | |
359 | - where('id', $user2->id)->first(); | |
360 | - } | |
359 | + $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); | |
360 | + $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); | |
361 | 361 | |
362 | - $Messages = Message::query() | |
363 | - ->where(function($query) use ($user1, $user2) { | |
364 | - $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | |
365 | - }) | |
366 | - ->orWhere(function($query) use ($user1, $user2) { | |
367 | - $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | |
368 | - }) | |
369 | - ->orderBy('created_at') | |
370 | - ->get() | |
371 | - ; | |
362 | + $Messages = Chat::get_chat_messages($chat); | |
372 | 363 | |
373 | - $sender = $user1; | |
374 | - | |
375 | - Message::where('user_id', '=', $user2->id) | |
376 | - ->where('to_user_id', '=', $user1->id) | |
377 | - ->update(['flag_new' => 0]) | |
378 | - ; | |
364 | + Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); | |
379 | 365 | |
380 | 366 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); |
381 | 367 | } |
... | ... | @@ -736,8 +722,16 @@ class EmployerController extends Controller |
736 | 722 | public function send_all_messages() { |
737 | 723 | $id = Auth()->user()->id; |
738 | 724 | $sending = Employer::query()->where('user_id', '=', "$id")->first(); |
725 | + | |
726 | + $job_titles = Job_title::query() | |
727 | + ->where('is_remove', '=', 0) | |
728 | + ->where('is_bd', '=', 1) | |
729 | + ->orderByDesc('sort') | |
730 | + ->get() | |
731 | + ; | |
732 | + | |
739 | 733 | if ($sending->sending_is) |
740 | - return view('employers.send_all'); | |
734 | + return view('employers.send_all', compact('job_titles')); | |
741 | 735 | else |
742 | 736 | return view('employers.send_all_danger'); |
743 | 737 | } |
... | ... | @@ -745,14 +739,25 @@ class EmployerController extends Controller |
745 | 739 | // Отправка сообщений для информации |
746 | 740 | public function send_all_post(Request $request) { |
747 | 741 | $data = $request->all(); |
742 | + $data['user'] = Auth()->user(); | |
743 | + | |
744 | + $id = MessagesRequests::create([ | |
745 | + 'user_id' => Auth()->user()->id, | |
746 | + 'job_titles' => json_encode($data['job_title_ids']), | |
747 | + 'text' => $data['message_text'], | |
748 | + ]); | |
748 | 749 | |
749 | - $emails = User_Model::query()->where('is_worker', '1')->get(); | |
750 | + if (!empty($id)){ | |
751 | + Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); | |
752 | + } | |
753 | + | |
754 | + /*$emails = User_Model::query()->where('is_worker', '1')->get(); | |
750 | 755 | |
751 | 756 | foreach ($emails as $e) { |
752 | 757 | Mail::to($e->email)->send(new SendAllMessages($data)); |
753 | - } | |
758 | + }*/ | |
754 | 759 | |
755 | - return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | |
760 | + return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); | |
756 | 761 | } |
757 | 762 | |
758 | 763 | // База резюме |
app/Http/Controllers/HomeController.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | +use App\Models\Message; | |
5 | 6 | use Illuminate\Http\Request; |
6 | 7 | |
7 | 8 | class HomeController extends Controller |
... | ... | @@ -25,4 +26,28 @@ class HomeController extends Controller |
25 | 26 | { |
26 | 27 | return view('home'); |
27 | 28 | } |
29 | + | |
30 | + public function send_message(Request $request) | |
31 | + { | |
32 | + $user_id = Auth()->user()->id; | |
33 | + | |
34 | + $message_params = [ | |
35 | + 'text' => $request->input('text'), | |
36 | + 'reply_message_id' => $request->input('reply_message_id', null), | |
37 | + ]; | |
38 | + | |
39 | + $new_message = Message::add_message( | |
40 | + $request, | |
41 | + $user_id, | |
42 | + $request->input('to_user_id'), | |
43 | + $message_params | |
44 | + ); | |
45 | + | |
46 | + $user_type = Auth()->user()->is_worker ? 'worker' : 'employer'; | |
47 | + | |
48 | + return response()->json([ | |
49 | + 'success' => true, | |
50 | + 'url_redirect' => route($user_type . '.dialog', ['chat' => $new_message->chat_id_to]) | |
51 | + ]); | |
52 | + } | |
28 | 53 | } |
app/Http/Controllers/WorkerController.php
... | ... | @@ -496,9 +496,10 @@ class WorkerController extends Controller |
496 | 496 | $user_id = Auth()->user()->id; |
497 | 497 | |
498 | 498 | $chats = Chat::get_user_chats($user_id); |
499 | + $admin_chat = Chat::get_user_admin_chat($user_id); | |
499 | 500 | $user_type = 'worker'; |
500 | 501 | |
501 | - return view('workers.messages', compact('chats','user_id', 'user_type')); | |
502 | + return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type')); | |
502 | 503 | } |
503 | 504 | |
504 | 505 | // Избранный |
... | ... | @@ -803,7 +804,7 @@ class WorkerController extends Controller |
803 | 804 | } |
804 | 805 | |
805 | 806 | //Переписка |
806 | - public function dialog(User_Model $user1, User_Model $user2, Request $request) { | |
807 | + public function dialog(Chat $chat, Request $request) { | |
807 | 808 | // Получение параметров. |
808 | 809 | if ($request->has('ad_employer')){ |
809 | 810 | $ad_employer = $request->get('ad_employer'); |
... | ... | @@ -811,35 +812,16 @@ class WorkerController extends Controller |
811 | 812 | $ad_employer = 0; |
812 | 813 | } |
813 | 814 | |
814 | - if (isset($user1->id)) { | |
815 | - $sender = User_Model::query()->with('workers')-> | |
816 | - with('employers')-> | |
817 | - where('id', $user1->id)->first(); | |
818 | - } | |
815 | + $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); | |
816 | + $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); | |
819 | 817 | |
820 | - if (isset($user2->id)) { | |
821 | - $companion = User_Model::query() | |
822 | - ->with('workers') | |
823 | - ->with('employers') | |
824 | - ->where('id', $user2->id) | |
825 | - ->first() | |
826 | - ; | |
827 | - } | |
828 | - | |
829 | - $Messages = Message::query()-> | |
830 | - where(function($query) use ($user1, $user2) { | |
831 | - $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | |
832 | - })->orWhere(function($query) use ($user1, $user2) { | |
833 | - $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | |
834 | - })->OrderBy('created_at') | |
835 | - ->get() | |
836 | - ; | |
818 | + $Messages = Chat::get_chat_messages($chat); | |
837 | 819 | |
838 | - Message::where('user_id', '=', $user2->id) | |
839 | - ->where('to_user_id', '=', $user1->id) | |
820 | + Message::where('user_id', '=', $chat->to_user_id) | |
821 | + ->where('to_user_id', '=', $chat->user_id) | |
840 | 822 | ->update(['flag_new' => 0]); |
841 | 823 | |
842 | - return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | |
824 | + return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer')); | |
843 | 825 | } |
844 | 826 | |
845 | 827 | // Даунылоады |
... | ... | @@ -1078,10 +1060,10 @@ class WorkerController extends Controller |
1078 | 1060 | return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) |
1079 | 1061 | ->withErrors($validator); |
1080 | 1062 | } else { |
1081 | - Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); | |
1063 | + $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); | |
1082 | 1064 | |
1083 | 1065 | return redirect()->route('worker.dialog', |
1084 | - ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); | |
1066 | + ['user1' => $user1, 'user2' => $user2, 'chat' => $new_message->chat_id_from]); | |
1085 | 1067 | |
1086 | 1068 | } |
1087 | 1069 | } |
app/Mail/MassSendingMessages.php
... | ... | @@ -0,0 +1,44 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Mail; | |
4 | + | |
5 | +use App\Models\User; | |
6 | +use Illuminate\Bus\Queueable; | |
7 | +use Illuminate\Contracts\Queue\ShouldQueue; | |
8 | +use Illuminate\Mail\Mailable; | |
9 | +use Illuminate\Mail\Mailables\Address; | |
10 | +use Illuminate\Mail\Mailables\Content; | |
11 | +use Illuminate\Mail\Mailables\Envelope; | |
12 | +use Illuminate\Queue\SerializesModels; | |
13 | + | |
14 | +class MassSendingMessages extends Mailable | |
15 | +{ | |
16 | + use Queueable, SerializesModels; | |
17 | + | |
18 | + protected $data; | |
19 | + | |
20 | + public function __construct($data) | |
21 | + { | |
22 | + $this->data = $data; | |
23 | + } | |
24 | + | |
25 | + public function envelope(): Envelope | |
26 | + { | |
27 | + return new Envelope( | |
28 | + subject: 'Запрос на рассылку сообщений', | |
29 | + ); | |
30 | + } | |
31 | + | |
32 | + public function build() | |
33 | + { | |
34 | + | |
35 | + // Вернуть все данные | |
36 | + return $this->view('emails.added_mass_sending_messages', ['data' => $this->data]); | |
37 | + } | |
38 | + | |
39 | + | |
40 | + public function attachments(): array | |
41 | + { | |
42 | + return []; | |
43 | + } | |
44 | +} |
app/Models/Chat.php
... | ... | @@ -17,7 +17,8 @@ class Chat extends Model |
17 | 17 | 'is_fixed', |
18 | 18 | 'last_message_date', |
19 | 19 | 'last_message_id', |
20 | - 'fixed_time' | |
20 | + 'fixed_time', | |
21 | + 'is_admin_chat' | |
21 | 22 | ]; |
22 | 23 | |
23 | 24 | public function user() { |
... | ... | @@ -74,4 +75,46 @@ class Chat extends Model |
74 | 75 | ; |
75 | 76 | } |
76 | 77 | |
78 | + public static function get_user_admin_chat(int $user_id) | |
79 | + { | |
80 | + return Chat::query() | |
81 | + ->with('last_message') | |
82 | + ->withCount(['unread_messages' => function ($query) use($user_id) { | |
83 | + $query->where('to_user_id', '=', $user_id)->where('flag_new', '=', 1); | |
84 | + }]) | |
85 | + ->where('to_user_id', '=', $user_id) | |
86 | + ->where('is_admin_chat', 1) | |
87 | + ->first() | |
88 | + ; | |
89 | + } | |
90 | + | |
91 | + public static function get_chat_messages(Chat $chat){ | |
92 | + if ($chat->is_admin_chat){ | |
93 | + return Message::query() | |
94 | + ->where('chat_id_to', $chat->id) | |
95 | + ->where('to_user_id', $chat->to_user_id) | |
96 | + ->orderBy('created_at') | |
97 | + ->get() | |
98 | + ; | |
99 | + } else { | |
100 | + return Message::query() | |
101 | + ->where(function ($query) use ($chat) { | |
102 | + $query->where('chat_id_from', $chat->id)->orWhere('chat_id_to', $chat->id); | |
103 | + }) | |
104 | + ->where(function($query) use ($chat) { | |
105 | + $query | |
106 | + ->where(function($query) use ($chat) { | |
107 | + $query->where('user_id', $chat->user_id)->where('to_user_id', $chat->to_user_id); | |
108 | + }) | |
109 | + ->orWhere(function($query) use ($chat) { | |
110 | + $query->where('user_id', $chat->to_user_id)->where('to_user_id', $chat->user_id); | |
111 | + }) | |
112 | + ; | |
113 | + }) | |
114 | + ->OrderBy('created_at') | |
115 | + ->get() | |
116 | + ; | |
117 | + } | |
118 | + } | |
119 | + | |
77 | 120 | } |
app/Models/Message.php
... | ... | @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; |
6 | 6 | use Illuminate\Database\Eloquent\Model; |
7 | 7 | use Illuminate\Http\Request; |
8 | 8 | use Illuminate\Support\Facades\Validator; |
9 | +use mysql_xdevapi\Collection; | |
9 | 10 | |
10 | 11 | class Message extends Model |
11 | 12 | { |
... | ... | @@ -19,7 +20,10 @@ class Message extends Model |
19 | 20 | 'file', |
20 | 21 | 'flag_new', |
21 | 22 | 'ad_employer_id', |
22 | - 'job_title_id' | |
23 | + 'job_title_id', | |
24 | + 'chat_id_from', | |
25 | + 'chat_id_to', | |
26 | + 'reply_message_id', | |
23 | 27 | ]; |
24 | 28 | |
25 | 29 | |
... | ... | @@ -43,34 +47,57 @@ class Message extends Model |
43 | 47 | } |
44 | 48 | |
45 | 49 | public static function add_message( |
46 | - Request $request, | |
50 | + ?Request $request, | |
47 | 51 | int $user_id, |
48 | 52 | int $to_user_id, |
49 | 53 | array $message_params, |
50 | - string $file_store_path = '/' | |
54 | + string $file_store_path = '/', | |
55 | + bool $is_admin_chat = false | |
51 | 56 | ) { |
52 | 57 | $message_params['user_id'] = $user_id; |
53 | 58 | $message_params['to_user_id'] = $to_user_id; |
54 | - if ($request->has('file')) { | |
59 | + if ($request && $request->has('file')) { | |
55 | 60 | $message_params['file'] = $request->file('file')->store($file_store_path, 'public'); |
56 | 61 | } |
57 | 62 | |
63 | + $chat_form = Chat::firstOrCreate([ | |
64 | + 'user_id' => $is_admin_chat ? 0 : $user_id, | |
65 | + 'to_user_id' => $to_user_id, | |
66 | + 'is_removed' => 0, | |
67 | + 'is_admin_chat' => $is_admin_chat ? 1 : 0, | |
68 | + ]); | |
69 | + $message_params[$is_admin_chat ? 'chat_id_to' : 'chat_id_from'] = $chat_form->id; | |
70 | + | |
71 | + if (!$is_admin_chat) { | |
72 | + $chat_to = Chat::firstOrCreate([ | |
73 | + 'user_id' => $to_user_id, | |
74 | + 'to_user_id' => $user_id, | |
75 | + 'is_removed' => 0 | |
76 | + ]); | |
77 | + $message_params['chat_id_to'] = $chat_to->id; | |
78 | + } | |
79 | + | |
58 | 80 | $new_message = Message::create($message_params); |
59 | 81 | |
60 | 82 | if (!empty($new_message->id)) { |
61 | - Chat::updateOrCreate( | |
62 | - ['user_id' => $user_id, 'to_user_id' => $to_user_id], | |
63 | - ['user_id' => $user_id, 'to_user_id' => $to_user_id, 'last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id] | |
64 | - ); | |
65 | - | |
66 | - Chat::updateOrCreate( | |
67 | - ['user_id' => $to_user_id, 'to_user_id' => $user_id], | |
68 | - ['user_id' => $to_user_id, 'to_user_id' => $user_id, 'last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id] | |
69 | - ); | |
83 | + $chat_form->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]); | |
84 | + | |
85 | + if (!$is_admin_chat) { | |
86 | + $chat_to->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]); | |
87 | + } | |
70 | 88 | } |
71 | 89 | |
72 | - return $new_message->id ?? 0; | |
90 | + return $new_message ?? false; | |
91 | + } | |
92 | + | |
93 | + public function getReplyMessageAttribute() | |
94 | + { | |
95 | + $reply_message = false; | |
96 | + if ($this->attributes['reply_message_id']){ | |
97 | + $reply_message = self::find($this->attributes['reply_message_id']); | |
98 | + } | |
73 | 99 | |
100 | + return $reply_message; | |
74 | 101 | } |
75 | 102 | |
76 | 103 | } |
app/Models/MessagesRequests.php
... | ... | @@ -0,0 +1,56 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Models; | |
4 | + | |
5 | +use Illuminate\Database\Eloquent\Factories\HasFactory; | |
6 | +use Illuminate\Database\Eloquent\Model; | |
7 | + | |
8 | +class MessagesRequests extends Model | |
9 | +{ | |
10 | + use HasFactory; | |
11 | + | |
12 | + protected $fillable = [ | |
13 | + 'user_id', | |
14 | + 'job_titles', | |
15 | + 'text', | |
16 | + 'is_rejected', | |
17 | + 'is_sent' | |
18 | + ]; | |
19 | + | |
20 | + public function getJobsAttribute() | |
21 | + { | |
22 | + $job_titles_ids = json_decode($this->attributes['job_titles'], true); | |
23 | + return Job_title::whereIn('id', $job_titles_ids)->get(); | |
24 | + } | |
25 | + | |
26 | + public function user() { | |
27 | + return $this->belongsTo(User::class, 'user_id'); | |
28 | + } | |
29 | + | |
30 | + public static function send_message($message_request_id) | |
31 | + { | |
32 | + $message_request = MessagesRequests::find($message_request_id); | |
33 | + $job_ids = json_decode($message_request->job_titles); | |
34 | + | |
35 | + if (!empty($job_ids)){ | |
36 | + $workers = Title_worker::select('worker_id') | |
37 | + ->whereIN('job_title_id', $job_ids) | |
38 | + ->groupBy('worker_id') | |
39 | + ->get() | |
40 | + ; | |
41 | + | |
42 | + if ($workers->count()){ | |
43 | + $message_params = [ | |
44 | + 'text' => $message_request->text | |
45 | + ]; | |
46 | + foreach ($workers as $worker){ | |
47 | + Message::add_message(null, $message_request->user_id, $worker->worker_id, $message_params, file_store_path : '/', is_admin_chat: true); | |
48 | + } | |
49 | + } | |
50 | + } | |
51 | + | |
52 | + $message_request->update(['is_sent' => now()]); | |
53 | + | |
54 | + return true; | |
55 | + } | |
56 | +} |
database/migrations/2024_08_05_094303_create_message_requests_table.php
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +return new class extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::create('messages_requests', function (Blueprint $table) { | |
17 | + $table->id(); | |
18 | + $table->bigInteger('user_id')->nullable(false); | |
19 | + $table->text('job_titles')->nullable(false); | |
20 | + $table->text('text')->nullable(); | |
21 | + $table->dateTime('is_rejected')->nullable(true); | |
22 | + $table->dateTime('is_sent')->nullable(true); | |
23 | + $table->timestamps(); | |
24 | + }); | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * Reverse the migrations. | |
29 | + * | |
30 | + * @return void | |
31 | + */ | |
32 | + public function down() | |
33 | + { | |
34 | + Schema::dropIfExists('messages_requests'); | |
35 | + } | |
36 | +}; |
database/migrations/2024_08_09_071214_alter_table_messages.php
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +return new class extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('messages', function (Blueprint $table) { | |
17 | + $table->integer('chat_id_from')->nullable(true)->after('to_user_id'); | |
18 | + $table->integer('chat_id_to')->nullable(true)->after('chat_id_from'); | |
19 | + $table->integer('reply_message_id')->nullable(true); | |
20 | + }); | |
21 | + } | |
22 | + | |
23 | + /** | |
24 | + * Reverse the migrations. | |
25 | + * | |
26 | + * @return void | |
27 | + */ | |
28 | + public function down() | |
29 | + { | |
30 | + Schema::table('messages', function (Blueprint $table) { | |
31 | + $table->dropColumn('chat_id_from'); | |
32 | + $table->dropColumn('chat_id_to'); | |
33 | + $table->dropColumn('reply_message_id'); | |
34 | + }); | |
35 | + } | |
36 | +}; |
database/migrations/2024_08_09_072423_alter_table_chats.php
... | ... | @@ -0,0 +1,34 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +return new class extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('chats', function (Blueprint $table) { | |
17 | + $table->dateTime('last_message_date')->nullable(true)->change(); | |
18 | + $table->integer('last_message_id')->nullable(true)->change(); | |
19 | + $table->boolean('is_admin_chat')->default(false)->after('is_fixed'); | |
20 | + }); | |
21 | + } | |
22 | + | |
23 | + /** | |
24 | + * Reverse the migrations. | |
25 | + * | |
26 | + * @return void | |
27 | + */ | |
28 | + public function down() | |
29 | + { | |
30 | + Schema::table('chats', function (Blueprint $table) { | |
31 | + $table->dropColumn('is_admin_chat'); | |
32 | + }); | |
33 | + } | |
34 | +}; |
public/assets/css/tailwind.output_new.css
... | ... | @@ -521,6 +521,10 @@ img, video { |
521 | 521 | background-color: #047481; |
522 | 522 | background-color: rgba(4, 116, 129, var(--bg-opacity)) |
523 | 523 | } |
524 | +.bg-green-600 { | |
525 | + --bg-opacity: 1; | |
526 | + background-color: #44a32b; | |
527 | +} | |
524 | 528 | .bg-blue-100 { |
525 | 529 | --bg-opacity: 1; |
526 | 530 | background-color: #e1effe; |
public/css/general.css
... | ... | @@ -0,0 +1,51 @@ |
1 | +/* Диалог модал */ | |
2 | +.modal-dialog{ | |
3 | + border-radius: 10px; | |
4 | +} | |
5 | +.modal-dialog .modal-dialog-footer{ | |
6 | + display: flex; | |
7 | + justify-content: space-between; | |
8 | +} | |
9 | +.modal-dialog .modal-dialog-footer.center{ | |
10 | + display: flex; | |
11 | + justify-content: center; | |
12 | +} | |
13 | +.modal-dialog .modal-dialog-title h2{ | |
14 | + font-weight: bold; | |
15 | + font-size: 24px; | |
16 | + text-align: center; | |
17 | +} | |
18 | +.modal-dialog .modal-dialog-body{ | |
19 | + padding-top: 20px; | |
20 | + padding-bottom: 20px; | |
21 | +} | |
22 | +.modal-dialog .modal-dialog-footer .button-admin{ | |
23 | + padding: 5px 10px; | |
24 | + border: 1px #000 solid; | |
25 | + border-radius: 8px; | |
26 | +} | |
27 | +/* Конец Диалог модал */ | |
28 | + | |
29 | +.button-loader { | |
30 | + border: 2px solid #f3f3f3; | |
31 | + -webkit-animation: spin 1s linear infinite; | |
32 | + animation: spin 1s linear infinite; | |
33 | + border-top: 2px solid #555; | |
34 | + border-radius: 50%; | |
35 | + width: 20px; | |
36 | + height: 20px; | |
37 | + margin-right: 10px; | |
38 | +} | |
39 | +@keyframes spin { | |
40 | + 0% { transform: rotate(0deg); } | |
41 | + 100% { transform: rotate(360deg); } | |
42 | +} | |
43 | +.error-block{ | |
44 | + color:red; | |
45 | + padding: 0; | |
46 | + width: 100%; | |
47 | +} | |
48 | + | |
49 | +.review-image-modal{ | |
50 | + cursor: pointer; | |
51 | +} |
public/css/style_may2024.css
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | @import url(jquery.select2.css); |
11 | 11 | @import url(star-rating.min.css); |
12 | 12 | @import url(swiper.css); |
13 | +@import url(general.css); | |
13 | 14 | html { |
14 | 15 | line-height: 1.15; /* 1 */ |
15 | 16 | -webkit-text-size-adjust: 100%; /* 2 */ |
... | ... | @@ -7213,6 +7214,19 @@ main + .news { |
7213 | 7214 | padding: 10px; |
7214 | 7215 | line-height: 1.6; |
7215 | 7216 | } |
7217 | +.chatbox__item-text .admin-chat-answer{ | |
7218 | + padding: 2px 5px; | |
7219 | + height: auto; | |
7220 | + float: right; | |
7221 | + margin-left: 10px; | |
7222 | +} | |
7223 | +.chatbox__item-text .reply-message{ | |
7224 | + border-left: 1px grey solid; | |
7225 | + padding-left: 11px; | |
7226 | + font-size: 12px; | |
7227 | + font-style: italic; | |
7228 | + margin-top: 10px; | |
7229 | +} | |
7216 | 7230 | .chatbox__item-time { |
7217 | 7231 | width: 100%; |
7218 | 7232 | padding-left: 54px; |
... | ... | @@ -9296,42 +9310,6 @@ body .cke_notifications_area{ |
9296 | 9310 | border-radius: 45px; |
9297 | 9311 | } |
9298 | 9312 | |
9299 | -/* Диалог модал */ | |
9300 | -.modal-dialog{ | |
9301 | - border-radius: 10px; | |
9302 | -} | |
9303 | -.modal-dialog .modal-dialog-footer{ | |
9304 | - display: flex; | |
9305 | - justify-content: space-between; | |
9306 | -} | |
9307 | -.modal-dialog .modal-dialog-footer.center{ | |
9308 | - display: flex; | |
9309 | - justify-content: center; | |
9310 | -} | |
9311 | - | |
9312 | -.button-loader { | |
9313 | - border: 2px solid #f3f3f3; | |
9314 | - -webkit-animation: spin 1s linear infinite; | |
9315 | - animation: spin 1s linear infinite; | |
9316 | - border-top: 2px solid #555; | |
9317 | - border-radius: 50%; | |
9318 | - width: 20px; | |
9319 | - height: 20px; | |
9320 | -} | |
9321 | -@keyframes spin { | |
9322 | - 0% { transform: rotate(0deg); } | |
9323 | - 100% { transform: rotate(360deg); } | |
9324 | -} | |
9325 | -.error-block{ | |
9326 | - color:red; | |
9327 | - padding: 0; | |
9328 | - width: 100%; | |
9329 | -} | |
9330 | - | |
9331 | -.review-image-modal{ | |
9332 | - cursor: pointer; | |
9333 | -} | |
9334 | - | |
9335 | 9313 | .flot-one-ship .flot-label{ |
9336 | 9314 | font-weight: bold; |
9337 | 9315 | display: flex; |
resources/views/admin/message/index.blade.php
... | ... | @@ -3,6 +3,28 @@ |
3 | 3 | @section('script') |
4 | 4 | <script> |
5 | 5 | $(document).ready(function() { |
6 | + $('.rejecte-button').click(function(){ | |
7 | + var this_btn = $(this); | |
8 | + var wrap = this_btn.closest('tr'); | |
9 | + var message_id = wrap.data('message-id'); | |
10 | + var target = wrap.find('.user-name').text(); | |
11 | + | |
12 | + $('#rejecte_message').data('message-id', message_id); | |
13 | + $('#rejecte_message').find('.user-name').text(target.trim()); | |
14 | + $('#rejecte_message').find('.message-id').text(message_id); | |
15 | + }); | |
16 | + | |
17 | + $('.send-button').click(function(){cl(1000); | |
18 | + var this_btn = $(this); | |
19 | + var wrap = this_btn.closest('tr'); | |
20 | + var message_id = wrap.data('message-id'); | |
21 | + var target = wrap.find('.user-name').text(); | |
22 | + | |
23 | + $('#send_message').data('message-id', message_id); | |
24 | + $('#send_message').find('.user-name').text(target.trim()); | |
25 | + $('#send_message').find('.message-id').text(message_id); | |
26 | + }); | |
27 | + | |
6 | 28 | $(document).on('change', '.checkread', function () { |
7 | 29 | var this_ = $(this); |
8 | 30 | var value = this_.val(); |
... | ... | @@ -38,10 +60,6 @@ |
38 | 60 | </script> |
39 | 61 | @endsection |
40 | 62 | |
41 | -@section('search') | |
42 | - @include('admin.find_message') | |
43 | -@endsection | |
44 | - | |
45 | 63 | @section('content') |
46 | 64 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
47 | 65 | <div class="w-full overflow-x-auto"> |
... | ... | @@ -52,7 +70,7 @@ |
52 | 70 | > |
53 | 71 | <th class="px-4 py-3">№</th> |
54 | 72 | <th class="px-4 py-3">От юзера</th> |
55 | - <th class="px-4 py-3">К юзеру</th> | |
73 | + <th class="px-4 py-3">Должности</th> | |
56 | 74 | <th class="px-4 py-3">Текст</th> |
57 | 75 | <th class="px-4 py-3">Дата</th> |
58 | 76 | <th class="px-4 py-3">Прочтено</th> |
... | ... | @@ -60,44 +78,56 @@ |
60 | 78 | </thead> |
61 | 79 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
62 | 80 | @foreach($Msgs as $msg) |
63 | - <tr class="text-gray-700 dark:text-gray-400" | |
64 | - @if (isset($msg->user_to->id)) | |
65 | - @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) | |
66 | - style="background-color: #403998;" | |
67 | - @endif | |
68 | - @endif> | |
81 | + <tr class="text-gray-700 dark:text-gray-400" data-message-id="{{ $msg->id }}"> | |
69 | 82 | <td class="px-4 py-3"> |
70 | - {{$msg->id}} | |
83 | + {{ $msg->id }} | |
71 | 84 | </td> |
72 | 85 | <td class="px-4 py-3"> |
73 | - @if (isset($msg->user_from->name)) | |
74 | - {{$msg->user_from->name}} ({{$msg->user_from->id}}) | |
75 | - @else | |
76 | - Пользователь удален | |
77 | - @endif | |
86 | + <div class="user-name"> | |
87 | + @if (isset($msg->user->name)) | |
88 | + {{$msg->user->name}} ({{$msg->user->id}}) | |
89 | + @else | |
90 | + Пользователь удален | |
91 | + @endif | |
92 | + </div> | |
78 | 93 | </td> |
79 | 94 | <td class="px-4 py-3"> |
80 | - @if (isset($msg->user_to->name)) | |
81 | - {{$msg->user_to->name}} ({{$msg->user_to->id}}) | |
82 | - @else | |
83 | - Пользователь удален | |
84 | - @endif | |
95 | + @if($msg->job_titles) | |
96 | + @foreach($msg->jobs as $job) | |
97 | + {{ $job->name }} | |
98 | + @if(!$loop->last) | |
99 | + <br> | |
100 | + @endif | |
101 | + @endforeach | |
102 | + @endif | |
85 | 103 | </td> |
86 | 104 | <td class="px-4 py-3"> |
87 | - {{$msg->title}} | |
88 | - <div class="flex items-center text-sm"> | |
89 | - <textarea cols="7" style="width:250px;">{{ $msg->text }}</textarea> | |
105 | + <div> | |
106 | + {{ $msg->text }} | |
90 | 107 | </div> |
91 | 108 | </td> |
92 | 109 | <td class="px-4 py-3 text-sm"> |
93 | 110 | {{ date('d.m.Y h:i:s', strtotime($msg->created_at)) }} |
94 | 111 | </td> |
95 | - <td class="px-4 py-3 text-sm"> | |
96 | - @if (isset($msg->user_to->id)) | |
97 | - @if (($msg->user_to->id == $id_admin) && ($msg->flag_new == 1)) | |
98 | - <input type="checkbox" class="checkread" value="{{$msg->id}}" name="read_{{$msg->id}}"/> | |
112 | + <td class="px-4 py-3"> | |
113 | + @if($msg->is_rejected) | |
114 | + Отклонено | |
115 | + @elseif($msg->is_sent) | |
116 | + Отправлено | |
117 | + @else | |
118 | + <div class=""> | |
119 | + <button class="rejecte-button px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-red-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
120 | + data-fancybox data-src="#rejecte_message" | |
121 | + > | |
122 | + Отклонить | |
123 | + </button> | |
124 | + <button class="send-button px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-green-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
125 | + data-fancybox data-src="#send_message" | |
126 | + > | |
127 | + Отправить | |
128 | + </button> | |
129 | + </div> | |
99 | 130 | @endif |
100 | - @endif | |
101 | 131 | </td> |
102 | 132 | </tr> |
103 | 133 | @endforeach |
... | ... | @@ -177,4 +207,7 @@ |
177 | 207 | </div> |
178 | 208 | </form> |
179 | 209 | </div> |
210 | + | |
211 | + @include('modals.admin.messages.rejecte_message') | |
212 | + @include('modals.admin.messages.send_message') | |
180 | 213 | @endsection |
resources/views/chats/chats_list.blade.php
1 | 1 | @if ($chats->count()) |
2 | 2 | @csrf |
3 | + | |
4 | + @if($admin_chat) | |
5 | + <div class="messages__item hover-shadow admin-chat-wrap"> | |
6 | + <a class="messages__item-info" href="{{ route($user_type . '.dialog', ['chat' => $admin_chat->id]) }}"> | |
7 | + @include('svg.logo_icon') | |
8 | + <div class="messages__item-text"> | |
9 | + <div> | |
10 | + <b>Администратор сайта</b> | |
11 | + </div> | |
12 | + <div> | |
13 | + {{ $admin_chat->last_message->text }} | |
14 | + </div> | |
15 | + </div> | |
16 | + </a> | |
17 | + | |
18 | + <div class="messages__item-actions" data-chat-id="{{ $admin_chat->id }}"> | |
19 | + <div class="messages__item-date max-content">{{ date(' H:i, d.m.Y', strtotime($admin_chat->created_at)) }}</div> | |
20 | + </div> | |
21 | + </div> | |
22 | + @endif | |
23 | + | |
3 | 24 | @foreach($chats as $chat) |
4 | 25 | <div class="messages__item hover-shadow {{ intval($chat->is_fixed) == 1 ? 'chat-fixed' : '' }}"> |
5 | - <a class="messages__item-info" href="{{ route($user_type . '.dialog', ['user1' => $chat->user_id, 'user2' => $chat->to_user_id, 'ad_employer' => 0]) }}"> | |
26 | + <a class="messages__item-info" href="{{ route($user_type . '.dialog', ['chat' => $chat->id]) }}"> | |
6 | 27 | <div class="messages__item-photo"> |
7 | 28 | @if (isset($chat->employer->logo)) |
8 | 29 | <img src="{{ asset(Storage::url($chat->employer->logo)) }}" alt=""> |
resources/views/emails/added_mass_sending_messages.blade.php
resources/views/employers/dialog.blade.php
... | ... | @@ -163,7 +163,14 @@ |
163 | 163 | |
164 | 164 | </div> |
165 | 165 | <div class="chatbox__item-body"> |
166 | - <div class="chatbox__item-text">{{ $it->text }}</div> | |
166 | + <div class="chatbox__item-text"> | |
167 | + {{ $it->text }} | |
168 | + @if($it->reply_message_id) | |
169 | + <div class="reply-message"> | |
170 | + {{ $it->reply_message->text }} | |
171 | + </div> | |
172 | + @endif | |
173 | + </div> | |
167 | 174 | </div> |
168 | 175 | <div class="chatbox__item-time">{{ $it->created_at }}</div> |
169 | 176 | </div> |
resources/views/employers/send_all.blade.php
... | ... | @@ -26,70 +26,27 @@ |
26 | 26 | <div class="cabinet__descr"> |
27 | 27 | <h2 class="title cabinet__title">Рассылка сообщений</h2> |
28 | 28 | @include('messages_error') |
29 | - <p class="cabinet__text"><b>Контактные данные</b></p> | |
30 | - <p class="cabinet__text">Все поля обязательны для заполнения *</p> | |
31 | - </div> | |
32 | - <div class="cabinet__inputs"> | |
33 | - <div class="cabinet__inputs-item form-group"> | |
34 | - <label class="form-group__label">Название судоходной компании</label> | |
35 | - <div class="form-group__item"> | |
36 | - <input type="text" class="input" name="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company }}" required> | |
37 | - </div> | |
38 | - </div> | |
39 | - | |
40 | - <div class="cabinet__inputs-item form-group"> | |
41 | - <label class="form-group__label">Электронная почта</label> | |
42 | - <div class="form-group__item"> | |
43 | - <input type="email" class="input" name="email" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email }}" required> | |
44 | - </div> | |
45 | - </div> | |
46 | - | |
47 | - <div class="cabinet__inputs-item form-group"> | |
48 | - <label class="form-group__label">Номер телефона</label> | |
49 | - <div class="form-group__item"> | |
50 | - <input type="tel" class="input" name="telephone" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone }}" required> | |
51 | - </div> | |
52 | - </div> | |
53 | - | |
54 | - <div class="cabinet__inputs-item form-group"> | |
55 | - <label class="form-group__label">Адрес (Город)</label> | |
56 | - <div class="form-group__item"> | |
57 | - <input type="text" class="input" name="city" placeholder="Мурманск" value="{{ old('city') ?? $Employer[0]->city }}" required> | |
58 | - </div> | |
59 | - </div> | |
60 | - | |
61 | - <!--<div class="cabinet__inputs-item form-group"> | |
62 | - <label class="form-group__label">Адрес компании</label> | |
63 | - <div class="form-group__item"> | |
64 | - <div class="select"> | |
65 | - <select class="js-select2"> | |
66 | - <option selected disabled>Выберите должность из списка</option> | |
67 | - <option>Вариант 1</option> | |
68 | - <option>Вариант 2</option> | |
69 | - <option>Вариант 3</option> | |
70 | - <option>Вариант 4</option> | |
71 | - <option>Вариант 5</option> | |
72 | - <option>Вариант 6</option> | |
73 | - </select> | |
74 | - </div> | |
75 | - </div> | |
76 | - </div>--> | |
77 | 29 | </div> |
78 | 30 | </div> |
79 | 31 | |
80 | 32 | <div class="cabinet__body-item"> |
81 | - <div class="cabinet__descr"> | |
82 | - <p class="cabinet__text"><b>Ваше сообщение</b></p> | |
83 | - </div> | |
84 | 33 | <div class="cabinet__inputs"> |
85 | 34 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
86 | - <label class="form-group__label">Тема сообщения</label> | |
35 | + <label class="form-group__label">Выберите должность</label> | |
87 | 36 | <div class="form-group__item"> |
88 | - <input type="text" name="text_sms" class="input" value="{{ old('text_sms') ?? '' }}" required> | |
37 | + <div class="select"> | |
38 | + <select class="js-select2" name="job_title_ids[]" id="job_title_ids[]" multiple="multiple"> | |
39 | + @if ($job_titles->count()) | |
40 | + @foreach($job_titles as $job_title) | |
41 | + <option value="{{ $job_title->id }}">{{ $job_title->name }}</option> | |
42 | + @endforeach | |
43 | + @endif | |
44 | + </select> | |
45 | + </div> | |
89 | 46 | </div> |
90 | 47 | </div> |
91 | 48 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
92 | - <label class="form-group__label">О компании (Приглашение)</label> | |
49 | + <label class="form-group__label">Введите текст сообщения</label> | |
93 | 50 | <div class="form-group__item"> |
94 | 51 | <textarea class="textarea" name="message_text" required>{{ old('message_text') ?? '' }}</textarea> |
95 | 52 | </div> |
resources/views/info_company_new.blade.php
... | ... | @@ -211,10 +211,10 @@ |
211 | 211 | </a> |
212 | 212 | @endif |
213 | 213 | |
214 | - <div class="bold font20">{{ $flot->name }}</div> | |
215 | - <div class="flot-label"><div class="flot-label-name">DWT</div> {{ $flot->DWT }}</div> | |
216 | - <div class="flot-label"><div class="flot-label-name">Мощность</div> {{ $flot->POWER_GD }}</div> | |
217 | - <div class="flot-label"><div class="flot-label-name">IMO</div> {{ $flot->IMO }}</div> | |
214 | + <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div> | |
215 | + <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div> | |
216 | + <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div> | |
217 | + <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div> | |
218 | 218 | </div> |
219 | 219 | @endforeach |
220 | 220 | @endif |
resources/views/js/favorite-worker.blade.php
1 | 1 | <script> |
2 | - console.log('js выполняется...123'); | |
3 | - | |
4 | 2 | $(document).ready(function() { |
5 | 3 | $(document).on('click', '.js_box_favorit', function () { |
6 | - var _this = $(this); | |
7 | - var id = _this.attr('id'); | |
8 | - var id_worker = _this.attr('data-val'); | |
9 | - console.log('active='+id); | |
10 | - console.log('is_worker='+id_worker); | |
4 | + var this_btn = $(this); | |
5 | + var id_worker = this_btn.attr('data-val'); | |
6 | + var data = {code_record: id_worker}; | |
11 | 7 | |
12 | - if ($( "#"+id ).hasClass( "active" )) { | |
13 | - console.log('Download 41... final'); | |
14 | - $.ajax({ | |
15 | - type: "GET", | |
16 | - url: "{{ route('like_resume') }}", | |
17 | - data: "code_record=" + id_worker, | |
18 | - success: function (data) { | |
19 | - console.log('Выбор сортировки'); | |
20 | - console.log(data); | |
8 | + if (this_btn.hasClass('active')){ | |
9 | + data.delete = 1; | |
10 | + } | |
21 | 11 | |
22 | - }, | |
23 | - headers: { | |
24 | - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
25 | - }, | |
26 | - error: function (data) { | |
27 | - data = JSON.stringify(data); | |
28 | - console.log('Error: ' + data); | |
29 | - } | |
30 | - }); | |
31 | - } else { | |
32 | - console.log('Не выполнить условие никогда'); | |
33 | - $.ajax({ | |
34 | - type: "GET", | |
35 | - url: "{{ route('like_resume') }}", | |
36 | - data: "code_record=" + id_worker + "&delete=1", | |
37 | - success: function (data) { | |
38 | - console.log('Выбор сортировки'); | |
39 | - console.log(data); | |
40 | - }, | |
41 | - headers: { | |
42 | - 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
43 | - }, | |
44 | - error: function (data) { | |
45 | - data = JSON.stringify(data); | |
46 | - console.log('Error: ' + data); | |
47 | - } | |
48 | - }); | |
12 | + if (this_btn.hasClass('active')){ | |
13 | + this_btn.removeClass('active'); | |
14 | + } else{ | |
15 | + this_btn.addClass('active'); | |
49 | 16 | } |
17 | + | |
18 | + $.ajax({ | |
19 | + type: "GET", | |
20 | + url: "{{ route('like_resume') }}", | |
21 | + data: data, | |
22 | + success: function (data) { | |
23 | + | |
24 | + }, | |
25 | + headers: { | |
26 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
27 | + }, | |
28 | + error: function (data) { | |
29 | + data = JSON.stringify(data); | |
30 | + console.log('Error: ' + data); | |
31 | + } | |
32 | + }); | |
50 | 33 | }); |
51 | 34 | }); |
52 | 35 | </script> |
resources/views/layout/admin.blade.php
... | ... | @@ -21,6 +21,11 @@ |
21 | 21 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> |
22 | 22 | <script src="{{ asset('./assets/js/charts-lines.js') }}" defer></script> |
23 | 23 | <script src="{{ asset('./assets/js/charts-pie.js') }}" defer></script> |
24 | + <script src="{{ asset('js/jquery.fancybox.js') }}"></script> | |
25 | + <script src="{{ asset('./js/func.js') }}"></script> | |
26 | + <link rel="stylesheet" href="{{ asset('css/helpers.css') }}"> | |
27 | + <link rel="stylesheet" href="{{ asset('css/jquery.fancybox.css') }}"> | |
28 | + <link rel="stylesheet" href="{{ asset('css/general.css') }}"> | |
24 | 29 | </head> |
25 | 30 | <body> |
26 | 31 | <div class="flex h-screen bg-gray-50 dark:bg-gray-900" :class="{ 'overflow-hidden': isSideMenuOpen }"> |
resources/views/modals/admin/messages/rejecte_message.blade.php
... | ... | @@ -0,0 +1,38 @@ |
1 | +<div class="hide"> | |
2 | + <div id="rejecte_message" class="modal-dialog"> | |
3 | + <div class="modal-dialog-title"> | |
4 | + <h2>Отклонить сообщение</h2> | |
5 | + </div> | |
6 | + <div class="modal-dialog-body"> | |
7 | + <p>Вы действительно хотите отклонить сообщение №<span class="message-id"></span> от "<b><span class="user-name"></span></b>"?</p> | |
8 | + </div> | |
9 | + <div class="modal-dialog-footer"> | |
10 | + @include('modals.admin.modal_buttons.red', ['adm_modal_btn_class' => 'rejecte-message-button', 'adm_modal_btn_title' => 'Отклонить']) | |
11 | + @include('modals.admin.modal_buttons.close', ['adm_modal_btn_title' => 'Закрыть']) | |
12 | + </div> | |
13 | + </div> | |
14 | +</div> | |
15 | + | |
16 | +<script> | |
17 | + $(function(){ | |
18 | + $('.rejecte-message-button').click(function(){ | |
19 | + spinStart($(this)); | |
20 | + var wrap = $(this).closest('#rejecte_message'); | |
21 | + var message_id = wrap.data('message-id'); | |
22 | + | |
23 | + $.ajax({ | |
24 | + type: "POST", | |
25 | + url: "{{ route('admin.reject_message') }}", | |
26 | + data: { | |
27 | + id: message_id | |
28 | + }, | |
29 | + headers: { | |
30 | + 'X-CSRF-TOKEN': $('[name="_token"]').val() | |
31 | + }, | |
32 | + success: function(){ | |
33 | + location.reload(); | |
34 | + } | |
35 | + }); | |
36 | + }); | |
37 | + }); | |
38 | +</script> |
resources/views/modals/admin/messages/send_message.blade.php
... | ... | @@ -0,0 +1,38 @@ |
1 | +<div class="hide"> | |
2 | + <div id="send_message" class="modal-dialog"> | |
3 | + <div class="modal-dialog-title"> | |
4 | + <h2>Отправить сообщение</h2> | |
5 | + </div> | |
6 | + <div class="modal-dialog-body"> | |
7 | + <p>Вы действительно хотите отправить сообщение №<span class="message-id"></span> от "<b><span class="user-name"></span></b>"?</p> | |
8 | + </div> | |
9 | + <div class="modal-dialog-footer"> | |
10 | + @include('modals.admin.modal_buttons.green', ['adm_modal_btn_class' => 'send-message-button', 'adm_modal_btn_title' => 'Отправить']) | |
11 | + @include('modals.admin.modal_buttons.close', ['adm_modal_btn_title' => 'Закрыть']) | |
12 | + </div> | |
13 | + </div> | |
14 | +</div> | |
15 | + | |
16 | +<script> | |
17 | + $(function(){ | |
18 | + $('.send-message-button').click(function(){ | |
19 | + spinStart($(this)); | |
20 | + var wrap = $(this).closest('#send_message'); | |
21 | + var message_id = wrap.data('message-id'); | |
22 | + | |
23 | + $.ajax({ | |
24 | + type: "POST", | |
25 | + url: "{{ route('admin.send_message') }}", | |
26 | + data: { | |
27 | + id: message_id | |
28 | + }, | |
29 | + headers: { | |
30 | + 'X-CSRF-TOKEN': $('[name="_token"]').val() | |
31 | + }, | |
32 | + success: function(){ | |
33 | + location.reload(); | |
34 | + } | |
35 | + }); | |
36 | + }); | |
37 | + }); | |
38 | +</script> |
resources/views/modals/admin/modal_buttons/close.blade.php
resources/views/modals/admin/modal_buttons/green.blade.php
... | ... | @@ -0,0 +1,3 @@ |
1 | +<button type="button" class="{{ $adm_modal_btn_class }} flex px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-green-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | |
2 | + {{ $adm_modal_btn_title }} | |
3 | +</button> |
resources/views/modals/admin/modal_buttons/red.blade.php
... | ... | @@ -0,0 +1,3 @@ |
1 | +<button type="button" class="{{ $adm_modal_btn_class }} flex px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-red-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> | |
2 | + {{ $adm_modal_btn_title }} | |
3 | +</button> |
resources/views/modals/chats/answer_from_admin_chat.blade.php
... | ... | @@ -0,0 +1,54 @@ |
1 | +<div class="hide"> | |
2 | + <div id="answer_from_admin_chat_modal" class="modal-dialog"> | |
3 | + <div class="modal-dialog-title"> | |
4 | + <h2>Ответить работодателю</h2> | |
5 | + </div> | |
6 | + <div class="modal-dialog-body"> | |
7 | + <textarea class="textarea" name="text" placeholder="" required></textarea> | |
8 | + </div> | |
9 | + <div class="modal-dialog-footer"> | |
10 | + <button type="button" class="button answer-from-admin-chat-button">Отправить</button> | |
11 | + <button type="button" class="button button_light" onclick="$.fancybox.close();">Закрыть</button> | |
12 | + </div> | |
13 | + </div> | |
14 | +</div> | |
15 | + | |
16 | +<script> | |
17 | + $(function (){ | |
18 | + $('.answer-from-admin-chat-button').click(function(){ | |
19 | + spinStart($(this)); | |
20 | + var wrap = $(this).closest('#answer_from_admin_chat_modal'); | |
21 | + var to_user_id = wrap.data('to-user-id'); | |
22 | + var reply_message_id = wrap.data('message-id'); | |
23 | + var textarea = wrap.find('[name="text"]'); | |
24 | + var text = textarea.val() | |
25 | + | |
26 | + textarea.removeClass('border-red'); | |
27 | + if (!text.trim()){ | |
28 | + textarea.addClass('border-red'); | |
29 | + return; | |
30 | + } | |
31 | + | |
32 | + $.ajax({ | |
33 | + type: "POST", | |
34 | + url: "{{ route('send_message') }}", | |
35 | + data: { | |
36 | + to_user_id: to_user_id, | |
37 | + reply_message_id: reply_message_id, | |
38 | + text: text | |
39 | + }, | |
40 | + dataType: 'json', | |
41 | + headers: { | |
42 | + 'X-CSRF-TOKEN': $('[name="_token"]').val() | |
43 | + }, | |
44 | + success: function(res){ | |
45 | + if (res && res.success && res.url_redirect){ | |
46 | + window.location.replace(res.url_redirect); | |
47 | + } else{ | |
48 | + location.reload(); | |
49 | + } | |
50 | + } | |
51 | + }); | |
52 | + }); | |
53 | + }); | |
54 | +</script> |
resources/views/resume.blade.php
... | ... | @@ -32,21 +32,7 @@ |
32 | 32 | |
33 | 33 | <script> |
34 | 34 | $(document).ready(function() { |
35 | - $(document).on('click', '.js_box_favorites', function () { | |
36 | - var _this = $(this); | |
37 | - var id_worker = _this.attr('data-val'); | |
38 | 35 | |
39 | - if (_this.hasClass('active')) { | |
40 | - add_in_array(id_worker); | |
41 | - console.log('Добавлено в избранное id=' + id_worker); | |
42 | - } else { | |
43 | - delete_in_array(id_worker); | |
44 | - console.log('Удалено из избранных id='+id_worker) | |
45 | - } | |
46 | - var str = $.cookie('favorite_worker'); | |
47 | - console.log("Вывод куков "+str); | |
48 | - | |
49 | - }); | |
50 | 36 | }); |
51 | 37 | |
52 | 38 | //помеченный элемент |
resources/views/resume/resume_blocks.blade.php
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> |
7 | 7 | <div> |
8 | 8 | <div class="main__resume-base-body-item-buttons"> |
9 | - <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | |
9 | + <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | |
10 | 10 | <svg> |
11 | 11 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
12 | 12 | </svg> |
resources/views/svg/logo_icon.blade.php
resources/views/worker.blade.php
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены |
81 | 81 | исключительно в разрезе маркетинговых и финансовых предпосылок.</p> |
82 | 82 | <div class="main__resume-profile-about-buttons thing__bottom"> |
83 | - <button type="button" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}" | |
83 | + <button type="button" class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}" | |
84 | 84 | name="header-like-button" |
85 | 85 | > |
86 | 86 | <svg class="mr-10"> |
... | ... | @@ -339,7 +339,7 @@ |
339 | 339 | @if (App\Classes\StatusUser::Status()==0) |
340 | 340 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) |
341 | 341 | <div class="main__resume-profile-about-buttons flex width100"> |
342 | - <button type="button" class="like js-toggle active mr-10 js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" | |
342 | + <button type="button" class="like mr-10 js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" | |
343 | 343 | name="footer-like-button" |
344 | 344 | > |
345 | 345 | <svg class="mr-10"> |
resources/views/workers/dialog.blade.php
... | ... | @@ -5,6 +5,13 @@ |
5 | 5 | $(function(){ |
6 | 6 | var chatbox_div = $('.chatbox__list'); |
7 | 7 | chatbox_div.scrollTop(chatbox_div.prop("scrollHeight")); |
8 | + | |
9 | + $('.admin-chat-answer').click(function(){ | |
10 | + var modal = $('#answer_from_admin_chat_modal'); | |
11 | + | |
12 | + modal.data('to-user-id', $(this).data('to-user-id')); | |
13 | + modal.data('message-id', $(this).data('message-id')); | |
14 | + }); | |
8 | 15 | }); |
9 | 16 | |
10 | 17 | $(document).on('change', '#send_btn', function() { |
... | ... | @@ -81,7 +88,14 @@ |
81 | 88 | </a> |
82 | 89 | <div class="chatbox"> |
83 | 90 | <div class="chatbox__toper"> |
84 | - @if ($companion->is_worker) | |
91 | + @if($chat->is_admin_chat) | |
92 | + <div class="chatbox__toper-info messages__item-info"> | |
93 | + @include('svg.logo_icon') | |
94 | + <div class="messages__item-text bold font20"> | |
95 | + Администратор сайта | |
96 | + </div> | |
97 | + </div> | |
98 | + @elseif ($companion->is_worker) | |
85 | 99 | <div class="chatbox__toper-info messages__item-info"> |
86 | 100 | <div class="messages__item-photo"> |
87 | 101 | <svg> |
... | ... | @@ -104,7 +118,7 @@ |
104 | 118 | </a> |
105 | 119 | @endif |
106 | 120 | @else |
107 | - <div class="chatbox__toper-info messages__item-info 222"> | |
121 | + <div class="chatbox__toper-info messages__item-info"> | |
108 | 122 | <div class="messages__item-photo"> |
109 | 123 | <svg> |
110 | 124 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
... | ... | @@ -151,7 +165,7 @@ |
151 | 165 | <svg> |
152 | 166 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
153 | 167 | </svg> |
154 | - @if ($companion->is_worker) | |
168 | + @if($companion->is_worker) | |
155 | 169 | @if ((isset($companion->workers[0]->photo)) && |
156 | 170 | (!empty($companion->workers[0]->photo))) |
157 | 171 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> |
... | ... | @@ -174,29 +188,49 @@ |
174 | 188 | </div> |
175 | 189 | @else |
176 | 190 | <div class="chatbox__item chatbox__item_reverse"> |
177 | - <div class="chatbox__item-photo"> | |
178 | - <svg> | |
179 | - <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | |
180 | - </svg> | |
181 | - @if ($sender->is_worker) | |
182 | - @if ((isset($sender->workers[0]->photo)) && | |
183 | - (!empty($sender->workers[0]->photo))) | |
184 | - <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> | |
185 | - @else | |
186 | - <img src="{{ asset('images/default_man.jpg') }}" alt=""> | |
187 | - @endif | |
191 | + <div class="@if(!$chat->is_admin_chat) chatbox__item-photo @endif"> | |
192 | + @if($chat->is_admin_chat) | |
193 | + @include('svg.logo_icon') | |
188 | 194 | @else |
189 | - @if ((isset($sender->employers[0]->logo)) && | |
190 | - (!empty($sender->employers[0]->logo))) | |
191 | - <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> | |
195 | + @if ($sender->is_worker) | |
196 | + @if ((isset($sender->workers[0]->photo)) && | |
197 | + (!empty($sender->workers[0]->photo))) | |
198 | + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> | |
199 | + @else | |
200 | + <img src="{{ asset('images/default_man.jpg') }}" alt=""> | |
201 | + @endif | |
192 | 202 | @else |
193 | - <img src="{{ asset('images/default_man.jpg') }}" alt=""> | |
203 | + <svg> | |
204 | + <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | |
205 | + </svg> | |
206 | + | |
207 | + @if ((isset($sender->employers[0]->logo)) && | |
208 | + (!empty($sender->employers[0]->logo))) | |
209 | + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> | |
210 | + @else | |
211 | + <img src="{{ asset('images/default_man.jpg') }}" alt=""> | |
212 | + @endif | |
194 | 213 | @endif |
195 | 214 | @endif |
196 | - | |
197 | 215 | </div> |
198 | 216 | <div class="chatbox__item-body"> |
199 | - <div class="chatbox__item-text">{{ $it->text }}</div> | |
217 | + <div class="chatbox__item-text"> | |
218 | + @if($chat->is_admin_chat) | |
219 | + <button class="button admin-chat-answer" data-fancybox data-src="#answer_from_admin_chat_modal" | |
220 | + data-to-user-id="{{ $it->user_id }}" data-message-id="{{ $it->id }}" | |
221 | + > | |
222 | + Ответить | |
223 | + </button> | |
224 | + @endif | |
225 | + | |
226 | + {{ $it->text }} | |
227 | + | |
228 | + @if($it->reply_message_id) | |
229 | + <div class="reply-message"> | |
230 | + {{ $it->reply_message->text }} | |
231 | + </div> | |
232 | + @endif | |
233 | + </div> | |
200 | 234 | @if ((isset($it->file)) && (!empty($it->file))) |
201 | 235 | <a href="{{ asset(Storage::url($it->file)) }}" class="chatbox__item-text"> |
202 | 236 | <svg> |
... | ... | @@ -212,6 +246,7 @@ |
212 | 246 | @endforeach |
213 | 247 | @endif |
214 | 248 | </div> |
249 | + @if(!$chat->is_admin_chat) | |
215 | 250 | <form action="{{ route('worker.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > |
216 | 251 | @csrf |
217 | 252 | <label class="chatbox__bottom-file"> |
... | ... | @@ -232,6 +267,7 @@ |
232 | 267 | </svg> |
233 | 268 | </button> |
234 | 269 | </form> |
270 | + @endif | |
235 | 271 | </div> |
236 | 272 | </div> |
237 | 273 | </div> |
... | ... | @@ -239,4 +275,6 @@ |
239 | 275 | </div> |
240 | 276 | </section> |
241 | 277 | </div> |
278 | + | |
279 | + @include('modals.chats.answer_from_admin_chat') | |
242 | 280 | @endsection |
routes/web.php
... | ... | @@ -281,6 +281,9 @@ Route::group([ |
281 | 281 | // кабинет - sql - конструкция запросов |
282 | 282 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
283 | 283 | |
284 | + Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message'); | |
285 | + Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message'); | |
286 | + | |
284 | 287 | /* |
285 | 288 | * Расписанный подход в описании каждой директорий групп пользователей. |
286 | 289 | */ |
... | ... | @@ -511,7 +514,7 @@ Route::group([ |
511 | 514 | |
512 | 515 | // 2 страница - Сообщения |
513 | 516 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
514 | - Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | |
517 | + Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog'); | |
515 | 518 | // 3 страница - Избранные вакансии |
516 | 519 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
517 | 520 | // Продолжение борьбы против колорадов - избранные вакансии |
... | ... | @@ -614,7 +617,7 @@ Route::group([ |
614 | 617 | |
615 | 618 | // 5 страница - Сообщения |
616 | 619 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
617 | - Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | |
620 | + Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog'); | |
618 | 621 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
619 | 622 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
620 | 623 | |
... | ... | @@ -656,3 +659,5 @@ Route::group([ |
656 | 659 | |
657 | 660 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); |
658 | 661 | |
662 | +Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message'); | |
663 | + |