master
sergeybodin 2023-06-22 11:59:13 +03:00
parent cdd8da9fdb
commit 4d275414d0
1 changed files with 2 additions and 2 deletions

View File

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