Commit a30fa93a81cfeea0ddc99b3fad8de32af79049a0

Authored by Андрей Ларионов
Exists in master

Коммит от субботы

Showing 13 changed files Side-by-side Diff

app/Http/Controllers/Admin/InfoBloksController.php
... ... @@ -15,7 +15,9 @@ class InfoBloksController extends Controller
15 15 */
16 16 public function index()
17 17 {
18   - $infobloks = infobloks::query()->active()->orderByDesc('sort')->orderBy('name')->paginate(15);
  18 + $infobloks = infobloks::query()->
  19 + //active()->
  20 + orderByDesc('sort')->orderBy('name')->paginate(15);
19 21 return view('admin.infobloks.index', compact('infobloks'));
20 22 }
21 23  
... ... @@ -84,7 +86,7 @@ class InfoBloksController extends Controller
84 86 */
85 87 public function destroy(infobloks $infoblok)
86 88 {
87   - $infoblok->update(['is_remove' => 1]);
  89 + $infoblok->delete(); // update(['is_remove' => 1]);
88 90 return redirect()->route('admin.infobloks.index');
89 91 }
90 92 }
app/Http/Controllers/Admin/UsersController.php
... ... @@ -45,6 +45,12 @@ class UsersController extends Controller
45 45 }
46 46 }
47 47  
  48 + public function user_delete(User $user) {
  49 + $id = $user->delete();
  50 +
  51 + return redirect()->route('admin.users')->with('Пользователь был удален из системы');
  52 + }
  53 +
48 54 public function index_bd(Request $request) {
49 55 $title = 'Админка - Пользователи базы данных';
50 56  
app/Http/Controllers/CompanyController.php
... ... @@ -2,6 +2,7 @@
2 2  
3 3 namespace App\Http\Controllers;
4 4  
  5 +use App\Models\Ad_employer;
5 6 use App\Models\Employer;
6 7 use Illuminate\Http\Request;
7 8  
... ... @@ -52,6 +53,10 @@ class CompanyController extends Controller
52 53  
53 54 $title = $company[0]->name_company;
54 55  
55   - return view('info_company_new', compact('company', 'user_id', 'title'));
  56 + $ads = Ad_employer::query()->with('jobs')->with('jobs_code')->
  57 + OrderByDesc('id')->
  58 + where('employer_id', '=', $company[0]->id)->paginate(2);
  59 +
  60 + return view('info_company_new', compact('company', 'user_id', 'title', 'ads'));
56 61 }
57 62 }
app/Http/Controllers/EmployerController.php
... ... @@ -164,18 +164,15 @@ class EmployerController extends Controller
164 164  
165 165 if (Auth()->user()->is_public) {
166 166 $categories = Category::query()->active()->get();
167   -
168 167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
169 168 where('is_remove', '=', '0')->
170 169 where('is_bd', '=', '0')->
171 170 get();
172 171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
173   -
174 172 WhereHas('users',
175 173 function (Builder $query) use ($id) {
176 174 $query->Where('id', $id);
177 175 })->get();
178   -
179 176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
180 177 } else {
181 178 return redirect()->route('employer.cabinet_vacancie_danger');
... ... @@ -249,18 +246,19 @@ class EmployerController extends Controller
249 246 public function vacancy_edit(Ad_employer $ad_employer) {
250 247 $id = Auth()->user()->id;
251 248 $Positions = Category::query()->where('is_remove', '=', '0')->get();
252   - $jobs = Job_title::query()->OrderBy('name')->
253   - where('is_remove', 0)->where('is_bd', '=' , '0')->get();
254   -
255   - $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
256   - where('user_id', $id)->first();
  249 + $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
  250 + where('is_remove', '=', '0')->
  251 + where('is_bd', '=', '0')->get();
257 252  
  253 + $Employer = Employer::query()->with('users')->with('ads')->
  254 + with('flots')->where('user_id', $id)->first();
258 255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
259 256 }
260 257  
261 258 // Сохранение-редактирование записи
262 259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
263 260 $params = $request->all();
  261 + $params_job["job_title_id"] = $params['job_title_id'];
264 262  
265 263 //$jobs['flot'] = $params['flot'];
266 264 //$jobs['job_title_id'] = $params['job_title_id'];
... ... @@ -268,6 +266,7 @@ class EmployerController extends Controller
268 266 //unset($params['job_title_id']);
269 267  
270 268 $ad_employer->update($params);
  269 + $ad_employer->jobs()->sync($request->get('job_title_id'));
271 270  
272 271 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
273 272 // where('ad_employer_id', $ad_employer->id)->first();
app/Http/Controllers/MainController.php
... ... @@ -263,7 +263,7 @@ class MainController extends Controller
263 263 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
264 264 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
265 265 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
266   - default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
  266 + default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
267 267 }
268 268 }
269 269  
... ... @@ -271,7 +271,7 @@ class MainController extends Controller
271 271  
272 272 $Query_count = $Query->count();
273 273  
274   - $Query = $Query->OrderBy('updated_at')->paginate(3);
  274 + $Query = $Query->OrderByDesc('updated_at')->paginate(3);
