From 4d275414d05b2b3133393840b8a9d314eed1fac6 Mon Sep 17 00:00:00 2001 From: sergeybodin Date: Thu, 22 Jun 2023 11:59:13 +0300 Subject: [PATCH] major --- app/Services/Forms/Publications/PublicationForms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Forms/Publications/PublicationForms.php b/app/Services/Forms/Publications/PublicationForms.php index a12195c..ae3d02d 100644 --- a/app/Services/Forms/Publications/PublicationForms.php +++ b/app/Services/Forms/Publications/PublicationForms.php @@ -54,8 +54,8 @@ class PublicationForms extends FormsService { public function store(array $data): ?JsonResponse { - if (!empty($data['attach']['page_slug'])) { - $page = Page::query()->where(['slug' => $data['attach']['page_slug']])->first(); + if (!empty($data['attach']['page_id'])) { + $page = Page::byUuid($data['attach']['page_id'])->first(); $data['page_id'] = $page->id; } $data['user_id'] = Auth::user()->id;