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 @@