275 275  
276 276 $Reclama = reclame::query()->get();
277 277  
app/Http/Controllers/WorkerController.php
... ... @@ -171,6 +171,7 @@ class WorkerController extends Controller
171 171 $Query = $Query->get();
172 172  
173 173 $get_date = date('Y.m');
  174 +
174 175 $c = Static_worker::query()->where('year_month', '=', $get_date)
175 176 ->where('user_id', '=', $worker->user_id)
176 177 ->get();
... ... @@ -252,9 +253,10 @@ class WorkerController extends Controller
252 253 $Infoblocks = infobloks::query()->OrderBy('name')->get();
253 254  
254 255 $stat = Static_worker::query()->where('year_month', '=', $get_date)
255   - ->where('user_id', '=', $Worker[0]->id)
  256 + ->where('user_id', '=', $id)
256 257 ->get();
257 258  
  259 +
258 260 // 10%
259 261  
260 262 $persent = 10;
... ... @@ -714,6 +716,12 @@ class WorkerController extends Controller
714 716 $ad_employer = 0;
715 717 }
716 718  
  719 + if (isset($user1->id)) {
  720 + $sender = User_Model::query()->with('workers')->
  721 + with('employers')->
  722 + where('id', $user1->id)->first();
  723 + }
  724 +
717 725 if (isset($user2->id)) {
718 726 $companion = User_Model::query()->with('workers')->
719 727 with('employers')->
... ... @@ -743,8 +751,6 @@ class WorkerController extends Controller
743 751  
744 752 //$ad_employer = null;
745 753 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
746   - $sender = $user1;
747   -
748 754  
749 755 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
750 756 }
resources/views/admin/users/index.blade.php
... ... @@ -62,6 +62,7 @@
62 62 <th class="px-4 py-3 text-xs">Админ</th>
63 63 <th class="px-4 py-3 text-xs">Менеджер</th>
64 64 <th class="px-4 py-3 text-xs">Дата регист.</th>
  65 + <th class="px-4 py-3 text-xs">Удаление</th>
65 66 </tr>
66 67 </thead>
67 68 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
... ... @@ -111,6 +112,10 @@
111 112 <td class="px-4 py-3 text-xs">
112 113 {{ date('d.m.Y', strtotime($user->created_at)) }}
113 114 </td>
  115 +
  116 + <td class="px-4 py-3 text-xs">
  117 + <a href="{{ route('admin.user_delete', ['user' => $user->id]) }}">Del</a>
  118 + </td>
114 119 </tr>
115 120 @endforeach
116 121 </tbody>
resources/views/employers/dialog.blade.php
... ... @@ -83,7 +83,12 @@
83 83 <svg>
84 84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
85 85 </svg>
86   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  86 + @if ((isset($companion->workers[0]->photo)) &&
  87 + (!empty($companion->workers[0]->photo)))
  88 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  89 + @else
  90 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  91 + @endif
