From 4415365f230d6cdb5cb5a979bb086600eba7f5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Mon, 25 Mar 2024 10:03:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B0=D0=B9=D0=B4=D0=B5=D1?= =?UTF-8?q?=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/WorkerController.php | 1 + app/Providers/MyServiceProvider.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index d265918..980e7e3 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -546,6 +546,7 @@ class WorkerController extends Controller $Query = $Query->OrderBy('updated_at')->paginate(3); + return view('workers.favorite', compact('Query', 'Query_count', 'Job_title')); diff --git a/app/Providers/MyServiceProvider.php b/app/Providers/MyServiceProvider.php index a8f1474..2dc9745 100644 --- a/app/Providers/MyServiceProvider.php +++ b/app/Providers/MyServiceProvider.php @@ -93,7 +93,7 @@ class MyServiceProvider extends ServiceProvider $user = Auth::user(); $id = $user->id; $employer = Employer::query()->where('user_id', $id)->get(); - $id_employer = $employer[0]->id; + $id_employer = $employer[0]->id; $view->with(['id_employer' => $id_employer, 'Employer' => $employer]); } ); @@ -104,7 +104,11 @@ class MyServiceProvider extends ServiceProvider $user = Auth::user(); $id = $user->id; $Worker = Worker::query()->where('user_id', $id)->get(); - $id_worker = $Worker[0]->id; + if (isset($Worker[0]->id)) { + $id_worker = $Worker[0]->id; + } else { + $id_worker = 0; + } $view_worker->with(['id_worker' => $id_worker, 'Worker' => $Worker, 'User' => $user]); } ); -- 1.7.10.4