Commit 7f3406fc6498aeaf021513598921b248400f8371

Authored by Hayk Nazaryan
1 parent 01a2f91b22
Exists in master

fix subscribe and replay

Showing 8 changed files with 99 additions and 27 deletions Inline Diff

app/Console/Commands/CreateAdminChat.php
1 <?php 1 <?php
2 2
3 namespace App\Console\Commands; 3 namespace App\Console\Commands;
4 4
5 use App\Models\Chat; 5 use App\Models\Chat;
6 use App\Models\Message; 6 use App\Models\Message;
7 use App\Models\User; 7 use App\Models\User;
8 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
9 9
10 class CreateAdminChat extends Command 10 class CreateAdminChat extends Command
11 { 11 {
12 /** 12 /**
13 * The name and signature of the console command. 13 * The name and signature of the console command.
14 * 14 *
15 * @var string 15 * @var string
16 */ 16 */
17 protected $signature = 'admin:chat'; 17 protected $signature = 'admin:chat';
18 18
19 /** 19 /**
20 * The console command description. 20 * The console command description.
21 * 21 *
22 * @var string 22 * @var string
23 */ 23 */
24 protected $description = 'Command description'; 24 protected $description = 'Command description';
25 25
26 /** 26 /**
27 * Execute the console command. 27 * Execute the console command.
28 * 28 *
29 * @return int 29 * @return int
30 */ 30 */
31 public function handle() 31 public function handle()
32 { 32 {
33 $superAdmin = User::superAdmin(); 33 $superAdmin = User::superAdmin();
34 34
35 $users = User::where('id', '!=', $superAdmin->id)->get(); 35 $users = User::where('id', '!=', $superAdmin->id)->get();
36 $chats = Chat::query() 36 $chats = Chat::query()
37 ->where('is_admin_chat', 1) 37 ->where('is_admin_chat', 1)
38 ->orWhere('to_user_id', $superAdmin->id) 38 ->orWhere('to_user_id', $superAdmin->id)
39 ->orWhere('user_id', $superAdmin->id)
39 ->get(); 40 ->get();
40 41
41 foreach ($chats as $chat) { 42 foreach ($chats as $chat) {
42 Message::query()->where('chat_id_from', $chat->id)->orWhere('chat_id_to', $chat->id)->delete(); 43 Message::query()->where('chat_id_from', $chat->id)->orWhere('chat_id_to', $chat->id)->delete();
43 $chat->delete(); 44 $chat->delete();
44 } 45 }
45 46
46 $loopCount = $users->count(); 47 $loopCount = $users->count();
47 48
48 if ($superAdmin) { 49 if ($superAdmin) {
49 foreach ($users as $user) { 50 foreach ($users as $user) {
50 Chat::firstOrCreate([ 51 Chat::firstOrCreate([
51 'user_id' => $user->id, 52 'user_id' => $user->id,
52 'to_user_id' => $superAdmin->id, 53 'to_user_id' => $superAdmin->id,
53 'is_admin_chat' => 1, 54 'is_admin_chat' => 1,
54 'is_removed' => 0, 55 'is_removed' => 0,
55 ]); 56 ]);
56 57
57 } 58 }
58 59
59 $this->info("Admin chats created for {$loopCount} users."); 60 $this->info("Admin chats created for {$loopCount} users.");
60 61
61 return Command::SUCCESS; 62 return Command::SUCCESS;
62 } 63 }
63 64
64 $this->error("Admin is missing!"); 65 $this->error("Admin is missing!");
65 66
66 } 67 }
67 68
68 } 69 }
69 70
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\MassSendingMessages; 13 use App\Mail\MassSendingMessages;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\ad_response; 16 use App\Models\ad_response;
17 use App\Models\Category; 17 use App\Models\Category;
18 use App\Models\Chat; 18 use App\Models\Chat;
19 use App\Models\Employer; 19 use App\Models\Employer;
20 use App\Models\EmployerAutoliftOption; 20 use App\Models\EmployerAutoliftOption;
21 use App\Models\Flot; 21 use App\Models\Flot;
22 use App\Models\Job_title; 22 use App\Models\Job_title;
23 use App\Models\Like_worker; 23 use App\Models\Like_worker;
24 use App\Models\Message; 24 use App\Models\Message;
25 use App\Models\Worker; 25 use App\Models\Worker;
26 use App\Models\MessagesRequests; 26 use App\Models\MessagesRequests;
27 use Carbon\Carbon; 27 use Carbon\Carbon;
28 use Illuminate\Auth\Events\Registered; 28 use Illuminate\Auth\Events\Registered;
29 use Illuminate\Database\Eloquent\Builder; 29 use Illuminate\Database\Eloquent\Builder;
30 use Illuminate\Http\RedirectResponse; 30 use Illuminate\Http\RedirectResponse;
31 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
32 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
33 use Illuminate\Support\Facades\Hash; 33 use Illuminate\Support\Facades\Hash;
34 use Illuminate\Support\Facades\Log; 34 use Illuminate\Support\Facades\Log;
35 use Illuminate\Support\Facades\Mail; 35 use Illuminate\Support\Facades\Mail;
36 use Illuminate\Support\Facades\Storage; 36 use Illuminate\Support\Facades\Storage;
37 use App\Models\User as User_Model; 37 use App\Models\User as User_Model;
38 use Illuminate\Support\Facades\Validator; 38 use Illuminate\Support\Facades\Validator;
39 use App\Enums\DbExportColumns; 39 use App\Enums\DbExportColumns;
40 use Illuminate\View\View; 40 use Illuminate\View\View;
41 use JsonException; 41 use JsonException;
42 use Throwable; 42 use Throwable;
43 43
44 class EmployerController extends Controller 44 class EmployerController extends Controller
45 { 45 {
46 public function vacancie($vacancy, Request $request) { 46 public function vacancie($vacancy, Request $request) {
47 $title = 'Заголовок вакансии'; 47 $title = 'Заголовок вакансии';
48 $Query = Ad_employer::with('jobs')-> 48 $Query = Ad_employer::with('jobs')->
49 with('cat')-> 49 with('cat')->
50 with('employer')-> 50 with('employer')->
51 with('jobs_code')-> 51 with('jobs_code')->
52 select('ad_employers.*')-> 52 select('ad_employers.*')->
53 where('id', '=', $vacancy)->get(); 53 where('id', '=', $vacancy)->get();
54 54
55 if ($Query[0]->active_is===0 || $Query[0]->is_remove!=0){ 55 if ($Query[0]->active_is===0 || $Query[0]->is_remove!=0){
56 56
57 abort(404); 57 abort(404);
58 58
59 } 59 }
60 60
61 if (isset(Auth()->user()->id)) 61 if (isset(Auth()->user()->id))
62 $uid = Auth()->user()->id; 62 $uid = Auth()->user()->id;
63 else 63 else
64 $uid = 0; 64 $uid = 0;
65 $title = $Query[0]->name; 65 $title = $Query[0]->name;
66 if ($request->ajax()) { 66 if ($request->ajax()) {
67 return view('ajax.vacance-item', compact('Query','uid')); 67 return view('ajax.vacance-item', compact('Query','uid'));
68 } else { 68 } else {
69 return view('vacance-item', compact('title', 'Query', 'uid')); 69 return view('vacance-item', compact('title', 'Query', 'uid'));
70 } 70 }
71 } 71 }
72 72
73 public function logout() { 73 public function logout() {
74 Auth::logout(); 74 Auth::logout();
75 return redirect()->route('index') 75 return redirect()->route('index')
76 ->with('success', 'Вы вышли из личного кабинета'); 76 ->with('success', 'Вы вышли из личного кабинета');
77 } 77 }
78 78
79 public function employer_info() { 79 public function employer_info() {
80 // код юзера 80 // код юзера
81 $user_info = Auth()->user(); 81 $user_info = Auth()->user();
82 // вьюшка для вывода данных 82 // вьюшка для вывода данных
83 return view('employers.info', compact('user_info')); 83 return view('employers.info', compact('user_info'));
84 } 84 }
85 85
86 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 86 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
87 // Все данные через реквест 87 // Все данные через реквест
88 $all = $request->all(); 88 $all = $request->all();
89 unset($all['_token']); 89 unset($all['_token']);
90 // обновление 90 // обновление
91 $user->update($all); 91 $user->update($all);
92 return redirect()->route('employer.employer_info'); 92 return redirect()->route('employer.employer_info');
93 } 93 }
94 94
95 public function cabinet() { 95 public function cabinet() {
96 $id = Auth()->user()->id; 96 $id = Auth()->user()->id;
97 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 97 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
98 WhereHas('users', 98 WhereHas('users',
99 function (Builder $query) use ($id) {$query->Where('id', $id); 99 function (Builder $query) use ($id) {$query->Where('id', $id);
100 })->get(); 100 })->get();
101 return view('employers.cabinet45', compact('Employer')); 101 return view('employers.cabinet45', compact('Employer'));
102 } 102 }
103 103
104 public function slider_flot() { 104 public function slider_flot() {
105 $id = Auth()->user()->id; 105 $id = Auth()->user()->id;
106 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 106 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
107 WhereHas('users', 107 WhereHas('users',
108 function (Builder $query) use ($id) {$query->Where('id', $id); 108 function (Builder $query) use ($id) {$query->Where('id', $id);
109 })->get(); 109 })->get();
110 return view('employers.fly-flot', compact('Employer')); 110 return view('employers.fly-flot', compact('Employer'));
111 } 111 }
112 112
113 public function cabinet_save(Employer $Employer, Request $request) { 113 public function cabinet_save(Employer $Employer, Request $request) {
114 $params = $request->all(); 114 $params = $request->all();
115 $params['user_id'] = Auth()->user()->id; 115 $params['user_id'] = Auth()->user()->id;
116 $id = $Employer->id; 116 $id = $Employer->id;
117 117
118 if ($request->has('logo')) { 118 if ($request->has('logo')) {
119 if (!empty($Employer->logo)) { 119 if (!empty($Employer->logo)) {
120 Storage::delete($Employer->logo); 120 Storage::delete($Employer->logo);
121 } 121 }
122 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 122 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
123 } 123 }
124 124
125 $Employer->update($params); 125 $Employer->update($params);
126 126
127 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 127 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
128 } 128 }
129 129
130 public function save_add_flot(FlotRequest $request) { 130 public function save_add_flot(FlotRequest $request) {
131 // отмена 131 // отмена
132 $params = $request->all(); 132 $params = $request->all();
133 133
134 if ($request->has('image')) { 134 if ($request->has('image')) {
135 $params['image'] = $request->file('image')->store("flot", 'public'); 135 $params['image'] = $request->file('image')->store("flot", 'public');
136 } 136 }
137 Flot::create($params); 137 Flot::create($params);
138 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 138 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
139 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 139 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
140 } 140 }
141 141
142 public function edit_flot(Flot $Flot, Employer $Employer) { 142 public function edit_flot(Flot $Flot, Employer $Employer) {
143 return view('employers.edit-flot', compact('Flot', 'Employer')); 143 return view('employers.edit-flot', compact('Flot', 'Employer'));
144 } 144 }
145 145
146 public function update_flot(FlotRequest $request, Flot $Flot) { 146 public function update_flot(FlotRequest $request, Flot $Flot) {
147 $params = $request->all(); 147 $params = $request->all();
148 148
149 if ($request->has('image')) { 149 if ($request->has('image')) {
150 if (!empty($flot->image)) { 150 if (!empty($flot->image)) {
151 Storage::delete($flot->image); 151 Storage::delete($flot->image);
152 } 152 }
153 $params['image'] = $request->file('image')->store("flot", 'public'); 153 $params['image'] = $request->file('image')->store("flot", 'public');
154 } else { 154 } else {
155 if (!empty($flot->image)) $params['image'] = $flot->image; 155 if (!empty($flot->image)) $params['image'] = $flot->image;
156 } 156 }
157 157
158 $Flot->update($params); 158 $Flot->update($params);
159 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 159 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
160 } 160 }
161 161
162 public function delete_flot(Flot $Flot) { 162 public function delete_flot(Flot $Flot) {
163 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 163 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
164 164
165 if (isset($Flot->id)) $Flot->delete(); 165 if (isset($Flot->id)) $Flot->delete();
166 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 166 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
167 } 167 }
168 168
169 // Форма добавления вакансий 169 // Форма добавления вакансий
170 public function cabinet_vacancie() { 170 public function cabinet_vacancie() {
171 /** @var User_Model $user */ 171 /** @var User_Model $user */
172 $user = Auth()->user(); 172 $user = Auth()->user();
173 173
174 if ($user->is_public) { 174 if ($user->is_public) {
175 $categories = Category::query()->active()->get(); 175 $categories = Category::query()->active()->get();
176 176
177 $jobs = Job_title::query() 177 $jobs = Job_title::query()
178 ->orderByDesc('sort') 178 ->orderByDesc('sort')
179 ->OrderBy('name') 179 ->OrderBy('name')
180 ->where('is_remove', '=', '0') 180 ->where('is_remove', '=', '0')
181 ->where('is_bd', '=', '0') 181 ->where('is_bd', '=', '0')
182 ->get(); 182 ->get();
183 183
184 $Employer = Employer::query() 184 $Employer = Employer::query()
185 ->with(['users', 'ads', 'flots']) 185 ->with(['users', 'ads', 'flots'])
186 ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id)) 186 ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id))
187 ->get(); 187 ->get();
188 188
189 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 189 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
190 } 190 }
191 191
192 return redirect()->route('employer.cabinet_vacancie_danger'); 192 return redirect()->route('employer.cabinet_vacancie_danger');
193 } 193 }
194 194
195 // Форма предупреждения об оплате 195 // Форма предупреждения об оплате
196 public function cabinet_vacancie_danger() { 196 public function cabinet_vacancie_danger() {
197 return view('employers.add_vacancy_danger'); 197 return view('employers.add_vacancy_danger');
198 } 198 }
199 199
200 // Сохранение вакансии 200 // Сохранение вакансии
201 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 201 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
202 $params_emp = $request->all(); 202 $params_emp = $request->all();
203 203
204 $params_job["job_title_id"] = $params_emp['job_title_id']; 204 $params_job["job_title_id"] = $params_emp['job_title_id'];
205 205
206 $ad_jobs = Ad_employer::create($params_emp); 206 $ad_jobs = Ad_employer::create($params_emp);
207 $ad_jobs->jobs()->sync($request->get('job_title_id')); 207 $ad_jobs->jobs()->sync($request->get('job_title_id'));
208 208
209 return redirect()->route('employer.vacancy_list')->with('success', 'Вакансия успешно опубликована'); 209 return redirect()->route('employer.vacancy_list')->with('success', 'Вакансия успешно опубликована');
210 } 210 }
211 211
212 // Список вакансий 212 // Список вакансий
213 public function vacancy_list(Request $request) { 213 public function vacancy_list(Request $request) {
214 $id = Auth()->user()->id; 214 $id = Auth()->user()->id;
215 215
216 $Employer = Employer::query()->where('user_id', $id)->first(); 216 $Employer = Employer::query()->where('user_id', $id)->first();
217 $vacancy_list = Ad_employer::query() 217 $vacancy_list = Ad_employer::query()
218 ->with('jobs') 218 ->with('jobs')
219 ->with('jobs_code') 219 ->with('jobs_code')
220 ->where('employer_id', $Employer->id) 220 ->where('employer_id', $Employer->id)
221 ->where('is_remove', 0) 221 ->where('is_remove', 0)
222 ->orderbyDesc('updated_at') 222 ->orderbyDesc('updated_at')
223 ; 223 ;
224 224
225 if (($request->has('search')) && (!empty($request->get('search')))) { 225 if (($request->has('search')) && (!empty($request->get('search')))) {
226 $search = $request->get('search'); 226 $search = $request->get('search');
227 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 227 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
228 } 228 }
229 229
230 if ($request->get('sort')) { 230 if ($request->get('sort')) {
231 $sort = $request->get('sort'); 231 $sort = $request->get('sort');
232 switch ($sort) { 232 switch ($sort) {
233 case 'nopublic': $vacancy_list->orderByDesc('updated_at') 233 case 'nopublic': $vacancy_list->orderByDesc('updated_at')
234 ->where('active_is', 0); 234 ->where('active_is', 0);
235 break; 235 break;
236 case 'public': $vacancy_list->orderByDesc('updated_at') 236 case 'public': $vacancy_list->orderByDesc('updated_at')
237 ->where('active_is',1); 237 ->where('active_is',1);
238 break; 238 break;
239 default: $vacancy_list->orderByDesc('updated_at'); 239 default: $vacancy_list->orderByDesc('updated_at');
240 break; 240 break;
241 } 241 }
242 } else { 242 } else {
243 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); 243 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
244 } 244 }
245 245
246 $vacancy_list = $vacancy_list->paginate(10); 246 $vacancy_list = $vacancy_list->paginate(10);
247 247
248 if ($request->ajax()) { 248 if ($request->ajax()) {
249 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 249 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
250 } else { 250 } else {
251 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 251 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
252 } 252 }
253 } 253 }
254 254
255 // Карточка вакансии 255 // Карточка вакансии
256 public function vacancy_edit(Ad_employer $ad_employer) { 256 public function vacancy_edit(Ad_employer $ad_employer) {
257 $id = Auth()->user()->id; 257 $id = Auth()->user()->id;
258 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 258 $Positions = Category::query()->where('is_remove', '=', '0')->get();
259 259
260 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 260 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
261 where('is_remove', '=', '0')-> 261 where('is_remove', '=', '0')->
262 where('is_bd', '=', '0')->get(); 262 where('is_bd', '=', '0')->get();
263 263
264 $Employer = Employer::query()->with('users')->with('ads')-> 264 $Employer = Employer::query()->with('users')->with('ads')->
265 with('flots')->where('user_id', $id)->first(); 265 with('flots')->where('user_id', $id)->first();
266 266
267 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 267 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
268 } 268 }
269 269
270 // Сохранение-редактирование записи 270 // Сохранение-редактирование записи
271 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 271 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
272 $params = $request->all(); 272 $params = $request->all();
273 273
274 $ad_employer->update($params); 274 $ad_employer->update($params);
275 $ad_employer->active_is = 1; 275 $ad_employer->active_is = 1;
276 $ad_employer->save(); 276 $ad_employer->save();
277 $ad_employer->jobs()->sync($request->get('job_title_id')); 277 $ad_employer->jobs()->sync($request->get('job_title_id'));
278 278
279 $id = Auth()->user()->id; 279 $id = Auth()->user()->id;
280 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 280 $Positions = Category::query()->where('is_remove', '=', '0')->get();
281 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 281 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
282 ->where('is_remove', '=', '0') 282 ->where('is_remove', '=', '0')
283 ->where('is_bd', '=', '0') 283 ->where('is_bd', '=', '0')
284 ->get(); 284 ->get();
285 285
286 $Employer = Employer::query() 286 $Employer = Employer::query()
287 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 287 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
288 288
289 return redirect()->route('employer.vacancy_list')->with('success', 'Вакансия успешно отредактирована'); 289 return redirect()->route('employer.vacancy_list')->with('success', 'Вакансия успешно отредактирована');
290 } 290 }
291 291
292 // Сохранение карточки вакансии 292 // Сохранение карточки вакансии
293 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 293 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
294 $all = $request->all(); 294 $all = $request->all();
295 $ad_employer->update($all); 295 $ad_employer->update($all);
296 return redirect()->route('employer.cabinet_vacancie'); 296 return redirect()->route('employer.cabinet_vacancie');
297 } 297 }
298 298
299 // Удаление карточки вакансии 299 // Удаление карточки вакансии
300 public function vacancy_delete(Ad_employer $ad_employer) { 300 public function vacancy_delete(Ad_employer $ad_employer) {
301 $ad_employer->delete(); 301 $ad_employer->delete();
302 302
303 return redirect()->route('employer.vacancy_list') 303 return redirect()->route('employer.vacancy_list')
304 ->with('success', 'Данные были успешно сохранены'); 304 ->with('success', 'Данные были успешно сохранены');
305 } 305 }
306 306
307 // Обновление даты 307 // Обновление даты
308 public function vacancy_up(Ad_employer $ad_employer) { 308 public function vacancy_up(Ad_employer $ad_employer) {
309 $up = date('m/d/Y h:i:s', time()); 309 $up = date('m/d/Y h:i:s', time());
310 $ad_employer->updated_at = $up; 310 $ad_employer->updated_at = $up;
311 $ad_employer->save(); 311 $ad_employer->save();
312 312
313 return redirect()->back(); 313 return redirect()->back();
314 } 314 }
315 315
316 //Видимость вакансии 316 //Видимость вакансии
317 public function vacancy_eye(Ad_employer $ad_employer, $status) { 317 public function vacancy_eye(Ad_employer $ad_employer, $status) {
318 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 318 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
319 $vac_emp->active_is = $status; 319 $vac_emp->active_is = $status;
320 $vac_emp->save(); 320 $vac_emp->save();
321 321
322 return redirect()->route('employer.vacancy_list'); 322 return redirect()->route('employer.vacancy_list');
323 } 323 }
324 324
325 //Вакансия редактирования (шаблон) 325 //Вакансия редактирования (шаблон)
326 public function vacancy_update(Ad_employer $id) { 326 public function vacancy_update(Ad_employer $id) {
327 327
328 } 328 }
329 329
330 //Отклики на вакансию - лист 330 //Отклики на вакансию - лист
331 public function answers(Employer $employer, Request $request) { 331 public function answers(Employer $employer, Request $request) {
332 $user_id = Auth()->user()->id; 332 $user_id = Auth()->user()->id;
333 $answer = Ad_employer::query()->where('employer_id', $employer->id); 333 $answer = Ad_employer::query()->where('employer_id', $employer->id);
334 if ($request->has('search')) { 334 if ($request->has('search')) {
335 $search = trim($request->get('search')); 335 $search = trim($request->get('search'));
336 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 336 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
337 } 337 }
338 338
339 $answer = $answer->with('response')->OrderByDESC('id')->get(); 339 $answer = $answer->with('response')->OrderByDESC('id')->get();
340 340
341 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 341 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
342 } 342 }
343 343
344 //Обновление статуса 344 //Обновление статуса
345 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 345 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
346 $ad_response->update(Array('flag' => $flag)); 346 $ad_response->update(Array('flag' => $flag));
347 return redirect()->route('employer.answers', ['employer' => $employer->id]); 347 return redirect()->route('employer.answers', ['employer' => $employer->id]);
348 } 348 }
349 349
350 //Страницы сообщений список 350 //Страницы сообщений список
351 public function messages($type_message) { 351 public function messages($type_message) {
352 $user_id = Auth()->user()->id; 352 $user_id = Auth()->user()->id;
353 $superAdmin =User_Model::superAdmin(); 353 $superAdmin =User_Model::superAdmin();
354 $chats = Chat::get_user_chats($user_id); 354 $chats = Chat::get_user_chats($user_id);
355 $admin_chat = Chat::get_user_admin_chat($user_id); 355 $admin_chat = Chat::get_user_admin_chat($user_id);
356 $user_type = 'employer'; 356 $user_type = 'employer';
357 357
358 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type','superAdmin')); 358 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type','superAdmin'));
359 } 359 }
360 360
361 // Диалог между пользователями 361 // Диалог между пользователями
362 public function dialog(Chat $chat, Request $request) { 362 public function dialog(Chat $chat, Request $request) {
363 // Получение параметров. 363 // Получение параметров.
364 if ($request->has('ad_employer')){ 364 if ($request->has('ad_employer')){
365 $ad_employer = $request->get('ad_employer'); 365 $ad_employer = $request->get('ad_employer');
366 } else { 366 } else {
367 $ad_employer = 0; 367 $ad_employer = 0;
368 } 368 }
369 $superAdmin =User_Model::superAdmin(); 369 $superAdmin =User_Model::superAdmin();
370 370
371 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 371 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
372 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 372 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
373 373
374 $Messages = Chat::get_chat_messages($chat); 374 $Messages = Chat::get_chat_messages($chat);
375 375
376 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); 376 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]);
377 377
378 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages','chat','superAdmin')); 378 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages','chat','superAdmin'));
379 } 379 }
380 380
381 public function pin_chat(Request $request){ 381 public function pin_chat(Request $request){
382 $chat_id = $request->get('id'); 382 $chat_id = $request->get('id');
383 $is_fixed = $request->get('is_fixed'); 383 $is_fixed = $request->get('is_fixed');
384 384
385 Chat::pin_chat($chat_id, $is_fixed); 385 Chat::pin_chat($chat_id, $is_fixed);
386 } 386 }
387 387
388 public function remove_chat(Request $request){ 388 public function remove_chat(Request $request){
389 $chat_id = $request->get('id'); 389 $chat_id = $request->get('id');
390 Chat::remove_chat($chat_id); 390 Chat::remove_chat($chat_id);
391 } 391 }
392 392
393 // Регистрация работодателя 393 // Регистрация работодателя
394 public function register_employer(Request $request) { 394 public function register_employer(Request $request) {
395 $params = $request->all(); 395 $params = $request->all();
396 396
397 $rules = [ 397 $rules = [
398 //'surname' => ['required', 'string', 'max:255'], 398 //'surname' => ['required', 'string', 'max:255'],
399 //'name_man' => ['required', 'string', 'max:255'], 399 //'name_man' => ['required', 'string', 'max:255'],
400 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 400 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
401 'name_company' => ['required', 'string', 'max:255'], 401 'name_company' => ['required', 'string', 'max:255'],
402 'password' => ['required', 'string', 'min:6'], 402 'password' => ['required', 'string', 'min:6'],
403 ]; 403 ];
404 404
405 $messages = [ 405 $messages = [
406 'required' => 'Укажите обязательное поле', 406 'required' => 'Укажите обязательное поле',
407 'min' => [ 407 'min' => [
408 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 408 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
409 'integer' => 'Поле «:attribute» должно быть :min или больше', 409 'integer' => 'Поле «:attribute» должно быть :min или больше',
410 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 410 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
411 ], 411 ],
412 'max' => [ 412 'max' => [
413 'string' => 'Поле «:attribute» должно быть не больше :max символов', 413 'string' => 'Поле «:attribute» должно быть не больше :max символов',
414 'integer' => 'Поле «:attribute» должно быть :max или меньше', 414 'integer' => 'Поле «:attribute» должно быть :max или меньше',
415 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 415 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
416 ] 416 ]
417 ]; 417 ];
418 418
419 $email = $request->get('email'); 419 $email = $request->get('email');
420 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 420 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
421 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 421 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
422 } 422 }
423 423
424 if ($request->get('password') !== $request->get('confirmed')){ 424 if ($request->get('password') !== $request->get('confirmed')){
425 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 425 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
426 } 426 }
427 427
428 if (strlen($request->get('password')) < 6) { 428 if (strlen($request->get('password')) < 6) {
429 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 429 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
430 } 430 }
431 431
432 if (empty($request->get('surname'))) { 432 if (empty($request->get('surname'))) {
433 $params['surname'] = 'Неизвестно'; 433 $params['surname'] = 'Неизвестно';
434 } 434 }
435 if (empty($request->get('name_man'))) { 435 if (empty($request->get('name_man'))) {
436 $params['name_man'] = 'Неизвестно'; 436 $params['name_man'] = 'Неизвестно';
437 } 437 }
438 $validator = Validator::make($params, $rules, $messages); 438 $validator = Validator::make($params, $rules, $messages);
439 439
440 if ($validator->fails()) { 440 if ($validator->fails()) {
441 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 441 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
442 } else { 442 } else {
443 $user = $this->create($params); 443 $user = $this->create($params);
444 event(new Registered($user)); 444 event(new Registered($user));
445 445
446 try { 446 try {
447 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 447 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
448 } catch (Throwable $e) { 448 } catch (Throwable $e) {
449 Log::error($e); 449 Log::error($e);
450 } 450 }
451 451
452 Auth::guard()->login($user); 452 Auth::guard()->login($user);
453 } 453 }
454 454
455 if ($user) { 455 if ($user) {
456 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 456 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
457 } else { 457 } else {
458 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 458 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
459 } 459 }
460 } 460 }
461 461
462 // Создание пользователя 462 // Создание пользователя
463 protected function create(array $data) 463 protected function create(array $data)
464 { 464 {
465 $Use = new User_Model(); 465 $Use = new User_Model();
466 $Code_user = $Use->create([ 466 $Code_user = $Use->create([
467 'name' => $data['surname']." ".$data['name_man'], 467 'name' => $data['surname']." ".$data['name_man'],
468 'name_man' => $data['name_man'], 468 'name_man' => $data['name_man'],
469 'surname' => $data['surname'], 469 'surname' => $data['surname'],
470 'surname2' => $data['surname2'], 470 'surname2' => $data['surname2'],
471 'subscribe_email' => $data['email'], 471 'subscribe_email' => $data['email'],
472 'email' => $data['email'], 472 'email' => $data['email'],
473 'telephone' => $data['telephone'], 473 'telephone' => $data['telephone'],
474 'is_worker' => 0, 474 'is_worker' => 0,
475 'password' => Hash::make($data['password']), 475 'password' => Hash::make($data['password']),
476 'pubpassword' => base64_encode($data['password']), 476 'pubpassword' => base64_encode($data['password']),
477 'email_verified_at' => Carbon::now() 477 'email_verified_at' => Carbon::now()
478 ]); 478 ]);
479 479
480 if ($Code_user->id > 0) { 480 if ($Code_user->id > 0) {
481 $Employer = new Employer(); 481 $Employer = new Employer();
482 $Employer->user_id = $Code_user->id; 482 $Employer->user_id = $Code_user->id;
483 $Employer->name_company = $data['name_company']; 483 $Employer->name_company = $data['name_company'];
484 $Employer->email = $data['email']; 484 $Employer->email = $data['email'];
485 $Employer->telephone = $data['telephone']; 485 $Employer->telephone = $data['telephone'];
486 $Employer->code = Tools::generator_id(10); 486 $Employer->code = Tools::generator_id(10);
487 $Employer->save(); 487 $Employer->save();
488 488
489 return $Code_user; 489 return $Code_user;
490 } 490 }
491 } 491 }
492 492
493 // Отправка сообщения от работодателя 493 // Отправка сообщения от работодателя
494 public function send_message(MessagesRequiest $request) { 494 public function send_message(MessagesRequiest $request) {
495 $params = $request->all(); 495 $params = $request->all();
496 dd($params); 496
497 $user1 = $params['user_id']; 497 $user1 = $params['user_id'];
498 $user2 = $params['to_user_id']; 498 $user2 = $params['to_user_id'];
499 499
500 if ($request->has('file')) { 500 if ($request->has('file')) {
501 $params['file'] = $request->file('file')->store("messages", 'public'); 501 $params['file'] = $request->file('file')->store("messages", 'public');
502 } 502 }
503 Message::create($params); 503 Message::create($params);
504 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 504 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
505 } 505 }
506 506
507 public function test123(Request $request) { 507 public function test123(Request $request) {
508 $params = $request->all(); 508 $params = $request->all();
509 $user1 = $params['user_id']; 509 $user1 = $params['user_id'];
510 $user2 = $params['to_user_id']; 510 $user2 = $params['to_user_id'];
511 511
512 $rules = [ 512 $rules = [
513 'text' => 'nullable|required_without:file|min:1|max:150000', 513 'text' => 'nullable|required_without:file|min:1|max:150000',
514 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 514 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
515 ]; 515 ];
516 $messages = [ 516 $messages = [
517 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 517 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
518 'min' => [ 518 'min' => [
519 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 519 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
520 'integer' => 'Поле «:attribute» должно быть :min или больше', 520 'integer' => 'Поле «:attribute» должно быть :min или больше',
521 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 521 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
522 ], 522 ],
523 'max' => [ 523 'max' => [
524 'string' => 'Поле «:attribute» должно быть не больше :max символов', 524 'string' => 'Поле «:attribute» должно быть не больше :max символов',
525 'integer' => 'Поле «:attribute» должно быть :max или меньше', 525 'integer' => 'Поле «:attribute» должно быть :max или меньше',
526 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 526 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
527 ] 527 ]
528 ]; 528 ];
529 529
530 $validator = Validator::make($request->all(), $rules, $messages); 530 $validator = Validator::make($request->all(), $rules, $messages);
531 531
532 if ($validator->fails()) { 532 if ($validator->fails()) {
533 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 533 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
534 } 534 }
535 535
536 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 536 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
537 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); 537 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]);
538 538
539 } 539 }
540 540
541 //Избранные люди 541 //Избранные люди
542 public function favorites(Request $request) 542 public function favorites(Request $request)
543 { 543 {
544 $likedWorkersIds = Like_worker::query() 544 $likedWorkersIds = Like_worker::query()
545 ->where('user_id', Auth::user()->id) 545 ->where('user_id', Auth::user()->id)
546 ->get() 546 ->get()
547 ->pluck('code_record') 547 ->pluck('code_record')
548 ->toArray(); 548 ->toArray();
549 549
550 $workerBuilder = Worker::query() 550 $workerBuilder = Worker::query()
551 ->whereIn('id', $likedWorkersIds); 551 ->whereIn('id', $likedWorkersIds);
552 552
553 if (($request->has('search')) && (!empty($request->get('search')))) { 553 if (($request->has('search')) && (!empty($request->get('search')))) {
554 $search = $request->get('search'); 554 $search = $request->get('search');
555 555
556 $workerBuilder->whereHas('users', function (Builder $query) use ($search) { 556 $workerBuilder->whereHas('users', function (Builder $query) use ($search) {
557 $query->where('surname', 'LIKE', "%$search%") 557 $query->where('surname', 'LIKE', "%$search%")
558 ->orWhere('name_man', 'LIKE', "%$search%") 558 ->orWhere('name_man', 'LIKE', "%$search%")
559 ->orWhere('surname2', 'LIKE', "%$search%"); 559 ->orWhere('surname2', 'LIKE', "%$search%");
560 }); 560 });
561 } 561 }
562 562
563 $Workers = $workerBuilder->get(); 563 $Workers = $workerBuilder->get();
564 564
565 return view('employers.favorite', compact('Workers')); 565 return view('employers.favorite', compact('Workers'));
566 } 566 }
567 567
568 // База данных 568 // База данных
569 public function bd(Request $request) { 569 public function bd(Request $request) {
570 if (!Auth::user()->show_database) { 570 if (!Auth::user()->show_database) {
571 return redirect()->route('employer.employer_info'); 571 return redirect()->route('employer.employer_info');
572 } 572 }
573 573
574 $users = User_Model::query()->with('workers')->with('jobtitles'); 574 $users = User_Model::query()->with('workers')->with('jobtitles');
575 575
576 if ($request->has('search')) { 576 if ($request->has('search')) {
577 $find_key = $request->get('search'); 577 $find_key = $request->get('search');
578 $users = $users->where('name', 'LIKE', "%$find_key%") 578 $users = $users->where('name', 'LIKE', "%$find_key%")
579 ->orWhere('surname', 'LIKE', "%$find_key%") 579 ->orWhere('surname', 'LIKE', "%$find_key%")
580 ->orWhere('name_man', 'LIKE', "%$find_key%") 580 ->orWhere('name_man', 'LIKE', "%$find_key%")
581 ->orWhere('email', 'LIKE', "%$find_key%") 581 ->orWhere('email', 'LIKE', "%$find_key%")
582 ->orWhere('telephone', 'LIKE', "%$find_key%"); 582 ->orWhere('telephone', 'LIKE', "%$find_key%");
583 } 583 }
584 584
585 // Данные 585 // Данные
586 $users = $users 586 $users = $users
587 ->Baseuser() 587 ->Baseuser()
588 ->orderByDesc(Worker::select('created_at') 588 ->orderByDesc(Worker::select('created_at')
589 ->whereColumn('workers.user_id', 'users.id')); 589 ->whereColumn('workers.user_id', 'users.id'));
590 $count_users = $users->count(); 590 $count_users = $users->count();
591 $users = $users->paginate(10); 591 $users = $users->paginate(10);
592 592
593 $export_options = DbExportColumns::toArray(); 593 $export_options = DbExportColumns::toArray();
594 594
595 $jobs_titles = Job_title::select('id', 'name') 595 $jobs_titles = Job_title::select('id', 'name')
596 ->where('is_remove', '=', 0) 596 ->where('is_remove', '=', 0)
597 ->where('is_bd', '=', 2) 597 ->where('is_bd', '=', 2)
598 ->orderByDesc('sort') 598 ->orderByDesc('sort')
599 ->orderBy('name', 'asc') 599 ->orderBy('name', 'asc')
600 ->get() 600 ->get()
601 ->toArray() 601 ->toArray()
602 ; 602 ;
603 603
604 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 604 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
605 } 605 }
606 606
607 //Настройка уведомлений 607 //Настройка уведомлений
608 public function subscribe() { 608 public function subscribe() {
609 return view('employers.subcribe'); 609
610 $user=Auth::user();
611
612 return view('employers.subcribe',compact('user'));
610 } 613 }
611 614
612 //Установка уведомлений сохранение 615 //Установка уведомлений сохранение
613 public function save_subscribe(Request $request) { 616 public function save_subscribe(Request $request) {
614 617
615 $msg = $request->validate([ 618 $msg = $request->validate([
616 'email' => 'required|email|min:5|max:255', 619 'email' => 'required|email|min:5|max:255',
617 ]); 620 ]);
618 $user= Auth::user(); 621 $user= Auth::user();
619 622
620 User_Model::updateOrCreate( 623 User_Model::updateOrCreate(
621 ['id' => $user->id], 624 ['id' => $user->id],
622 ['subscribe_email' => $request->email, 625 ['subscribe_email' => $request->email,
623 'subscribe' => request()->has('email_msg') && request('email_msg') === 'on' ? 1 : 0 626 'subscribe' => request()->has('email_msg') && request('email_msg') === 'on' ? 1 : 0
624 ] 627 ]
625 ); 628 );
626 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 629 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
627 } 630 }
628 //Сбросить форму с паролем 631 //Сбросить форму с паролем
629 public function password_reset() { 632 public function password_reset() {
630 $email = Auth()->user()->email; 633 $email = Auth()->user()->email;
631 return view('employers.password-reset', compact('email')); 634 return view('employers.password-reset', compact('email'));
632 } 635 }
633 636
634 //Обновление пароля 637 //Обновление пароля
635 public function new_password(Request $request) { 638 public function new_password(Request $request) {
636 $use = Auth()->user(); 639 $use = Auth()->user();
637 $request->validate([ 640 $request->validate([
638 'password' => 'required|string', 641 'password' => 'required|string',
639 'new_password' => 'required|string', 642 'new_password' => 'required|string',
640 'new_password2' => 'required|string' 643 'new_password2' => 'required|string'
641 ]); 644 ]);
642 645
643 if ($request->get('new_password') == $request->get('new_password2')) 646 if ($request->get('new_password') == $request->get('new_password2'))
644 if ($request->get('password') !== $request->get('new_password')) { 647 if ($request->get('password') !== $request->get('new_password')) {
645 $credentials = $request->only('email', 'password'); 648 $credentials = $request->only('email', 'password');
646 if (Auth::attempt($credentials)) { 649 if (Auth::attempt($credentials)) {
647 650
648 if (!is_null($use->email_verified_at)){ 651 if (!is_null($use->email_verified_at)){
649 652
650 $user_data = User_Model::find($use->id); 653 $user_data = User_Model::find($use->id);
651 $user_data->update([ 654 $user_data->update([
652 'password' => Hash::make($request->get('new_password')), 655 'password' => Hash::make($request->get('new_password')),
653 'pubpassword' => base64_encode($request->get('new_password')), 656 'pubpassword' => base64_encode($request->get('new_password')),
654 ]); 657 ]);
655 return redirect() 658 return redirect()
656 ->route('employer.password_reset') 659 ->route('employer.password_reset')
657 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 660 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
658 } 661 }
659 662
660 return redirect() 663 return redirect()
661 ->route('employer.password_reset') 664 ->route('employer.password_reset')
662 ->withError('Данная учетная запись не было верифицированна!'); 665 ->withError('Данная учетная запись не было верифицированна!');
663 } 666 }
664 } 667 }
665 668
666 return redirect() 669 return redirect()
667 ->route('employer.password_reset') 670 ->route('employer.password_reset')
668 ->withErrors('Не совпадение данных, обновите пароли!'); 671 ->withErrors('Не совпадение данных, обновите пароли!');
669 } 672 }
670 673
671 674
672 675
673 // Форма Удаление пипла 676 // Форма Удаление пипла
674 public function delete_people() { 677 public function delete_people() {
675 $login = Auth()->user()->email; 678 $login = Auth()->user()->email;
676 return view('employers.delete_people', compact('login')); 679 return view('employers.delete_people', compact('login'));
677 } 680 }
678 681
679 // Удаление аккаунта 682 // Удаление аккаунта
680 public function action_delete_user(Request $request) { 683 public function action_delete_user(Request $request) {
681 $Answer = $request->all(); 684 $Answer = $request->all();
682 $user_id = Auth()->user()->id; 685 $user_id = Auth()->user()->id;
683 $request->validate([ 686 $request->validate([
684 'password' => 'required|string', 687 'password' => 'required|string',
685 ]); 688 ]);
686 689
687 $credentials = $request->only('email', 'password'); 690 $credentials = $request->only('email', 'password');
688 if (Auth::attempt($credentials)) { 691 if (Auth::attempt($credentials)) {
689 Auth::logout(); 692 Auth::logout();
690 $it = User_Model::find($user_id); 693 $it = User_Model::find($user_id);
691 $it->delete(); 694 $it->delete();
692 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 695 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
693 } else { 696 } else {
694 return redirect()->route('employer.delete_people') 697 return redirect()->route('employer.delete_people')
695 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 698 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
696 } 699 }
697 } 700 }
698 701
699 public function ajax_delete_user(Request $request) { 702 public function ajax_delete_user(Request $request) {
700 $Answer = $request->all(); 703 $Answer = $request->all();
701 $user_id = Auth()->user()->id; 704 $user_id = Auth()->user()->id;
702 $request->validate([ 705 $request->validate([
703 'password' => 'required|string', 706 'password' => 'required|string',
704 ]); 707 ]);
705 $credentials = $request->only('email', 'password'); 708 $credentials = $request->only('email', 'password');
706 if (Auth::attempt($credentials)) { 709 if (Auth::attempt($credentials)) {
707 710
708 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 711 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
709 'email' => $request->get('email'), 712 'email' => $request->get('email'),
710 'password' => $request->get('password'))); 713 'password' => $request->get('password')));
711 } else { 714 } else {
712 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 715 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
713 } 716 }
714 } 717 }
715 718
716 // Рассылка сообщений 719 // Рассылка сообщений
717 public function send_all_messages() { 720 public function send_all_messages() {
718 $id = Auth()->user()->id; 721 $id = Auth()->user()->id;
719 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 722 $sending = Employer::query()->where('user_id', '=', "$id")->first();
720 723
721 $job_titles = Job_title::query() 724 $job_titles = Job_title::query()
722 ->where('is_remove', '=', 0) 725 ->where('is_remove', '=', 0)
723 ->where('is_bd', '=', 1) 726 ->where('is_bd', '=', 1)
724 ->orderByDesc('sort') 727 ->orderByDesc('sort')
725 ->get(); 728 ->get();
726 729
727 if ($sending->sending_is) 730 if ($sending->sending_is)
728 return view('employers.send_all', compact('job_titles')); 731 return view('employers.send_all', compact('job_titles'));
729 else 732 else
730 return view('employers.send_all_danger'); 733 return view('employers.send_all_danger');
731 } 734 }
732 735
733 // Отправка сообщений для информации 736 // Отправка сообщений для информации
734 public function send_all_post(Request $request) { 737 public function send_all_post(Request $request) {
735 $data = $request->all(); 738 $data = $request->all();
736 $data['user'] = Auth()->user(); 739 $data['user'] = Auth()->user();
737 740
738 $id = MessagesRequests::create([ 741 $id = MessagesRequests::create([
739 'user_id' => $data['user']->id, 742 'user_id' => $data['user']->id,
740 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null, 743 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null,
741 'text' => $data['message_text'], 744 'text' => $data['message_text'],
742 ]); 745 ]);
743 746
744 try { 747 try {
745 if (!empty($id)) { 748 if (!empty($id)) {
746 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); 749 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data));
747 } 750 }
748 } catch (Throwable $e) { 751 } catch (Throwable $e) {
749 Log::error($e); 752 Log::error($e);
750 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); 753 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее');
751 } 754 }
752 755
753 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); 756 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.');
754 } 757 }
755 758
756 // База резюме 759 // База резюме
757 public function bd_tupe(Request $request) { 760 public function bd_tupe(Request $request) {
758 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 761 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
759 762
760 return view('employers.bd_tupe', compact('Resume')); 763 return view('employers.bd_tupe', compact('Resume'));
761 } 764 }
762 765
763 ////////////////////////////////////////////////////////////////// 766 //////////////////////////////////////////////////////////////////
764 // Отправил сообщение 767 // Отправил сообщение
765 ////////////////////////////////////////////////////////////////// 768 //////////////////////////////////////////////////////////////////
766 public function new_message(Request $request) 769 public function new_message(Request $request)
767 { 770 {
768 $params = $request->all(); 771 $params = $request->all();
769 772
770 $id = $params['_user_id']; 773 $id = $params['_user_id'];
771 $message_params = [ 774 $message_params = [
772 'title' => $params['title'], 775 'title' => $params['title'],
773 'text' => $params['text'], 776 'text' => $params['text'],
774 'ad_employer_id' => $params['_vacancy'], 777 'ad_employer_id' => $params['_vacancy'],
775 'flag_new' => 1 778 'flag_new' => 1
776 ]; 779 ];
777 780
778 $message = Message::add_message( 781 $message = Message::add_message(
779 $request, 782 $request,
780 $params['_user_id'], 783 $params['_user_id'],
781 $params['_to_user_id'], 784 $params['_to_user_id'],
782 $message_params, 785 $message_params,
783 file_store_path: "worker/$id" 786 file_store_path: "worker/$id"
784 ); 787 );
785 788
786 return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]); 789 return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]);
787 } 790 }
788 791
789 // Восстановление пароля 792 // Восстановление пароля
790 public function repair_password(Request $request) { 793 public function repair_password(Request $request) {
791 $params = $request->get('email'); 794 $params = $request->get('email');
792 } 795 }
793 796
794 // Избранные люди на корабль 797 // Избранные люди на корабль
795 public function selected_people(Request $request) { 798 public function selected_people(Request $request) {
796 $id = $request->get('id'); 799 $id = $request->get('id');
797 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 800 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
798 where('is_remove', '=', '0')-> 801 where('is_remove', '=', '0')->
799 where('is_bd', '=', '0')-> 802 where('is_bd', '=', '0')->
800 where('position_id', $id)-> 803 where('position_id', $id)->
801 get(); 804 get();
802 return view('favorite_people', compact('favorite_people')); 805 return view('favorite_people', compact('favorite_people'));
803 } 806 }
804 807
805 /** 808 /**
806 * @throws JsonException 809 * @throws JsonException
807 */ 810 */
808 public function vacancyAutoLiftForm(): View|RedirectResponse 811 public function vacancyAutoLiftForm(): View|RedirectResponse
809 { 812 {
810 if (!Auth::user()->can_autolift) { 813 if (!Auth::user()->can_autolift) {
811 return redirect()->route('employer.employer_info'); 814 return redirect()->route('employer.employer_info');
812 } 815 }
813 816
814 $employer = Auth::user()->employers[0]; 817 $employer = Auth::user()->employers[0];
815 $vacancies = $employer 818 $vacancies = $employer
816 ->ads() 819 ->ads()
817 ->where('is_remove', 0) 820 ->where('is_remove', 0)
818 ->where('active_is', 1) 821 ->where('active_is', 1)
819 ->get(); 822 ->get();
820 823
821 $options = $employer->autoliftOptions ?? new EmployerAutoliftOption(); 824 $options = $employer->autoliftOptions ?? new EmployerAutoliftOption();
822 825
823 $leftDays = 0; 826 $leftDays = 0;
824 827
825 if ($options->days_repeat) { 828 if ($options->days_repeat) {
826 $leftDays = $options->days_repeat - now()->diffInDays(Carbon::parse($options->created_at)); 829 $leftDays = $options->days_repeat - now()->diffInDays(Carbon::parse($options->created_at));
827 } 830 }
828 831
829 832
830 return view('employers.vacancy_autolift', compact('vacancies', 'options', 'leftDays')); 833 return view('employers.vacancy_autolift', compact('vacancies', 'options', 'leftDays'));
831 } 834 }
832 835
833 /** 836 /**
834 * @throws JsonException 837 * @throws JsonException
835 */ 838 */
836 public function vacancyAutoLiftSave(Request $request) 839 public function vacancyAutoLiftSave(Request $request)
837 { 840 {
838 $employer = Auth::user()->employers[0]; 841 $employer = Auth::user()->employers[0];
839 842
840 $employer->autoliftOptions()->updateOrCreate( 843 $employer->autoliftOptions()->updateOrCreate(
841 [ 844 [
842 'employer_id' => $employer->id, 845 'employer_id' => $employer->id,
843 ], 846 ],
844 [ 847 [
845 'is_enabled' => $request->get('is_enabled') === 'true', 848 'is_enabled' => $request->get('is_enabled') === 'true',
846 'times_per_day' => $request->get('times_per_day'), 849 'times_per_day' => $request->get('times_per_day'),
847 'days_repeat' => $request->get('days_repeat'), 850 'days_repeat' => $request->get('days_repeat'),
848 'time_send_first' => $request->get('time_send_first'), 851 'time_send_first' => $request->get('time_send_first'),
849 'time_send_second' => $request->get('time_send_second'), 852 'time_send_second' => $request->get('time_send_second'),
850 'time_send_third' => $request->get('time_send_third'), 853 'time_send_third' => $request->get('time_send_third'),
851 'time_send_tg' => $request->get('time_send_tg'), 854 'time_send_tg' => $request->get('time_send_tg'),
852 ] 855 ]
853 ); 856 );
854 857
855 foreach ($request->get('vacancies') as $vacancy) { 858 foreach ($request->get('vacancies') as $vacancy) {
856 Ad_employer::query() 859 Ad_employer::query()
857 ->where('id', $vacancy['id']) 860 ->where('id', $vacancy['id'])
858 ->update([ 861 ->update([
859 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings 862 'autolift_site' => $vacancy['autolift_site'] === 'true', //they're arriving as strings
860 'autosend_tg' => $vacancy['autosend_tg'] === 'true', 863 'autosend_tg' => $vacancy['autosend_tg'] === 'true',
861 ]); 864 ]);
862 } 865 }
863 866
864 return response(['success' => true]); 867 return response(['success' => true]);
865 } 868 }
866 869
867 public function autoresponder() 870 public function autoresponder()
868 { 871 {
869 $user = Auth::user(); 872 $user = Auth::user();
870 return view('employers.autoresponder', compact('user')); 873 return view('employers.autoresponder', compact('user'));
871 } 874 }
872 875
873 public function autoresponderSave(Request $request): RedirectResponse 876 public function autoresponderSave(Request $request): RedirectResponse
874 { 877 {
875 $user = Auth::user(); 878 $user = Auth::user();
876 $user->autoresponder = $request->get('autoresponder', false) === 'on'; 879 $user->autoresponder = $request->get('autoresponder', false) === 'on';
877 $user->autoresponder_message = $request->get('autoresponder_message'); 880 $user->autoresponder_message = $request->get('autoresponder_message');
878 $user->save(); 881 $user->save();
879 882
880 return redirect(route('employer.autoresponder')); 883 return redirect(route('employer.autoresponder'));
881 } 884 }
882 } 885 }
883 886
app/Http/Controllers/HomeController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Models\Message; 5 use App\Models\Message;
6 use Illuminate\Http\Request; 6 use Illuminate\Http\Request;
7 7
8 class HomeController extends Controller 8 class HomeController extends Controller
9 { 9 {
10 /** 10 /**
11 * Create a new controller instance. 11 * Create a new controller instance.
12 * 12 *
13 * @return void 13 * @return void
14 */ 14 */
15 public function __construct() 15 public function __construct()
16 { 16 {
17 $this->middleware('auth'); 17 $this->middleware('auth');
18 } 18 }
19 19
20 /** 20 /**
21 * Show the application dashboard. 21 * Show the application dashboard.
22 * 22 *
23 * @return \Illuminate\Contracts\Support\Renderable 23 * @return \Illuminate\Contracts\Support\Renderable
24 */ 24 */
25 public function index() 25 public function index()
26 { 26 {
27 return view('home'); 27 return view('home');
28 } 28 }
29 public function ss(Request $request)
30 {
31 dd($request->all());
32
33 return view('home');
34 }
29 35
30 public function send_message(Request $request) 36 public function send_message(Request $request)
31 { 37 {
32 $user_id = Auth()->user()->id; 38 $user_id = Auth()->user()->id;
33 39
34 $message_params = [ 40 $message_params = [
35 'text' => $request->input('text'), 41 'text' => $request->input('text'),
36 'reply_message_id' => $request->input('reply_message_id', null), 42 'reply_message_id' => $request->input('reply_message_id', null),
37 ]; 43 ];
38 44
39 $new_message = Message::add_message( 45 $new_message = Message::add_message(
40 $request, 46 $request,
41 $user_id, 47 $user_id,
42 $request->input('to_user_id'), 48 $request->input('to_user_id'),
43 $message_params 49 $message_params
44 ); 50 );
45 51
46 $user_type = Auth()->user()->is_worker ? 'worker' : 'employer'; 52 $user_type = Auth()->user()->is_worker ? 'worker' : 'employer';
47 53
48 return response()->json([ 54 return response()->json([
49 'success' => true, 55 'success' => true,
50 'url_redirect' => route($user_type . '.dialog', ['chat' => $new_message->chat_id_from]) 56 'url_redirect' => route($user_type . '.dialog', ['chat' => $new_message->chat_id_from])
51 ]); 57 ]);
52 } 58 }
53 } 59 }
54 60
resources/views/employers/dialog.blade.php
1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(function(){ 5 $(function(){
6 var chatbox_div = $('.chatbox__list'); 6 var chatbox_div = $('.chatbox__list');
7 chatbox_div.scrollTop(chatbox_div.prop("scrollHeight")); 7 chatbox_div.scrollTop(chatbox_div.prop("scrollHeight"));
8 8
9 $('form.chatbox__bottom [name="file"]').on('change', function() { 9 $('form.chatbox__bottom [name="file"]').on('change', function() {
10 var fileName = $(this).val().split('\\').pop(); 10 var fileName = $(this).val().split('\\').pop();
11 $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName); 11 $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName);
12 }); 12 });
13 }); 13 });
14 14
15 $(document).on('change', '#send_btn', function() { 15 $(document).on('change', '#send_btn', function() {
16 var this_ = $(this); 16 var this_ = $(this);
17 var val_ = this_.val(); 17 var val_ = this_.val();
18 console.log('sort items '+val_); 18 console.log('sort items '+val_);
19 19
20 $.ajax({ 20 $.ajax({
21 type: "GET", 21 type: "GET",
22 url: "{{ route('shipping_companies') }}", 22 url: "{{ route('shipping_companies') }}",
23 data: "sort="+val_+"&block=1", 23 data: "sort="+val_+"&block=1",
24 success: function (data) { 24 success: function (data) {
25 console.log('Выбор сортировки'); 25 console.log('Выбор сортировки');
26 console.log(data); 26 console.log(data);
27 $('#block_1').html(data); 27 $('#block_1').html(data);
28 }, 28 },
29 headers: { 29 headers: {
30 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 30 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
31 }, 31 },
32 error: function (data) { 32 error: function (data) {
33 data = JSON.stringify(data); 33 data = JSON.stringify(data);
34 console.log('Error: ' + data); 34 console.log('Error: ' + data);
35 } 35 }
36 }); 36 });
37 37
38 $.ajax({ 38 $.ajax({
39 type: "GET", 39 type: "GET",
40 url: "{{ route('shipping_companies') }}", 40 url: "{{ route('shipping_companies') }}",
41 data: "sort="+val_+"&block=2", 41 data: "sort="+val_+"&block=2",
42 success: function (data) { 42 success: function (data) {
43 console.log('Выбор сортировки2'); 43 console.log('Выбор сортировки2');
44 console.log(data); 44 console.log(data);
45 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 45 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
46 $('#block_2').html(data); 46 $('#block_2').html(data);
47 }, 47 },
48 headers: { 48 headers: {
49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
50 }, 50 },
51 error: function (data) { 51 error: function (data) {
52 data = JSON.stringify(data); 52 data = JSON.stringify(data);
53 console.log('Error: ' + data); 53 console.log('Error: ' + data);
54 } 54 }
55 }); 55 });
56 }); 56 });
57 </script> 57 </script>
58 @endsection 58 @endsection
59 59
60 @section('content') 60 @section('content')
61 <section class="cabinet"> 61 <section class="cabinet">
62 <div class="container"> 62 <div class="container">
63 <ul class="breadcrumbs cabinet__breadcrumbs"> 63 <ul class="breadcrumbs cabinet__breadcrumbs">
64 <li><a href="{{ route('index') }}">Главная</a></li> 64 <li><a href="{{ route('index') }}">Главная</a></li>
65 <li><b>Личный кабинет</b></li> 65 <li><b>Личный кабинет</b></li>
66 </ul> 66 </ul>
67 <div class="cabinet__wrapper"> 67 <div class="cabinet__wrapper">
68 <div class="cabinet__side"> 68 <div class="cabinet__side">
69 <div class="cabinet__side-toper"> 69 <div class="cabinet__side-toper">
70 @include('employers.emblema') 70 @include('employers.emblema')
71 </div> 71 </div>
72 @include('employers.menu', ['item' => 5]) 72 @include('employers.menu', ['item' => 5])
73 </div> 73 </div>
74 <div class="cabinet__body"> 74 <div class="cabinet__body">
75 <div class="cabinet__body-item"> 75 <div class="cabinet__body-item">
76 <h2 class="title cabinet__title">Сообщения</h2> 76 <h2 class="title cabinet__title">Сообщения</h2>
77 </div> 77 </div>
78 <div class="cabinet__body-item"> 78 <div class="cabinet__body-item">
79 <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="back"> 79 <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="back">
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
82 </svg> 82 </svg>
83 <span> 83 <span>
84 К списку чатов 84 К списку чатов
85 </span> 85 </span>
86 </a> 86 </a>
87 <div class="chatbox"> 87 <div class="chatbox">
88 <div class="chatbox__toper"> 88 <div class="chatbox__toper">
89 @if($chat->is_admin_chat) 89 @if($chat->is_admin_chat)
90 <div class="chatbox__toper-info messages__item-info"> 90 <div class="chatbox__toper-info messages__item-info">
91 @include('svg.logo_icon') 91 @include('svg.logo_icon')
92 <div class="messages__item-text bold font20"> 92 <div class="messages__item-text bold font20">
93 Администратор сайта 93 Администратор сайта
94 </div> 94 </div>
95 </div> 95 </div>
96 @elseif ($companion->is_worker) 96 @elseif ($companion->is_worker)
97 <div class="chatbox__toper-info messages__item-info"> 97 <div class="chatbox__toper-info messages__item-info">
98 <div class="messages__item-photo"> 98 <div class="messages__item-photo">
99 <svg> 99 <svg>
100 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 100 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
101 </svg> 101 </svg>
102 @if ((isset($companion->workers[0]->photo)) && 102 @if ((isset($companion->workers[0]->photo)) &&
103 (!empty($companion->workers[0]->photo))) 103 (!empty($companion->workers[0]->photo)))
104 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> 104 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
105 @else 105 @else
106 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 106 <img src="{{ asset('images/default_man.jpg') }}" alt="">
107 @endif 107 @endif
108 </div> 108 </div>
109 <div class="messages__item-text"> 109 <div class="messages__item-text">
110 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> 110 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
111 </div> 111 </div>
112 </div> 112 </div>
113 @if (isset($companion->workers[0]->id)) 113 @if (isset($companion->workers[0]->id))
114 <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button"> 114 <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button">
115 <svg> 115 <svg>
116 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 116 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
117 </svg> 117 </svg>
118 Перейти в профиль 118 Перейти в профиль
119 </a> 119 </a>
120 @endif 120 @endif
121 @else 121 @else
122 <div class="chatbox__toper-info messages__item-info"> 122 <div class="chatbox__toper-info messages__item-info">
123 <div class="messages__item-photo"> 123 <div class="messages__item-photo">
124 <svg> 124 <svg>
125 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 125 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
126 </svg> 126 </svg>
127 @if ((isset($companion->employers[0]->logo)) && 127 @if ((isset($companion->employers[0]->logo)) &&
128 (!empty($companion->employers[0]->logo))) 128 (!empty($companion->employers[0]->logo)))
129 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> 129 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
130 @else 130 @else
131 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 131 <img src="{{ asset('images/default_man.jpg') }}" alt="">
132 @endif 132 @endif
133 </div> 133 </div>
134 <div class="messages__item-text"> 134 <div class="messages__item-text">
135 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> 135 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
136 <div><span>Статус:</span> Работодатель или Администратор</div> 136 <div><span>Статус:</span> Работодатель или Администратор</div>
137 </div> 137 </div>
138 </div> 138 </div>
139 @if (isset($companion->employer->id)) 139 @if (isset($companion->employer->id))
140 <a href="" class="button chatbox__toper-button"> 140 <a href="" class="button chatbox__toper-button">
141 <svg> 141 <svg>
142 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 142 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
143 </svg> 143 </svg>
144 Перейти в профиль 144 Перейти в профиль
145 </a> 145 </a>
146 @endif 146 @endif
147 @endif 147 @endif
148 </div> 148 </div>
149 149
150 @if ($errors->any()) 150 @if ($errors->any())
151 <div class="red bold"> 151 <div class="red bold">
152 <ul> 152 <ul>
153 @foreach ($errors->all() as $error) 153 @foreach ($errors->all() as $error)
154 <li>{{ $error }}</li> 154 <li>{{ $error }}</li>
155 @endforeach 155 @endforeach
156 </ul> 156 </ul>
157 </div> 157 </div>
158 @endif 158 @endif
159 159
160 <div class="chatbox__list" id="dialogs" name="dialogs"> 160 <div class="chatbox__list" id="dialogs" name="dialogs">
161 @if ($Messages->count()) 161 @if ($Messages->count())
162 @foreach ($Messages as $it) 162 @foreach ($Messages as $it)
163 @if ($it->user_id == $companion->id) 163 @if ($it->user_id == $companion->id)
164 <div class="chatbox__item"> 164 <div class="chatbox__item">
165 <div class="@if(!$companion->id != $superAdmin->id) chatbox__item-photo @endif "> 165 <div class="@if(!$companion->id != $superAdmin->id) chatbox__item-photo @endif ">
166 @if(!$companion->id == $superAdmin->id) 166 @if(!$companion->id == $superAdmin->id)
167 <svg> 167 <svg>
168 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 168 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
169 </svg> 169 </svg>
170 @endif 170 @endif
171 @if($companion->is_worker) 171 @if($companion->is_worker)
172 @if ((isset($companion->workers[0]->photo)) && 172 @if ((isset($companion->workers[0]->photo)) &&
173 (!empty($companion->workers[0]->photo))) 173 (!empty($companion->workers[0]->photo)))
174 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> 174 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
175 @else 175 @else
176 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 176 <img src="{{ asset('images/default_man.jpg') }}" alt="">
177 @endif 177 @endif
178 @elseif($companion->id == $superAdmin->id) 178 @elseif($companion->id == $superAdmin->id)
179 @include('svg.logo_icon') 179 @include('svg.logo_icon')
180 @else 180 @else
181 @if ((isset($companion->employers[0]->logo)) && 181 @if ((isset($companion->employers[0]->logo)) &&
182 (!empty($companion->employers[0]->logo))) 182 (!empty($companion->employers[0]->logo)))
183 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> 183 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
184 @else 184 @else
185 <div class="chatbox__item-photo "> 185 <div class="chatbox__item-photo ">
186 186
187 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 187 <img src="{{ asset('images/default_man.jpg') }}" alt="">
188 </div> 188 </div>
189 189
190 @endif 190 @endif
191 @endif 191 @endif
192 </div> 192 </div>
193 <div class="chatbox__item-body"> 193 <div class="chatbox__item-body">
194 <div class="chatbox__item-text">
195
196 <button class="button admin-chat-answer" data-fancybox data-src="#answer_to_admin_chat_modal"
197 data-to-user-id="{{ $it->user_id }}" data-message-id="{{ $it->id }}"
198 >
199 Ответить
200 </button>
201
194 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists()) 202 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists())
195 <div class="chatbox__item-text">
196 Отклик на вакансию {{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }} 203 Отклик на вакансию {{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}
197 @if($it->text) 204 @if($it->text)
198 Комментарий: {{ $it->text }} 205 Комментарий: {{ $it->text }}
199 @endif 206 @endif
200 </div>
201 @else 207 @else
202 @if($it->text) 208 @if($it->text)
203 <div class="chatbox__item-text">
204 {{ $it->text }} 209 {{ $it->text }}
205 </div>
206 @endif 210 @endif
211 </div>
212
207 @endif 213 @endif
208 @if ((isset($it->file)) && (!empty($it->file))) 214 @if ((isset($it->file)) && (!empty($it->file)))
209 <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> 215 <div class="chatbox__item-text chatbox__item-body-file-name-wrap">
210 <div class=""> 216 <div class="">
211 @if($it->original_file_name) 217 @if($it->original_file_name)
212 {{ $it->original_file_name }} 218 {{ $it->original_file_name }}
213 @else 219 @else
214 <svg> 220 <svg>
215 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 221 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
216 </svg> 222 </svg>
217 @endif 223 @endif
218 </div> 224 </div>
219 <a href="{{ asset(Storage::url($it->file)) }}" class=""> 225 <a href="{{ asset(Storage::url($it->file)) }}" class="">
220 Скачать 226 Скачать
221 </a> 227 </a>
222 </div> 228 </div>
223 @endif 229 @endif
224 </div> 230 </div>
225 <div class="chatbox__item-time">{{ $it->created_at }}</div> 231 <div class="chatbox__item-time">{{ $it->created_at }}</div>
226 </div> 232 </div>
227 @else 233 @else
228 <div class="chatbox__item chatbox__item_reverse"> 234 <div class="chatbox__item chatbox__item_reverse">
229 <div class="@if($sender->id!=$superAdmin->id) chatbox__item-photo @endif"> 235 <div class="@if($sender->id!=$superAdmin->id) chatbox__item-photo @endif">
230 @if ($sender->is_worker) 236 @if ($sender->is_worker)
231 @if ((isset($sender->workers[0]->photo)) && 237 @if ((isset($sender->workers[0]->photo)) &&
232 (!empty($sender->workers[0]->photo))) 238 (!empty($sender->workers[0]->photo)))
233 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> 239 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
234 @else 240 @else
235 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 241 <img src="{{ asset('images/default_man.jpg') }}" alt="">
236 @endif 242 @endif
237 @elseif($sender->id == $superAdmin->id) 243 @elseif($sender->id == $superAdmin->id)
238 @include('svg.logo_icon') 244 @include('svg.logo_icon')
239 @else 245 @else
240 <svg> 246 <svg>
241 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 247 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
242 </svg> 248 </svg>
243 249
244 @if ((isset($sender->employers[0]->logo)) && 250 @if ((isset($sender->employers[0]->logo)) &&
245 (!empty($sender->employers[0]->logo))) 251 (!empty($sender->employers[0]->logo)))
246 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> 252 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
247 @else 253 @else
248 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 254 <img src="{{ asset('images/default_man.jpg') }}" alt="">
249 @endif 255 @endif
250 @endif 256 @endif
251 </div> 257 </div>
252 <div class="chatbox__item-body"> 258 <div class="chatbox__item-body">
253 @if($chat->is_admin_chat || $it->text || $it->reply_message_id || $it->ad_employer_id > 0) 259 @if($chat->is_admin_chat || $it->text || $it->reply_message_id || $it->ad_employer_id > 0)
254 <div class="chatbox__item-text"> 260 <div class="chatbox__item-text">
255 261
256 @if($chat->is_admin_chat)
257 <button class="button admin-chat-answer" data-fancybox data-src="#answer_from_admin_chat_modal"
258 data-to-user-id="{{ $it->user_id }}" data-message-id="{{ $it->id }}"
259 >
260 Ответить
261 </button>
262 @endif
263
264 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists())) 262 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists()))
265 <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br> 263 <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br>
266 @if($it->text) 264 @if($it->text)
267 <b>Комментарий:</b> {{ $it->text }} 265 <b>Комментарий:</b> {{ $it->text }}
268 @endif 266 @endif
269 @else 267 @else
270 @if($it->text) 268 @if($it->text)
271 {{ $it->text }} 269 {{ $it->text }}
272 @endif 270 @endif
273 @endif 271 @endif
274 272
275 @if($it->reply_message_id) 273 @if($it->reply_message_id)
276 <div class="reply-message"> 274 <div class="reply-message">
277 {{ $it->reply_message->text }} 275 {{ $it->reply_message->text }}
278 </div> 276 </div>
279 @endif 277 @endif
280 </div> 278 </div>
281 @endif 279 @endif
282 @if ((isset($it->file)) && (!empty($it->file))) 280 @if ((isset($it->file)) && (!empty($it->file)))
283 <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> 281 <div class="chatbox__item-text chatbox__item-body-file-name-wrap">
284 <a href="{{ asset(Storage::url($it->file)) }}" class=""> 282 <a href="{{ asset(Storage::url($it->file)) }}" class="">
285 Скачать 283 Скачать
286 </a> 284 </a>
287 <div class=""> 285 <div class="">
288 @if($it->original_file_name) 286 @if($it->original_file_name)
289 {{ $it->original_file_name }} 287 {{ $it->original_file_name }}
290 @else 288 @else
291 <svg> 289 <svg>
292 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 290 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
293 </svg> 291 </svg>
294 @endif 292 @endif
295 </div> 293 </div>
296 </div> 294 </div>
297 @endif 295 @endif
298 </div> 296 </div>
299 <div class="chatbox__item-time">{{ $it->created_at }}</div> 297 <div class="chatbox__item-time">{{ $it->created_at }}</div>
300 </div> 298 </div>
301 @endif 299 @endif
302 300
303 @endforeach 301 @endforeach
304 @endif 302 @endif
305 </div> 303 </div>
306 <div> 304 <div>
307 <form action="{{ route('employer.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > 305 <form action="{{ route('employer.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" >
308 @csrf 306 @csrf
309 <label class="chatbox__bottom-file"> 307 <label class="chatbox__bottom-file">
310 <input id="file" name="file" type="file" accept=".pdf, .doc, .docx"> 308 <input id="file" name="file" type="file" accept=".pdf, .doc, .docx">
311 <svg> 309 <svg>
312 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 310 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
313 </svg> 311 </svg>
314 </label> 312 </label>
315 <input type="hidden" name="_token" value="{{ csrf_token() }}"/> 313 <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
316 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/> 314 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/>
317 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/> 315 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/>
318 <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/> 316 <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/>
319 <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/> 317 <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/>
320 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить"> 318 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить">
321 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send"> 319 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send">
322 <svg> 320 <svg>
323 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 321 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
324 </svg> 322 </svg>
325 </button> 323 </button>
326 </form> 324 </form>
327 <div class="chatbox-file-name-wrap mt-5 fw600"></div> 325 <div class="chatbox-file-name-wrap mt-5 fw600"></div>
resources/views/modals/chats/answer_from_admin_chat.blade.php
1 <div class="hide"> 1 <div class="hide">
2 <div id="answer_from_admin_chat_modal" class="modal-dialog"> 2 <div id="answer_from_admin_chat_modal" class="modal-dialog">
3 <div class="modal-dialog-title"> 3 <div class="modal-dialog-title">
4 <h2>Ответить работодателю</h2> 4 <h2>Ответить</h2>
5 </div> 5 </div>
6 <div class="modal-dialog-body"> 6 <div class="modal-dialog-body">
7 <textarea class="textarea" name="text" placeholder="" required></textarea> 7 <textarea class="textarea" name="text" placeholder="" required></textarea>
8 </div> 8 </div>
9 <div class="modal-dialog-footer"> 9 <div class="modal-dialog-footer">
10 <button type="button" class="button answer-from-admin-chat-button">Отправить</button> 10 <button type="button" class="button answer-from-admin-chat-button">Отправить</button>
11 <button type="button" class="button button_light" onclick="$.fancybox.close();">Закрыть</button> 11 <button type="button" class="button button_light" onclick="$.fancybox.close();">Закрыть</button>
12 </div> 12 </div>
13 </div> 13 </div>
14 </div> 14 </div>
15 15
16 <script> 16 <script>
17 $(function (){ 17 $(function (){
18 $('.answer-from-admin-chat-button').click(function(){ 18 $('.answer-from-admin-chat-button').click(function(){
19 spinStart($(this)); 19 spinStart($(this));
20 var wrap = $(this).closest('#answer_from_admin_chat_modal'); 20 var wrap = $(this).closest('#answer_from_admin_chat_modal');
21 var to_user_id = wrap.data('to-user-id'); 21 var to_user_id = wrap.data('to-user-id');
22 var reply_message_id = wrap.data('message-id'); 22 var reply_message_id = wrap.data('message-id');
23 var textarea = wrap.find('[name="text"]'); 23 var textarea = wrap.find('[name="text"]');
24 var text = textarea.val() 24 var text = textarea.val()
25 25
26 textarea.removeClass('border-red'); 26 textarea.removeClass('border-red');
27 if (!text.trim()){ 27 if (!text.trim()){
28 textarea.addClass('border-red'); 28 textarea.addClass('border-red');
29 return; 29 return;
30 } 30 }
31 31
32 $.ajax({ 32 $.ajax({
33 type: "POST", 33 type: "POST",
34 url: "{{ route('send_message') }}", 34 url: "{{ route('send_message') }}",
35 data: { 35 data: {
36 to_user_id: to_user_id, 36 to_user_id: to_user_id,
37 reply_message_id: reply_message_id, 37 reply_message_id: reply_message_id,
38 text: text 38 text: text
39 }, 39 },
40 dataType: 'json', 40 dataType: 'json',
41 headers: { 41 headers: {
42 'X-CSRF-TOKEN': $('[name="_token"]').val() 42 'X-CSRF-TOKEN': $('[name="_token"]').val()
43 }, 43 },
44 success: function(res){ 44 success: function(res){
45 if (res && res.success && res.url_redirect){ 45 if (res && res.success && res.url_redirect){
46 window.location.replace(res.url_redirect); 46 window.location.replace(res.url_redirect);
47 } else{ 47 } else{
48 location.reload(); 48 location.reload();
49 } 49 }
50 } 50 }
51 }); 51 });
52 }); 52 });
53 }); 53 });
54 </script> 54 </script>
55 55
resources/views/modals/chats/answer_to_admin_chat.blade.php
File was created 1 <div class="hide">
2 <div id="answer_to_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_to_admin_chat_modal">Отправить</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 $('.admin-chat-answer').on('click', function () {
19 var button = $(this);
20 var modal = $('#answer_to_admin_chat_modal');
21 modal.data('to-user-id', button.data('to-user-id'));
22 modal.data('message-id', button.data('message-id'));
23 });
24
25 $('.answer_to_admin_chat_modal').click(function(){
26 spinStart($(this));
27 var wrap = $(this).closest('#answer_to_admin_chat_modal');
28 console.log(wrap);
29 var to_user_id = wrap.data('to-user-id');
30 var reply_message_id = wrap.data('message-id');
31 var textarea = wrap.find('[name="text"]');
32 var text = textarea.val()
33 textarea.removeClass('border-red');
34 if (!text.trim()){
35 textarea.addClass('border-red');
36 return;
37 }
38
39 $.ajax({
40 type: "POST",
41 url: "{{ route('employer.send_message') }}",
42 data: {
43 to_user_id: to_user_id,
44 reply_message_id: reply_message_id,
45 text: text
46 },
47 dataType: 'json',
48 headers: {
49 'X-CSRF-TOKEN': $('[name="_token"]').val()
50 },
51 success: function(res){
52 if (res && res.success && res.url_redirect){
53 window.location.replace(res.url_redirect);
54 } else{
55 location.reload();
56 }
57 }
58 });
59 });
60 });
61 </script>
62
resources/views/workers/dialog.blade.php
1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(function(){ 5 $(function(){
6 var chatbox_div = $('.chatbox__list'); 6 var chatbox_div = $('.chatbox__list');
7 chatbox_div.scrollTop(chatbox_div.prop("scrollHeight")); 7 chatbox_div.scrollTop(chatbox_div.prop("scrollHeight"));
8 8
9 $('form.chatbox__bottom [name="file"]').on('change', function() { 9 $('form.chatbox__bottom [name="file"]').on('change', function() {
10 var fileName = $(this).val().split('\\').pop(); 10 var fileName = $(this).val().split('\\').pop();
11 $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName); 11 $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName);
12 }); 12 });
13 13
14 $('.admin-chat-answer').click(function(){ 14 $('.admin-chat-answer').click(function(){
15 var modal = $('#answer_from_admin_chat_modal'); 15 var modal = $('#answer_from_admin_chat_modal');
16 16
17 modal.data('to-user-id', $(this).data('to-user-id')); 17 modal.data('to-user-id', $(this).data('to-user-id'));
18 modal.data('message-id', $(this).data('message-id')); 18 modal.data('message-id', $(this).data('message-id'));
19 }); 19 });
20 }); 20 });
21 21
22 $(document).on('change', '#send_btn', function() { 22 $(document).on('change', '#send_btn', function() {
23 var this_ = $(this); 23 var this_ = $(this);
24 var val_ = this_.val(); 24 var val_ = this_.val();
25 console.log('sort items '+val_); 25 console.log('sort items '+val_);
26 26
27 $.ajax({ 27 $.ajax({
28 type: "GET", 28 type: "GET",
29 url: "{{ route('shipping_companies') }}", 29 url: "{{ route('shipping_companies') }}",
30 data: "sort="+val_+"&block=1", 30 data: "sort="+val_+"&block=1",
31 success: function (data) { 31 success: function (data) {
32 console.log('Выбор сортировки'); 32 console.log('Выбор сортировки');
33 console.log(data); 33 console.log(data);
34 $('#block_1').html(data); 34 $('#block_1').html(data);
35 }, 35 },
36 headers: { 36 headers: {
37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
38 }, 38 },
39 error: function (data) { 39 error: function (data) {
40 data = JSON.stringify(data); 40 data = JSON.stringify(data);
41 console.log('Error: ' + data); 41 console.log('Error: ' + data);
42 } 42 }
43 }); 43 });
44 44
45 $.ajax({ 45 $.ajax({
46 type: "GET", 46 type: "GET",
47 url: "{{ route('shipping_companies') }}", 47 url: "{{ route('shipping_companies') }}",
48 data: "sort="+val_+"&block=2", 48 data: "sort="+val_+"&block=2",
49 success: function (data) { 49 success: function (data) {
50 console.log('Выбор сортировки2'); 50 console.log('Выбор сортировки2');
51 console.log(data); 51 console.log(data);
52 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 52 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
53 $('#block_2').html(data); 53 $('#block_2').html(data);
54 }, 54 },
55 headers: { 55 headers: {
56 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 56 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
57 }, 57 },
58 error: function (data) { 58 error: function (data) {
59 data = JSON.stringify(data); 59 data = JSON.stringify(data);
60 console.log('Error: ' + data); 60 console.log('Error: ' + data);
61 } 61 }
62 }); 62 });
63 }); 63 });
64 </script> 64 </script>
65 @endsection 65 @endsection
66 66
67 @section('content') 67 @section('content')
68 <section class="cabinet"> 68 <section class="cabinet">
69 <div class="container"> 69 <div class="container">
70 <ul class="breadcrumbs cabinet__breadcrumbs"> 70 <ul class="breadcrumbs cabinet__breadcrumbs">
71 <li><a href="{{ route('index') }}">Главная</a></li> 71 <li><a href="{{ route('index') }}">Главная</a></li>
72 <li><b>Личный кабинет</b></li> 72 <li><b>Личный кабинет</b></li>
73 </ul> 73 </ul>
74 <div class="cabinet__wrapper"> 74 <div class="cabinet__wrapper">
75 <div class="cabinet__side"> 75 <div class="cabinet__side">
76 <div class="cabinet__side-toper"> 76 <div class="cabinet__side-toper">
77 @include('workers.emblema') 77 @include('workers.emblema')
78 </div> 78 </div>
79 @include('workers.menu', ['item' => 2]) 79 @include('workers.menu', ['item' => 2])
80 </div> 80 </div>
81 <div class="cabinet__body"> 81 <div class="cabinet__body">
82 <div class="cabinet__body-item"> 82 <div class="cabinet__body-item">
83 <h2 class="title cabinet__title">Сообщения</h2> 83 <h2 class="title cabinet__title">Сообщения</h2>
84 </div> 84 </div>
85 <div class="cabinet__body-item"> 85 <div class="cabinet__body-item">
86 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="back"> 86 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="back">
87 <svg> 87 <svg>
88 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 88 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
89 </svg> 89 </svg>
90 <span> 90 <span>
91 К списку чатов 91 К списку чатов
92 </span> 92 </span>
93 </a> 93 </a>
94 <div class="chatbox"> 94 <div class="chatbox">
95 <div class="chatbox__toper"> 95 <div class="chatbox__toper">
96 @if($chat->is_admin_chat) 96 @if($chat->is_admin_chat)
97 <div class="chatbox__toper-info messages__item-info"> 97 <div class="chatbox__toper-info messages__item-info">
98 @include('svg.logo_icon') 98 @include('svg.logo_icon')
99 <div class="messages__item-text bold font20"> 99 <div class="messages__item-text bold font20">
100 Администратор сайта 100 Администратор сайта
101 </div> 101 </div>
102 </div> 102 </div>
103 @elseif ($companion->is_worker) 103 @elseif ($companion->is_worker)
104 <div class="chatbox__toper-info messages__item-info"> 104 <div class="chatbox__toper-info messages__item-info">
105 <div class="messages__item-photo"> 105 <div class="messages__item-photo">
106 <svg> 106 <svg>
107 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 107 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
108 </svg> 108 </svg>
109 @if ((isset($companion->workers[0]->photo)) && 109 @if ((isset($companion->workers[0]->photo)) &&
110 (!empty($companion->workers[0]->photo))) 110 (!empty($companion->workers[0]->photo)))
111 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> 111 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
112 @else 112 @else
113 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 113 <img src="{{ asset('images/default_man.jpg') }}" alt="">
114 @endif 114 @endif
115 </div> 115 </div>
116 </div> 116 </div>
117 @if (isset($companion->workers[0]->id)) 117 @if (isset($companion->workers[0]->id))
118 <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button"> 118 <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button">
119 <svg> 119 <svg>
120 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 120 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
121 </svg> 121 </svg>
122 Перейти в профиль 122 Перейти в профиль
123 </a> 123 </a>
124 @endif 124 @endif
125 @else 125 @else
126 <div class="chatbox__toper-info messages__item-info"> 126 <div class="chatbox__toper-info messages__item-info">
127 <div class="messages__item-photo"> 127 <div class="messages__item-photo">
128 <svg> 128 <svg>
129 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 129 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
130 </svg> 130 </svg>
131 @if ((isset($companion->employers[0]->logo)) && 131 @if ((isset($companion->employers[0]->logo)) &&
132 (!empty($companion->employers[0]->logo))) 132 (!empty($companion->employers[0]->logo)))
133 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> 133 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
134 @else 134 @else
135 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 135 <img src="{{ asset('images/default_man.jpg') }}" alt="">
136 @endif 136 @endif
137 </div> 137 </div>
138 <div class="messages__item-text"> 138 <div class="messages__item-text">
139 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> 139 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
140 <div><span>Статус:</span> Работодатель или Администратор</div> 140 <div><span>Статус:</span> Работодатель или Администратор</div>
141 </div> 141 </div>
142 </div> 142 </div>
143 @if (isset($companion->employers[0]->id)) 143 @if (isset($companion->employers[0]->id))
144 <a href="{{ route('info_company', ['company' => $companion->employers[0]->id]) }}" class="button chatbox__toper-button"> 144 <a href="{{ route('info_company', ['company' => $companion->employers[0]->id]) }}" class="button chatbox__toper-button">
145 <svg> 145 <svg>
146 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 146 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
147 </svg> 147 </svg>
148 Перейти в профиль 148 Перейти в профиль
149 </a> 149 </a>
150 @endif 150 @endif
151 @endif 151 @endif
152 </div> 152 </div>
153 153
154 @if ($errors->any()) 154 @if ($errors->any())
155 <div class="red bold"> 155 <div class="red bold">
156 <ul> 156 <ul>
157 @foreach ($errors->all() as $error) 157 @foreach ($errors->all() as $error)
158 <li>{{ $error }}</li> 158 <li>{{ $error }}</li>
159 @endforeach 159 @endforeach
160 </ul> 160 </ul>
161 </div> 161 </div>
162 @endif 162 @endif
163 163
164 <div class="chatbox__list" id="dialogs" name="dialogs"> 164 <div class="chatbox__list" id="dialogs" name="dialogs">
165 @if ($Messages->count()) 165 @if ($Messages->count())
166 @foreach ($Messages as $it) 166 @foreach ($Messages as $it)
167 @if ($it->user_id == $companion->id) 167 @if ($it->user_id == $companion->id)
168 <div class="chatbox__item"> 168 <div class="chatbox__item">
169 <div class="@if(!$companion->id == $supeAdmin->id) chatbox__item-photo @endif"> 169 <div class="@if(!$companion->id == $supeAdmin->id) chatbox__item-photo @endif">
170 @if(!$companion->id == $supeAdmin->id) 170 @if(!$companion->id == $supeAdmin->id)
171 <svg> 171 <svg>
172 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 172 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
173 </svg> 173 </svg>
174 @endif 174 @endif
175 @if($companion->is_worker) 175 @if($companion->is_worker)
176 @if ((isset($companion->workers[0]->photo)) && 176 @if ((isset($companion->workers[0]->photo)) &&
177 (!empty($companion->workers[0]->photo))) 177 (!empty($companion->workers[0]->photo)))
178 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> 178 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
179 @else 179 @else
180 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 180 <img src="{{ asset('images/default_man.jpg') }}" alt="">
181 @endif 181 @endif
182 @elseif($companion->id == $supeAdmin->id) 182 @elseif($companion->id == $supeAdmin->id)
183 @include('svg.logo_icon') 183 @include('svg.logo_icon')
184 @else 184 @else
185 @if ((isset($companion->employers[0]->logo)) && 185 @if ((isset($companion->employers[0]->logo)) &&
186 (!empty($companion->employers[0]->logo))) 186 (!empty($companion->employers[0]->logo)))
187 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> 187 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
188 @else 188 @else
189 <div class="chatbox__item-photo "> 189 <div class="chatbox__item-photo ">
190 190
191 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 191 <img src="{{ asset('images/default_man.jpg') }}" alt="">
192 </div> 192 </div>
193 193
194 @endif 194 @endif
195 @endif 195 @endif
196 </div> 196 </div>
197 <div class="chatbox__item-body"> 197 <div class="chatbox__item-body">
198 <div class="chatbox__item-text">
199 @if($chat->is_admin_chat)
200 <button class="button admin-chat-answer" data-fancybox data-src="#answer_from_admin_chat_modal"
201 data-to-user-id="{{ $it->user_id }}" data-message-id="{{ $it->id }}"
202 >
203 Ответить
204 </button>
205 @endif
198 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists()) 206 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists())
199 <div class="chatbox__item-text"> 207
200 Отклик на вакансию {{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }} 208 Отклик на вакансию {{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}
201 @if($it->text) 209 @if($it->text)
202 Комментарий: {{ $it->text }} 210 Комментарий: {{ $it->text }}
203 @endif 211 @endif
204 </div> 212
205 @else 213 @else
206 @if($it->text) 214 @if($it->text)
207 <div class="chatbox__item-text">
208 {{ $it->text }} 215 {{ $it->text }}
209 </div> 216
210 @endif 217 @endif
211 @endif 218 @endif
219 </div>
220
212 @if ((isset($it->file)) && (!empty($it->file))) 221 @if ((isset($it->file)) && (!empty($it->file)))
213 <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> 222 <div class="chatbox__item-text chatbox__item-body-file-name-wrap">
214 <div class=""> 223 <div class="">
215 @if($it->original_file_name) 224 @if($it->original_file_name)
216 {{ $it->original_file_name }} 225 {{ $it->original_file_name }}
217 @else 226 @else
218 <svg> 227 <svg>
219 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 228 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
220 </svg> 229 </svg>
221 @endif 230 @endif
222 </div> 231 </div>
223 <a href="{{ asset(Storage::url($it->file)) }}" class=""> 232 <a href="{{ asset(Storage::url($it->file)) }}" class="">
224 Скачать 233 Скачать
225 </a> 234 </a>
226 </div> 235 </div>
227 @endif 236 @endif
228 </div> 237 </div>
229 <div class="chatbox__item-time">{{ $it->created_at }}</div> 238 <div class="chatbox__item-time">{{ $it->created_at }}</div>
230 </div> 239 </div>
231 @else 240 @else
232 <div class="chatbox__item chatbox__item_reverse"> 241 <div class="chatbox__item chatbox__item_reverse">
233 <div class="chatbox__item-photo "> 242 <div class="chatbox__item-photo ">
234 @include('svg.logo_icon') 243 @include('svg.logo_icon')
235 @if ($sender->is_worker) 244 @if ($sender->is_worker)
236 @if ((isset($sender->workers[0]->photo)) && 245 @if ((isset($sender->workers[0]->photo)) &&
237 (!empty($sender->workers[0]->photo))) 246 (!empty($sender->workers[0]->photo)))
238 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> 247 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
239 @else 248 @else
240 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 249 <img src="{{ asset('images/default_man.jpg') }}" alt="">
241 @endif 250 @endif
242 @elseif($sender->id == $supeAdmin->id) 251 @elseif($sender->id == $supeAdmin->id)
243 252
244 @include('svg.logo_icon') 253 @include('svg.logo_icon')
245 254
246 @else 255 @else
247 <svg> 256 <svg>
248 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 257 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
249 </svg> 258 </svg>
250 259
251 @if ((isset($sender->employers[0]->logo)) && 260 @if ((isset($sender->employers[0]->logo)) &&
252 (!empty($sender->employers[0]->logo))) 261 (!empty($sender->employers[0]->logo)))
253 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> 262 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
254 @else 263 @else
255 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 264 <img src="{{ asset('images/default_man.jpg') }}" alt="">
256 @endif 265 @endif
257 @endif 266 @endif
258 </div> 267 </div>
259 <div class="chatbox__item-body"> 268 <div class="chatbox__item-body">
260 @if($chat->is_admin_chat || $it->text || $it->reply_message_id || $it->ad_employer_id > 0) 269 @if($chat->is_admin_chat || $it->text || $it->reply_message_id || $it->ad_employer_id > 0)
261 <div class="chatbox__item-text"> 270 <div class="chatbox__item-text">
262 271
263 {{-- @if($chat->is_admin_chat)--}}
264 {{-- <button class="button admin-chat-answer" data-fancybox data-src="#answer_from_admin_chat_modal"--}}
265 {{-- data-to-user-id="{{ $it->user_id }}" data-message-id="{{ $it->id }}"--}}
266 {{-- >--}}
267 {{-- Ответить--}}
268 {{-- </button>--}}
269 {{-- @endif--}}
270
271 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists())) 272 @if(\App\Models\Ad_employer::where('id', $it->ad_employer_id)->exists()))
272 <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br> 273 <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br>
273 @if($it->text) 274 @if($it->text)
274 <b>Комментарий:</b> {{ $it->text }} 275 <b>Комментарий:</b> {{ $it->text }}
275 @endif 276 @endif
276 @else 277 @else
277 @if($it->text) 278 @if($it->text)
278 {{ $it->text }} 279 {{ $it->text }}
279 @endif 280 @endif
280 @endif 281 @endif
281 282
282 @if($it->reply_message_id) 283 @if($it->reply_message_id)
283 <div class="reply-message"> 284 <div class="reply-message">
284 {{ $it->reply_message->text }} 285 {{ $it->reply_message->text }}
285 </div> 286 </div>
286 @endif 287 @endif
287 </div> 288 </div>
288 @endif 289 @endif
289 @if ((isset($it->file)) && (!empty($it->file))) 290 @if ((isset($it->file)) && (!empty($it->file)))
290 <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> 291 <div class="chatbox__item-text chatbox__item-body-file-name-wrap">
291 <a href="{{ asset(Storage::url($it->file)) }}" class=""> 292 <a href="{{ asset(Storage::url($it->file)) }}" class="">
292 Скачать 293 Скачать
293 </a> 294 </a>
294 <div class=""> 295 <div class="">
295 @if($it->original_file_name) 296 @if($it->original_file_name)
296 {{ $it->original_file_name }} 297 {{ $it->original_file_name }}
297 @else 298 @else
298 <svg> 299 <svg>
299 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 300 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
300 </svg> 301 </svg>
301 @endif 302 @endif
302 </div> 303 </div>
303 </div> 304 </div>
304 @endif 305 @endif
305 </div> 306 </div>
306 <div class="chatbox__item-time">{{ $it->created_at }}</div> 307 <div class="chatbox__item-time">{{ $it->created_at }}</div>
307 </div> 308 </div>
308 @endif 309 @endif
309 310
310 @endforeach 311 @endforeach
311 @endif 312 @endif
312 </div> 313 </div>
313 314
314 <div> 315 <div>
315 <form action="{{ route('worker.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > 316 <form action="{{ route('worker.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" >
316 @csrf 317 @csrf
317 <label class="chatbox__bottom-file"> 318 <label class="chatbox__bottom-file">
318 <input id="file" name="file" type="file" accept=".pdf, .doc, .docx"> 319 <input id="file" name="file" type="file" accept=".pdf, .doc, .docx">
319 <svg> 320 <svg>
320 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 321 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
321 </svg> 322 </svg>
322 </label> 323 </label>
323 <input type="hidden" name="_token" value="{{ csrf_token() }}"/> 324 <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
324 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/> 325 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/>
325 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/> 326 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/>
326 <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/> 327 <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/>
327 <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/> 328 <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/>
328 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить"> 329 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить">
329 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send"> 330 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send">
330 <svg> 331 <svg>
331 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 332 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
332 </svg> 333 </svg>
333 </button> 334 </button>
334 </form> 335 </form>
335 <div class="chatbox-file-name-wrap mt-5 fw600"></div> 336 <div class="chatbox-file-name-wrap mt-5 fw600"></div>
336 </div> 337 </div>
337 </div> 338 </div>
338 </div> 339 </div>
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\Ad_jobsController; 3 use App\Http\Controllers\Ad_jobsController;
4 use App\Http\Controllers\AdEmployerController; 4 use App\Http\Controllers\AdEmployerController;
5 use App\Http\Controllers\Admin\AdminController; 5 use App\Http\Controllers\Admin\AdminController;
6 use App\Http\Controllers\Admin\CategoryController; 6 use App\Http\Controllers\Admin\CategoryController;
7 use App\Http\Controllers\Admin\CategoryEmpController; 7 use App\Http\Controllers\Admin\CategoryEmpController;
8 use App\Http\Controllers\Admin\EducationController; 8 use App\Http\Controllers\Admin\EducationController;
9 use App\Http\Controllers\EducationController as EducationFrontController; 9 use App\Http\Controllers\EducationController as EducationFrontController;
10 use App\Http\Controllers\Admin\EmployersController; 10 use App\Http\Controllers\Admin\EmployersController;
11 use App\Http\Controllers\EmployerController as FrontEmployersController; 11 use App\Http\Controllers\EmployerController as FrontEmployersController;
12 use App\Http\Controllers\Admin\InfoBloksController; 12 use App\Http\Controllers\Admin\InfoBloksController;
13 use App\Http\Controllers\Admin\JobTitlesController; 13 use App\Http\Controllers\Admin\JobTitlesController;
14 use App\Http\Controllers\Admin\UsersController; 14 use App\Http\Controllers\Admin\UsersController;
15 use App\Http\Controllers\Admin\WorkersController; 15 use App\Http\Controllers\Admin\WorkersController;
16 use App\Http\Controllers\Auth\ForgotPasswordController; 16 use App\Http\Controllers\Auth\ForgotPasswordController;
17 use App\Http\Controllers\Auth\LoginController; 17 use App\Http\Controllers\Auth\LoginController;
18 use App\Http\Controllers\Auth\RegisterController; 18 use App\Http\Controllers\Auth\RegisterController;
19 use App\Http\Controllers\CKEditorController; 19 use App\Http\Controllers\CKEditorController;
20 use App\Http\Controllers\FaqController; 20 use App\Http\Controllers\FaqController;
21 use App\Http\Controllers\MediaController; 21 use App\Http\Controllers\MediaController;
22 use App\Http\Controllers\WorkerController; 22 use App\Http\Controllers\WorkerController;
23 use App\Models\Ad_jobs; 23 use App\Models\Ad_jobs;
24 use App\Models\User; 24 use App\Models\User;
25 use App\Http\Controllers\MainController; 25 use App\Http\Controllers\MainController;
26 use App\Http\Controllers\HomeController; 26 use App\Http\Controllers\HomeController;
27 use Illuminate\Support\Facades\Route; 27 use Illuminate\Support\Facades\Route;
28 use App\Http\Controllers\Admin\CompanyController; 28 use App\Http\Controllers\Admin\CompanyController;
29 use App\Http\Controllers\Admin\Ad_EmployersController; 29 use App\Http\Controllers\Admin\Ad_EmployersController;
30 use App\Http\Controllers\Admin\MsgAnswersController; 30 use App\Http\Controllers\Admin\MsgAnswersController;
31 use App\Http\Controllers\Admin\GroupsController; 31 use App\Http\Controllers\Admin\GroupsController;
32 use App\Http\Controllers\PagesController; 32 use App\Http\Controllers\PagesController;
33 use Illuminate\Support\Facades\Storage; 33 use Illuminate\Support\Facades\Storage;
34 use App\Http\Controllers\EmployerController; 34 use App\Http\Controllers\EmployerController;
35 use App\Http\Controllers\CompanyController as FrontCompanyController; 35 use App\Http\Controllers\CompanyController as FrontCompanyController;
36 36
37 37
38 /* 38 /*
39 |-------------------------------------------------------------------------- 39 |--------------------------------------------------------------------------
40 | Web Routes 40 | Web Routes
41 |-------------------------------------------------------------------------- 41 |--------------------------------------------------------------------------
42 | 42 |
43 | Here is where you can register web routes for your application. These 43 | Here is where you can register web routes for your application. These
44 | routes are loaded by the RouteServiceProvider within a group which 44 | routes are loaded by the RouteServiceProvider within a group which
45 | contains the "web" middleware group. Now create something great! 45 | contains the "web" middleware group. Now create something great!
46 | 46 |
47 */ 47 */
48 /* 48 /*
49 Route::get('/', function () { 49 Route::get('/', function () {
50 return view('welcome'); 50 return view('welcome');
51 })->name('index'); 51 })->name('index');
52 */ 52 */
53 53
54 Route::get('/', [MainController::class, 'index'])->name('index'); 54 Route::get('/', [MainController::class, 'index'])->name('index');
55 55
56 //Роуты авторизации, регистрации, восстановления, аутентификации 56 //Роуты авторизации, регистрации, восстановления, аутентификации
57 Auth::routes(['verify' => true]); 57 Auth::routes(['verify' => true]);
58 58
59 //Личный кабинет пользователя 59 //Личный кабинет пользователя
60 Route::get('/home', [HomeController::class, 'index'])->name('home'); 60 Route::get('/home', [HomeController::class, 'index'])->name('home');
61 61
62 // Авторизация, регистрация в админку 62 // Авторизация, регистрация в админку
63 Route::group([ 63 Route::group([
64 'as' => 'admin.', // имя маршрута, например auth.index 64 'as' => 'admin.', // имя маршрута, например auth.index
65 'prefix' => 'admin', // префикс маршрута, например auth/index 65 'prefix' => 'admin', // префикс маршрута, например auth/index
66 'middleware' => ['guest'], 66 'middleware' => ['guest'],
67 ], function () { 67 ], function () {
68 // Форма регистрации 68 // Форма регистрации
69 Route::get('register', [AdminController::class, 'register'])->name('register'); 69 Route::get('register', [AdminController::class, 'register'])->name('register');
70 // Создание пользователя 70 // Создание пользователя
71 Route::post('register', [AdminController::class, 'create'])->name('create'); 71 Route::post('register', [AdminController::class, 'create'])->name('create');
72 72
73 //Форма входа 73 //Форма входа
74 Route::get('login', [AdminController::class, 'login'])->name('login'); 74 Route::get('login', [AdminController::class, 'login'])->name('login');
75 75
76 // аутентификация 76 // аутентификация
77 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 77 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
78 78
79 }); 79 });
80 80
81 // Личный кабинет админки 81 // Личный кабинет админки
82 Route::group([ 82 Route::group([
83 'as' => 'admin.', // имя маршрута, например auth.index 83 'as' => 'admin.', // имя маршрута, например auth.index
84 'prefix' => 'admin', // префикс маршрута, например auth/index 84 'prefix' => 'admin', // префикс маршрута, например auth/index
85 'middleware' => ['auth', 'admin'], 85 'middleware' => ['auth', 'admin'],
86 ], function() { 86 ], function() {
87 87
88 // выход 88 // выход
89 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 89 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
90 90
91 // кабинет главная страница 91 // кабинет главная страница
92 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 92 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
93 Route::get('/', function () { 93 Route::get('/', function () {
94 return redirect()->route('admin.index'); 94 return redirect()->route('admin.index');
95 }); 95 });
96 96
97 // кабинет профиль админа - форма 97 // кабинет профиль админа - форма
98 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 98 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
99 // кабинет профиль админа - сохранение формы 99 // кабинет профиль админа - сохранение формы
100 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 100 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
101 101
102 //кабинет сообщения админа 102 //кабинет сообщения админа
103 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 103 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
104 104
105 105
106 // кабинет профиль - форма пароли 106 // кабинет профиль - форма пароли
107 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 107 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
108 // кабинет профиль - сохранение формы пароля 108 // кабинет профиль - сохранение формы пароля
109 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 109 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
110 110
111 111
112 // кабинет профиль пользователя - форма 112 // кабинет профиль пользователя - форма
113 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 113 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
114 // кабинет профиль пользователя - сохранение формы 114 // кабинет профиль пользователя - сохранение формы
115 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 115 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
116 116
117 // кабинет профиль работодатель - форма 117 // кабинет профиль работодатель - форма
118 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 118 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
119 // кабинет профиль работодатель - сохранение формы 119 // кабинет профиль работодатель - сохранение формы
120 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 120 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
121 // кабинет удаление профиль работодателя и юзера 121 // кабинет удаление профиль работодателя и юзера
122 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 122 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
123 123
124 // кабинет профиль работник - форма 124 // кабинет профиль работник - форма
125 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 125 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
126 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 126 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
127 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 127 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
128 // кабинет профиль работник - сохранение формы 128 // кабинет профиль работник - сохранение формы
129 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 129 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
130 130
131 // Медиа 131 // Медиа
132 Route::get('media', [MediaController::class, 'index'])->name('media'); 132 Route::get('media', [MediaController::class, 'index'])->name('media');
133 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 133 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
134 134
135 // кабинет настройки сайта - форма 135 // кабинет настройки сайта - форма
136 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 136 Route::get('config', [AdminController::class, 'config_form'])->name('config');
137 // кабинет настройки сайта сохранение формы 137 // кабинет настройки сайта сохранение формы
138 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 138 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
139 139
140 // кабинет - новости 140 // кабинет - новости
141 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); 141 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin');
142 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); 142 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add');
143 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); 143 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add');
144 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); 144 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit');
145 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); 145 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update');
146 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); 146 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete');
147 147
148 // кабинет - пользователи 148 // кабинет - пользователи
149 Route::get('users', [UsersController::class, 'index'])->name('users'); 149 Route::get('users', [UsersController::class, 'index'])->name('users');
150 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete'); 150 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete');
151 151
152 // кабинет - пользователи 152 // кабинет - пользователи
153 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 153 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
154 154
155 // кабинет - работодатели 155 // кабинет - работодатели
156 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 156 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
157 157
158 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 158 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
159 159
160 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 160 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
161 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 161 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
162 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 162 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
163 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 163 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
164 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 164 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
165 165
166 // кабинет - соискатели 166 // кабинет - соискатели
167 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 167 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
168 168
169 // кабинет - база данных 169 // кабинет - база данных
170 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 170 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
171 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 171 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
172 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 172 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
173 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 173 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
174 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 174 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
175 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 175 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
176 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 176 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
177 177
178 // кабинет - вакансии 178 // кабинет - вакансии
179 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 179 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
180 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 180 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
181 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 181 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
182 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 182 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
183 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 183 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
184 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 184 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
185 185
186 // Редактирование должности в вакансии 186 // Редактирование должности в вакансии
187 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 187 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
188 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 188 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
189 189
190 190
191 // кабинет - категории 191 // кабинет - категории
192 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 192 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
193 193
194 // СRUD-операции над Справочником Категории 194 // СRUD-операции над Справочником Категории
195 195
196 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 196 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
197 197
198 // CRUD-операции над справочником Категории для работодателей 198 // CRUD-операции над справочником Категории для работодателей
199 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 199 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
200 200
201 // CRUD-операции над справочником Образование 201 // CRUD-операции над справочником Образование
202 Route::resource('education', EducationController::class, ['except' => ['show']]); 202 Route::resource('education', EducationController::class, ['except' => ['show']]);
203 203
204 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 204 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
205 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 205 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
206 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 206 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
207 207
208 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 208 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
209 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 209 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
210 210
211 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 211 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
212 212
213 /* 213 /*
214 * кабинет - CRUD-операции по справочнику должности 214 * кабинет - CRUD-операции по справочнику должности
215 * 215 *
216 */ 216 */
217 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 217 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
218 218
219 // кабинет - сообщения (чтение чужих) 219 // кабинет - сообщения (чтение чужих)
220 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 220 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
221 // кабинет - просмотр сообщения чужого (чтение) 221 // кабинет - просмотр сообщения чужого (чтение)
222 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 222 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
223 223
224 // кабинет - сообщения (админские) 224 // кабинет - сообщения (админские)
225 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 225 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
226 // кабинет - сообщения (админские) 226 // кабинет - сообщения (админские)
227 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 227 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
228 // кабинет - sql - конструкция запросов 228 // кабинет - sql - конструкция запросов
229 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 229 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
230 230
231 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message'); 231 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message');
232 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message'); 232 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message');
233 233
234 /* 234 /*
235 * Расписанный подход в описании каждой директорий групп пользователей. 235 * Расписанный подход в описании каждой директорий групп пользователей.
236 */ 236 */
237 // кабинет - группы пользователей 237 // кабинет - группы пользователей
238 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 238 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
239 // кабинет - добавление форма группы пользователей 239 // кабинет - добавление форма группы пользователей
240 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 240 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
241 // кабинет - сохранение формы группы пользователей 241 // кабинет - сохранение формы группы пользователей
242 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 242 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
243 // кабинет - редактирование форма группы пользователей 243 // кабинет - редактирование форма группы пользователей
244 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 244 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
245 // кабинет - сохранение редактированной формы группы пользователей 245 // кабинет - сохранение редактированной формы группы пользователей
246 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 246 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
247 // кабинет - удаление группы пользователей 247 // кабинет - удаление группы пользователей
248 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 248 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
249 249
250 250
251 // кабинет - список админов 251 // кабинет - список админов
252 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 252 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
253 253
254 // справочник Позиции 254 // справочник Позиции
255 Route::get('positions', [AdminController::class, 'position'])->name('position'); 255 Route::get('positions', [AdminController::class, 'position'])->name('position');
256 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); 256 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position');
257 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); 257 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position');
258 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); 258 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position');
259 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); 259 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position');
260 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); 260 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position');
261 261
262 /////редактор////// кабинет - редактор сайта//////////////////////// 262 /////редактор////// кабинет - редактор сайта////////////////////////
263 Route::get('editor-site', function() { 263 Route::get('editor-site', function() {
264 return view('admin.editor.index'); 264 return view('admin.editor.index');
265 })->name('editor-site'); 265 })->name('editor-site');
266 266
267 267
268 // кабинет - редактор шапки-футера сайта 268 // кабинет - редактор шапки-футера сайта
269 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 269 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
270 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 270 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
271 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 271 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
272 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 272 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
273 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 273 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
274 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 274 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
275 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 275 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
276 276
277 277
278 // кабинет - редактор должности на главной 278 // кабинет - редактор должности на главной
279 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 279 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
280 280
281 // кабинет - счетчики на главной 281 // кабинет - счетчики на главной
282 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main'); 282 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main');
283 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update'); 283 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update');
284 284
285 // кабинет - редактор работодатели на главной 285 // кабинет - редактор работодатели на главной
286 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 286 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
287 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add'); 287 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add');
288 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove'); 288 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove');
289 289
290 290
291 // кабинет - редактор seo-сайта 291 // кабинет - редактор seo-сайта
292 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 292 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
293 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 293 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
294 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 294 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
295 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 295 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
296 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 296 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
297 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 297 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
298 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 298 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
299 299
300 300
301 // кабинет - редактор страниц 301 // кабинет - редактор страниц
302 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 302 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
303 // кабинет - добавление страницы 303 // кабинет - добавление страницы
304 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 304 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
305 // кабинет - сохранение формы страницы 305 // кабинет - сохранение формы страницы
306 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 306 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
307 // кабинет - редактирование форма страницы 307 // кабинет - редактирование форма страницы
308 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 308 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
309 // кабинет - сохранение редактированной формы страницы 309 // кабинет - сохранение редактированной формы страницы
310 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 310 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
311 // кабинет - удаление страницы 311 // кабинет - удаление страницы
312 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 312 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
313 313
314 314
315 // кабинет - реклама сайта 315 // кабинет - реклама сайта
316 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 316 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
317 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 317 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
318 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 318 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
319 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 319 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
320 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 320 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
321 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 321 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
322 //////////////////////////////////////////////////////////////////////// 322 ////////////////////////////////////////////////////////////////////////
323 323
324 324
325 // кабинет - отзывы о работодателе для модерации 325 // кабинет - отзывы о работодателе для модерации
326 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 326 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
327 327
328 // Общая страница статистики 328 // Общая страница статистики
329 Route::get('statics', function () { 329 Route::get('statics', function () {
330 return view('admin.static.index'); 330 return view('admin.static.index');
331 })->name('statics'); 331 })->name('statics');
332 332
333 // кабинет - статистика работников 333 // кабинет - статистика работников
334 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 334 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
335 335
336 // кабинет - статистика вакансий работодателя 336 // кабинет - статистика вакансий работодателя
337 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 337 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
338 338
339 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 339 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
340 /* 340 /*
341 * CRUD-операции над справочником дипломы и документы 341 * CRUD-операции над справочником дипломы и документы
342 */ 342 */
343 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 343 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
344 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 344 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
345 345
346 // кабинет - роли пользователя 346 // кабинет - роли пользователя
347 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 347 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
348 348
349 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 349 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
350 350
351 Route::get('logs', function() { 351 Route::get('logs', function() {
352 $files = Storage::files('logs/laravel.log'); 352 $files = Storage::files('logs/laravel.log');
353 })->name('logs'); 353 })->name('logs');
354 354
355 Route::prefix('faq')->as('faq.')->group(function () { 355 Route::prefix('faq')->as('faq.')->group(function () {
356 Route::middleware('admin')->group(function () { 356 Route::middleware('admin')->group(function () {
357 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list'); 357 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list');
358 Route::get('/create', [FaqController::class, 'create'])->name('create'); 358 Route::get('/create', [FaqController::class, 'create'])->name('create');
359 Route::post('/create', [FaqController::class, 'store'])->name('store'); 359 Route::post('/create', [FaqController::class, 'store'])->name('store');
360 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit'); 360 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit');
361 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update'); 361 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update');
362 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy'); 362 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy');
363 }); 363 });
364 }); 364 });
365 }); 365 });
366 366
367 // Инструментальные страницы 367 // Инструментальные страницы
368 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 368 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
369 369
370 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 370 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
371 371
372 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 372 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
373 373
374 // Страницы с произвольным контентом 374 // Страницы с произвольным контентом
375 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 375 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
376 376
377 // Форма обратной связи 377 // Форма обратной связи
378 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); 378 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback');
379 379
380 // Публичные страницы соискателя 380 // Публичные страницы соискателя
381 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 381 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
382 382
383 //Страница вакансии 383 //Страница вакансии
384 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 384 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
385 385
386 //Вакансии 386 //Вакансии
387 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 387 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
388 388
389 //Вакансии поиск на главной 389 //Вакансии поиск на главной
390 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 390 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
391 391
392 //Вакансии категория детальная 392 //Вакансии категория детальная
393 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 393 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
394 394
395 // Лайк вакансии 395 // Лайк вакансии
396 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); 396 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
397 397
398 //Детальная страница вакансии - работодателя 398 //Детальная страница вакансии - работодателя
399 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 399 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
400 400
401 Route::get('vacancy/{vacancy}', [AdEmployerController::class, 'getById'])->name('get-vacancy-by-id'); 401 Route::get('vacancy/{vacancy}', [AdEmployerController::class, 'getById'])->name('get-vacancy-by-id');
402 402
403 //Судоходные компании 403 //Судоходные компании
404 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 404 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
405 405
406 //Детальная инфа о компании 406 //Детальная инфа о компании
407 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 407 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
408 408
409 //Образование 409 //Образование
410 Route::get('education', [EducationFrontController::class, 'index'])->name('education'); 410 Route::get('education', [EducationFrontController::class, 'index'])->name('education');
411 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');; 411 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');;
412 412
413 //Новости 413 //Новости
414 Route::get('news', [MainController::class, 'news'])->name('news'); 414 Route::get('news', [MainController::class, 'news'])->name('news');
415 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 415 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
416 416
417 //Контакты 417 //Контакты
418 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 418 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
419 419
420 //База резюме 420 //База резюме
421 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 421 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
422 Route::get('bd_resume_danger', function(){ 422 Route::get('bd_resume_danger', function(){
423 return view('employers.bd_resume_danger'); 423 return view('employers.bd_resume_danger');
424 })->name('bd_resume_danger'); 424 })->name('bd_resume_danger');
425 425
426 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 426 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
427 427
428 //Анкета соискателя 428 //Анкета соискателя
429 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 429 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
430 430
431 //Скачать резюме 431 //Скачать резюме
432 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 432 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
433 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); 433 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2');
434 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); 434 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
435 435
436 436
437 //Вход в кабинет 437 //Вход в кабинет
438 Route::get('login', [MainController::class, 'input_login'])->name('login'); 438 Route::get('login', [MainController::class, 'input_login'])->name('login');
439 439
440 // Выход из кабинета 440 // Выход из кабинета
441 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 441 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
442 442
443 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 443 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
444 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 444 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
445 445
446 //восстановление пароля 446 //восстановление пароля
447 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 447 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
448 // Звезда сообщения 448 // Звезда сообщения
449 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 449 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
450 450
451 // Борьба 451 // Борьба
452 Route::get('clear_cookie', function() { 452 Route::get('clear_cookie', function() {
453 \App\Classes\Cookies_vacancy::clear_vacancy(); 453 \App\Classes\Cookies_vacancy::clear_vacancy();
454 return redirect()->route('index'); 454 return redirect()->route('index');
455 })->name('clear_cookie'); 455 })->name('clear_cookie');
456 456
457 Route::get('cookies', function() { 457 Route::get('cookies', function() {
458 return view('cookies'); 458 return view('cookies');
459 })->name('cookies'); 459 })->name('cookies');
460 460
461 // Личный кабинет работник 461 // Личный кабинет работник
462 Route::group([ 462 Route::group([
463 'as' => 'worker.', // имя маршрута, например auth.index 463 'as' => 'worker.', // имя маршрута, например auth.index
464 'prefix' => 'worker', // префикс маршрута, например auth/index 464 'prefix' => 'worker', // префикс маршрута, например auth/index
465 'middleware' => ['auth', 'is_worker'], 465 'middleware' => ['auth', 'is_worker'],
466 ], function() { 466 ], function() {
467 // Формы редактирования 467 // Формы редактирования
468 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information'); 468 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information');
469 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents'); 469 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents');
470 470
471 // 1 страница - Моя анкета 471 // 1 страница - Моя анкета
472 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 472 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
473 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 473 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
474 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto'); 474 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto');
475 475
476 Route::get('cabinet/subscribe', [WorkerController::class, 'subscribe'])->name('subscribe'); 476 Route::get('cabinet/subscribe', [WorkerController::class, 'subscribe'])->name('subscribe');
477 Route::post('cabinet/subscribe/save', [WorkerController::class, 'save_subscribe'])->name('save_subscribe'); 477 Route::post('cabinet/subscribe/save', [WorkerController::class, 'save_subscribe'])->name('save_subscribe');
478 478
479 479
480 // 2 страница - Сообщения 480 // 2 страница - Сообщения
481 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 481 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
482 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog'); 482 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog');
483 // 3 страница - Избранные вакансии 483 // 3 страница - Избранные вакансии
484 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 484 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
485 // Продолжение борьбы против колорадов - избранные вакансии 485 // Продолжение борьбы против колорадов - избранные вакансии
486 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 486 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
487 487
488 // 4 страница - Сменить пароль 488 // 4 страница - Сменить пароль
489 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 489 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
490 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 490 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
491 491
492 // 5 страница - Удалить профиль 492 // 5 страница - Удалить профиль
493 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 493 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
494 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 494 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
495 495
496 // Резюме -pdf 496 // Резюме -pdf
497 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 497 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
498 498
499 // Поднятие анкеты 499 // Поднятие анкеты
500 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 500 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
501 501
502 Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); 502 Route::post('test123', [WorkerController::class, 'test123'])->name('test123');
503 503
504 // Добавление сертификата 504 // Добавление сертификата
505 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 505 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
506 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 506 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
507 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); 507 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate');
508 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); 508 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate');
509 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 509 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
510 510
511 // Добавление предыдущих контактов компании 511 // Добавление предыдущих контактов компании
512 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 512 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company');
513 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); 513 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company');
514 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); 514 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company');
515 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); 515 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
516 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 516 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
517 517
518 // Добавление документа-диплома 518 // Добавление документа-диплома
519 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 519 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
520 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 520 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
521 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms'); 521 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms');
522 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 522 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
523 523
524 // Добавление стандартного диплома 524 // Добавление стандартного диплома
525 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 525 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
526 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 526 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
527 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 527 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
528 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 528 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
529 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 529 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
530 530
531 // Отправка сообщения работодателю от соискателя 531 // Отправка сообщения работодателю от соискателя
532 Route::post('сообщение/', [WorkerController::class, 'new_message']) 532 Route::post('сообщение/', [WorkerController::class, 'new_message'])
533 ->withoutMiddleware('is_worker') 533 ->withoutMiddleware('is_worker')
534 ->name('new_message'); 534 ->name('new_message');
535 535
536 Route::get('cabinet/autoresponder', [WorkerController::class, 'autoresponder'])->name('autoresponder'); 536 Route::get('cabinet/autoresponder', [WorkerController::class, 'autoresponder'])->name('autoresponder');
537 Route::get('cabinet/autoresponder_save', [WorkerController::class, 'autoresponderSave'])->name('autoresponder_save'); 537 Route::get('cabinet/autoresponder_save', [WorkerController::class, 'autoresponderSave'])->name('autoresponder_save');
538 538
539 Route::get('cabinet/autolift', [WorkerController::class, 'resumeAutoLiftForm'])->name('autolift'); 539 Route::get('cabinet/autolift', [WorkerController::class, 'resumeAutoLiftForm'])->name('autolift');
540 Route::post('cabinet/autolift/save', [WorkerController::class, 'resumeAutoLiftSave'])->name('autolift_save'); 540 Route::post('cabinet/autolift/save', [WorkerController::class, 'resumeAutoLiftSave'])->name('autolift_save');
541 }); 541 });
542 Route::post('/admin/chat/response', [WorkerController::class, 'adminChatResponse'])->name('admin.chat.response'); 542 Route::post('/admin/chat/response', [WorkerController::class, 'adminChatResponse'])->name('admin.chat.response');
543 543
544 // Личный кабинет работодателя 544 // Личный кабинет работодателя
545 Route::group([ 545 Route::group([
546 'as' => 'employer.', // имя маршрута, например auth.index 546 'as' => 'employer.', // имя маршрута, например auth.index
547 'prefix' => 'employer', // префикс маршрута, например auth/index 547 'prefix' => 'employer', // префикс маршрута, например auth/index
548 'middleware' => ['auth', 'is_employer'], 548 'middleware' => ['auth', 'is_employer'],
549 ], function() { 549 ], function() {
550 // 0 страница - Личные данные работодателя 550 // 0 страница - Личные данные работодателя
551 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 551 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
552 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 552 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
553 553
554 // 1 страница - Профиль 554 // 1 страница - Профиль
555 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 555 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
556 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 556 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
557 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 557 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
558 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 558 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
559 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); 559 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot');
560 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); 560 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save');
561 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 561 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
562 562
563 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial']) 563 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial'])
564 ->name('send-vacancy-to-social'); 564 ->name('send-vacancy-to-social');
565 565
566 // 2 страница - Добавление вакансий 566 // 2 страница - Добавление вакансий
567 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 567 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
568 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 568 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
569 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 569 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
570 570
571 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); 571 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger');
572 572
573 573
574 574
575 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 575 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
576 576
577 // 3 страница - Мои вакансии 577 // 3 страница - Мои вакансии
578 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 578 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
579 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 579 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
580 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 580 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
581 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 581 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
582 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 582 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
583 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 583 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
584 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 584 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
585 585
586 // 4.1Ю. 586 // 4.1Ю.
587 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 587 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
588 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 588 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
589 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 589 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
590 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 590 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
591 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 591 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
592 592
593 // 4 страница - Отклики на вакансии 593 // 4 страница - Отклики на вакансии
594 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 594 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
595 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 595 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
596 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 596 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
597 597
598 // 5 страница - Сообщения 598 // 5 страница - Сообщения
599 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 599 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
600 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog'); 600 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog');
601 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 601 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
602 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 602 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
603 603
604 // 6 страница - Избранный 604 // 6 страница - Избранный
605 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 605 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
606 606
607 Route::get('cabinet/autolift', [EmployerController::class, 'vacancyAutoLiftForm'])->name('autolift'); 607 Route::get('cabinet/autolift', [EmployerController::class, 'vacancyAutoLiftForm'])->name('autolift');
608 Route::post('cabinet/autolift/save', [EmployerController::class, 'vacancyAutoLiftSave'])->name('autolift_save'); 608 Route::post('cabinet/autolift/save', [EmployerController::class, 'vacancyAutoLiftSave'])->name('autolift_save');
609 609
610 //7 страница - База данных 610 //7 страница - База данных
611 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 611 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
612 612
613 //8 страница - База резюме 613 //8 страница - База резюме
614 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 614 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
615 615
616 // 9 рассылка сообщений 616 // 9 рассылка сообщений
617 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 617 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
618 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 618 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
619 619
620 // 10 страница FAQ вопрос 620 // 10 страница FAQ вопрос
621 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq'); 621 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq');
622 622
623 Route::get('cabinet/autoresponder', [EmployerController::class, 'autoresponder'])->name('autoresponder'); 623 Route::get('cabinet/autoresponder', [EmployerController::class, 'autoresponder'])->name('autoresponder');
624 Route::get('cabinet/autoresponder_save', [EmployerController::class, 'autoresponderSave'])->name('autoresponder_save'); 624 Route::get('cabinet/autoresponder_save', [EmployerController::class, 'autoresponderSave'])->name('autoresponder_save');
625 625
626 // 11 страница - Настройка уведомлений 626 // 11 страница - Настройка уведомлений
627 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 627 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
628 Route::post('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 628 Route::post('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
629 629
630 // 12 страница - Сменить пароль 630 // 12 страница - Сменить пароль
631 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 631 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
632 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 632 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
633 633
634 // 13 страница - Удаление профиля 634 // 13 страница - Удаление профиля
635 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 635 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
636 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 636 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
637 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 637 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
638 638
639 // Отправил сообщение 639 // Отправил сообщение
640 Route::post('сообщение/', [EmployerController::class, 'new_message']) 640 Route::post('сообщение/', [EmployerController::class, 'new_message'])
641 ->withoutMiddleware('is_employer') 641 ->withoutMiddleware('is_employer')
642 ->name('new_message'); 642 ->name('new_message');
643 643
644 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat'); 644 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat');
645 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat'); 645 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat');
646 }); 646 });
647 647
648 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 648 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
649 649
650 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message'); 650 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message');
651 Route::post('send_message/ss', [HomeController::class, 'ss'])->name('ss');
651 652
652 653