87 92 </div>
88 93 <div class="messages__item-text">
89 94 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -112,7 +117,12 @@
112 117 <svg>
113 118 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
114 119 </svg>
115   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  120 + @if ((isset($companion->employers[0]->logo)) &&
  121 + (!empty($companion->employers[0]->logo)))
  122 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  123 + @else
  124 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  125 + @endif
116 126 </div>
117 127 <div class="messages__item-text">
118 128 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -139,7 +149,23 @@
139 149 <svg>
140 150 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
141 151 </svg>
142   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  152 +
  153 + @if ($companion->is_worker)
  154 + @if ((isset($companion->workers[0]->photo)) &&
  155 + (!empty($companion->workers[0]->photo)))
  156 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  157 + @else
  158 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  159 + @endif
  160 + @else
  161 + @if ((isset($companion->employers[0]->logo)) &&
  162 + (!empty($companion->employers[0]->logo)))
  163 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  164 + @else
  165 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  166 + @endif
  167 + @endif
  168 +
143 169 </div>
144 170 <div class="chatbox__item-body">
145 171 <div class="chatbox__item-text">{{ $it->text }}</div>
... ... @@ -152,7 +178,23 @@
152 178 <svg>
153 179 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
154 180 </svg>
155   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  181 +
  182 + @if ($sender->is_worker)
  183 + @if ((isset($sender->workers[0]->photo)) &&
  184 + (!empty($sender->workers[0]->photo)))
  185 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
  186 + @else
  187 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  188 + @endif
  189 + @else
  190 + @if ((isset($sender->employers[0]->logo)) &&
  191 + (!empty($sender->employers[0]->logo)))
  192 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
  193 + @else
  194 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  195 + @endif
  196 + @endif
  197 +
156 198 </div>
157 199 <div class="chatbox__item-body">
158 200 <div class="chatbox__item-text">{{ $it->text }}</div>
resources/views/employers/edit_vacancy.blade.php
... ... @@ -110,10 +110,10 @@
110 110 </div>
111 111 </div>
112 112  
113   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  113 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display: none">
114 114 <label class="form-group__label">Город посадки</label>
115 115 <div class="form-group__item">
116   - <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь">
  116 + <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? 'Не указан' }}" placeholder="Севастополь">
117 117 @error('city')
118 118 <span class="text-xs text-red-600">
119 119 {{ $message }}
... ... @@ -146,6 +146,33 @@
146 146 </div>
147 147 </div>-->
148 148  
  149 + <!--foreach ($ad_employer->jobs_code as $it_um)
  150 + <pre> print_r($it_um) }}</pre>
  151 + endforeach-->
  152 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  153 + <label class="form-group__label">Редактирование должностей</label>
  154 + <div class="form-group__item">
  155 + <div class="select">
  156 + <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
  157 + @php $i = 1 @endphp
  158 + @if ($jobs->count())
  159 + @foreach($jobs as $it)
  160 + @php $selected = false; @endphp
  161 + @foreach ($ad_employer->jobs_code as $it_um)
  162 + @if (isset($it_um->job_title_id))
  163 + @if ($it_um->job_title_id == $it->id))
  164 + @php $selected = true; @endphp
  165 + @endif
  166 + @endif
  167 + @endforeach
  168 + <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
  169 + @endforeach
  170 + @endif
  171 + </select>
  172 + </div>
  173 + </div>
  174 + </div>
  175 +
