diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index 0afea10..3e10710 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -473,6 +473,28 @@ class WorkerController extends Controller } } + public function cabinet_save_foto(Worker $worker, Request $request){ + $params = ['photo' => null]; + + if ($request->has('photo')) { + if (!empty($worker->photo)) { + Storage::delete($worker->photo); + } + $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); + } + + if ($request->has('file')) { + if (!empty($worker->file)) { + Storage::delete($worker->file); + } + $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); + } + + $worker->update($params); + + return redirect()->route('worker.cabinet'); + } + // Сообщения данные public function messages($type_message) { diff --git a/resources/views/resume.blade.php b/resources/views/resume.blade.php index 09e3fa6..58cb86d 100644 --- a/resources/views/resume.blade.php +++ b/resources/views/resume.blade.php @@ -382,7 +382,7 @@
Предпочтение по типу судна: - + {{ $res->boart_type_preference ?? '-' }}
ФИО: @@ -390,13 +390,15 @@
Наличие визы: + {{ $res->visa_available ?? '-' }}
Возраст: - @if (isset($res->old_year)) {{ $res->old_year }} @else - @endif + {{ $res->old_year ?? '-' }}
Наличие танкерных документов: + {{ $res->tanker_documents_available ?? '-' }}
Желаемые вакансии: @@ -406,14 +408,18 @@ {{ $job_title->name }} @if (!$loop->last) / @endif @endforeach + @else + - @endif
Наличие подтверждения для работы на ВВП: + {{ $res->confirmation_work_for_vvp ?? '-' }}
Пожелание к З/П: + {{ $res->salary_expectations ?? '-' }}
Город проживания @@ -421,13 +427,15 @@
Уровень английского: + {{ $res->english_level ?? '-' }}
Номер телефона - {{ $res->telephone }} + {{ $res->telephone ?? '-' }}
Дата готовности к посадке: + {{ $res->ready_boart_date ?? '-' }}
E-mail: diff --git a/resources/views/workers/cabinet.blade.php b/resources/views/workers/cabinet.blade.php index 035c261..fc702ed 100644 --- a/resources/views/workers/cabinet.blade.php +++ b/resources/views/workers/cabinet.blade.php @@ -4,6 +4,7 @@ @endsection @@ -159,9 +56,7 @@ @include('workers.menu', ['item' => 1])
-
- @csrf - @include('messages_error') +

Моя анкета

@@ -176,6 +71,7 @@
+

Статистика

@@ -202,37 +98,42 @@
Заполните профиль, чтобы повысить процент анкеты на 80%
-
-

Профиль

-
-
- - @if (!empty($worker->photo)) - - @else - - - - @endif -
-
-
- +

Основная информация

@@ -586,8 +487,7 @@ Добавить контакт для рекомендации
- - +
diff --git a/routes/web.php b/routes/web.php index 421e832..5b13dd8 100644 --- a/routes/web.php +++ b/routes/web.php @@ -506,6 +506,8 @@ Route::group([ // 1 страница - Моя анкета Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); + Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto'); + // 2 страница - Сообщения Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');