route element file uploads

Add short and long PDF paths to elements, keep pdfPath as a short PDF compatibility alias, and route generic file uploads by fileType.
This commit is contained in:
Yisroel Baum 2026-06-14 23:17:56 +03:00
parent 0d5783ba9c
commit 9bbabc7fa6
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
28 changed files with 686 additions and 214 deletions

View file

@ -20,7 +20,8 @@ class EloquentElementRepository implements ElementRepository
'description' => $dto->description,
'icon_image_url' => $dto->iconImageUrl,
'rich_text' => $dto->richText,
'pdf_path' => $dto->pdfPath,
'short_pdf_path' => $dto->shortPdfPath,
'long_pdf_path' => $dto->longPdfPath,
'youtube_url' => $dto->youtubeUrl,
'parent_element_id' => $dto->parentElement?->getId(),
]);
@ -31,7 +32,8 @@ class EloquentElementRepository implements ElementRepository
description: $dto->description,
iconImageUrl: $dto->iconImageUrl,
richText: $dto->richText,
pdfPath: $dto->pdfPath,
shortPdfPath: $dto->shortPdfPath,
longPdfPath: $dto->longPdfPath,
youtubeUrl: $dto->youtubeUrl,
set: $dto->set,
parentElement: $dto->parentElement,
@ -52,7 +54,8 @@ class EloquentElementRepository implements ElementRepository
$model->description = $element->getDescription();
$model->icon_image_url = $element->getIconImageUrl();
$model->rich_text = $element->getRichText();
$model->pdf_path = $element->getPdfPath();
$model->short_pdf_path = $element->getShortPdfPath();
$model->long_pdf_path = $element->getLongPdfPath();
$model->youtube_url = $element->getYoutubeUrl();
$model->parent_element_id = $element->getParentElement()?->getId();
$model->save();
@ -137,7 +140,8 @@ class EloquentElementRepository implements ElementRepository
description: $model->description,
iconImageUrl: $model->icon_image_url,
richText: $model->rich_text,
pdfPath: $model->pdf_path,
shortPdfPath: $model->short_pdf_path,
longPdfPath: $model->long_pdf_path,
youtubeUrl: $model->youtube_url,
set: $set,
parentElement: $parentElement,