149 176 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
150 177 <label class="form-group__label">Описание вакансии</label>
151 178 <div class="form-group__item">
... ... @@ -158,24 +185,24 @@
158 185 </div>
159 186 </div>
160 187  
161   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  188 + <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
162 189 <h4 class="form-group__label">Редактирование должностей</h4>
163 190 <div class="form-group__item">
164   - <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a>
165   -
166   - @if ($ad_employer->jobs->count())
167   - @foreach ($ad_employer->jobs as $key => $it_um)
168   - <p>@if (isset($ad_employer->jobs_code[$key]))
169   - <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
170   - <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
171   - @endif
  191 + <a href=" route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a>
  192 +
  193 + if ($ad_employer->jobs->count())
  194 + foreach ($ad_employer->jobs as $key => $it_um)
  195 + <p>if (isset($ad_employer->jobs_code[$key]))
  196 + <a href=" route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">$it_um->name}}</a>
  197 + <a href=" route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
  198 + endif
172 199 </p>
173   - @endforeach
174   - @else
  200 + endforeach
  201 + else
175 202 Нет связанных <br> с вакансией должностей
176   - @endif
  203 + endif
177 204 </div>
178   - </div>
  205 + </div>-->
179 206 </div>
180 207  
181 208 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
resources/views/info_company_new.blade.php
... ... @@ -106,7 +106,7 @@
106 106 @endif
107 107  
108 108 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
109   - <p class="thing__text">{!! $company[0]->text !!}</p>
  109 + <!--<p class="thing__text"> $company[0]->text !!}</p>-->
110 110 <div class="thing__buttons">
111 111 <button type="button" class="button">
112 112 <svg>
... ... @@ -198,8 +198,7 @@
198 198  
199 199 <div class="main__employer-page-body-item" data-body="2">
200 200 <div class="main__employer-page-two">
201   - @foreach ($company[0]->ads as $job)
202   - @foreach ($job->ad_job as $item)
  201 + @foreach ($ads as $job)
203 202 <div class="main__employer-page-two-item">
204 203 <div class="main__employer-page-two-item-toper">
205 204 @if (!empty($company[0]->logo))
... ... @@ -208,30 +207,37 @@
208 207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
209 208 @endif
210 209 <span>{{ $job->name }}</span>
  210 + <!--<span>Описание:
  211 + $job->text !!}
  212 + </span>-->
211 213 </div>
212   - <div class="main__employer-page-two-item-title">{{ $item->flot }}</div>
  214 + <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
213 215 <div class="main__employer-page-two-item-text">
214   - <div class="main__employer-page-two-item-text-name">
215   - {{ $item->job_title->name }}
216   - </div>
217   - <div class="main__employer-page-two-item-text-body">
218   - <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p>
219   - <p>Контракт: {{ $item->period }} мес.</p>
220   - </div>
  216 + @if ((isset($job->jobs)) && ($job->jobs->count()))
  217 + @foreach($job->jobs as $item)
  218 + <a class="main__employer-page-two-item-text-name">
  219 + {{ $item->name }}
  220 + </a>
  221 + @endforeach
  222 + @endif
  223 + <!--<div class="main__employer-page-two-item-text-body">
  224 + <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p>
  225 + <p>Контракт: $item->period }} мес.</p>
  226 + </div>-->
221 227 </div>
222   - <div class="main__employer-page-two-item-text">
  228 + <!--<div class="main__employer-page-two-item-text">
223 229 <div class="main__employer-page-two-item-text-name">Район работы</div>
224 230 <div class="main__employer-page-two-item-text-body">
225   - <p>{{ $item->region }}</p>
  231 + <p> $item->region }}</p>
226 232 </div>
227 233 </div>
228 234 <div class="main__employer-page-two-item-text">
229 235 <div class="main__employer-page-two-item-text-name">Посадка</div>
230 236 <div class="main__employer-page-two-item-text-body">
231   - <p> {{ $item->start }}</p>
232   - {!! $item->description !!}
  237 + <p> $item->start }}</p>
  238 + !! $item->description !!}
233 239 </div>
234   - </div>
  240 + </div>-->
235 241 <div class="main__employer-page-two-item-text">
236 242 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
237 243 </div>
... ... @@ -247,12 +253,16 @@
247 253 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
248 254 </div>
249 255 </div>
  256 + @if ((isset($job->jobs)) && ($job->jobs->count()))
