diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index a0a237b..a120b65 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -333,12 +333,16 @@ class EmployerController extends Controller //Избранные люди public function favorites(Request $request) { - $items = RusDate::count_item_fav(); - $it = $_COOKIE['favorite_worker']; - $it = str_replace('"', "", $it); - $it = str_replace('[', "", $it); - $it = str_replace(']', "", $it); - $Arr = explode(",", $it); + if (isset($_COOKIE['favorite_worker'])) { + $items = RusDate::count_item_fav(); + $it = $_COOKIE['favorite_worker']; + $it = str_replace('"', "", $it); + $it = str_replace('[', "", $it); + $it = str_replace(']', "", $it); + $Arr = explode(",", $it); + } else { + $Arr = Array(); + } $Workers = Worker::query(); $Workers = $Workers->whereIn('id', $Arr); diff --git a/resources/views/layout/frontend.blade.php b/resources/views/layout/frontend.blade.php index fa4e9c2..172c298 100644 --- a/resources/views/layout/frontend.blade.php +++ b/resources/views/layout/frontend.blade.php @@ -224,224 +224,28 @@