250 257 <div class="main__employer-page-two-item-tags">
251   - <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span>
  258 + @foreach ($job->jobs as $item)
  259 + <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
  260 + @endforeach
252 261 </div>
  262 + @endif
253 263 <div class="main__employer-page-two-item-buttons">
254 264  
255   - <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
  265 + <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
256 266 class="button main__employer-page-two-item-button js_send_it_button">Оставить
257 267 отклик...</button>
258 268  
... ... @@ -269,8 +279,11 @@
269 279 </button>
270 280 </div>
271 281 </div>
272   - @endforeach
273 282 @endforeach
  283 +
  284 + <div style="margin-top: 20px">
  285 + {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
  286 + </div>
274 287 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
275 288 <span>Показать ещё</span>
276 289 <span>Скрыть</span>
resources/views/worker.blade.php
... ... @@ -233,7 +233,6 @@
233 233 <tbody>
234 234 @foreach($Query[0]->infobloks as $it)
235 235 <tr>
236   - <td>Документ:</td>
237 236 <td><b>{{ $it->name }}</b></td>
238 237 <td>
239 238 @if ($it->model_dop_info[0]->status == 0) Не указано
resources/views/workers/dialog.blade.php
... ... @@ -83,7 +83,12 @@
83 83 <svg>
84 84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
85 85 </svg>
86   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  86 + @if ((isset($companion->workers[0]->photo)) &&
  87 + (!empty($companion->workers[0]->photo)))
  88 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  89 + @else
  90 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  91 + @endif
87 92 </div>
88 93 <div class="messages__item-text">
89 94 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -104,7 +109,12 @@
104 109 <svg>
105 110 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
106 111 </svg>
107   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  112 + @if ((isset($companion->employers[0]->logo)) &&
  113 + (!empty($companion->employers[0]->logo)))
  114 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  115 + @else
  116 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  117 + @endif
108 118 </div>
109 119 <div class="messages__item-text">
110 120 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
... ... @@ -131,7 +141,21 @@
131 141 <svg>
132 142 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
133 143 </svg>
134   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  144 + @if ($companion->is_worker)
  145 + @if ((isset($companion->workers[0]->photo)) &&
  146 + (!empty($companion->workers[0]->photo)))
  147 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt="">
  148 + @else
  149 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  150 + @endif
  151 + @else
  152 + @if ((isset($companion->employers[0]->logo)) &&
  153 + (!empty($companion->employers[0]->logo)))
  154 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt="">
  155 + @else
  156 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  157 + @endif
  158 + @endif
135 159 </div>
136 160 <div class="chatbox__item-body">
137 161 <div class="chatbox__item-text">{{ $it->text }}</div>
... ... @@ -144,7 +168,22 @@
144 168 <svg>
145 169 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
146 170 </svg>
147   - <img src="{{ asset('images/default_man.jpg') }}" alt="">
  171 + @if ($sender->is_worker)
  172 + @if ((isset($sender->workers[0]->photo)) &&
  173 + (!empty($sender->workers[0]->photo)))
  174 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt="">
  175 + @else
  176 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  177 + @endif
  178 + @else
  179 + @if ((isset($sender->employers[0]->logo)) &&
  180 + (!empty($sender->employers[0]->logo)))
  181 + <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt="">
  182 + @else
  183 + <img src="{{ asset('images/default_man.jpg') }}" alt="">
  184 + @endif
  185 + @endif
  186 +
148 187 </div>
149 188 <div class="chatbox__item-body">
150 189 <div class="chatbox__item-text">{{ $it->text }}</div>
... ... @@ -198,6 +198,7 @@ Route::group([
198 198  
199 199 // кабинет - пользователи
200 200 Route::get('users', [UsersController::class, 'index'])->name('users');
  201 + Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete');
201 202  
202 203 // кабинет - пользователи
203 204 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');