fix: use media creation date as fallback for path generation instead of current date

This commit is contained in:
Yoga Pangestu 2026-04-04 02:28:00 +07:00
parent b13133ce71
commit b583e8b49c

View File

@ -10,7 +10,7 @@ class CustomPathGenerator implements PathGenerator
public function getPath(Media $media): string
{
$feature = $media->getCustomProperty('feature', 'misc');
$date = $media->getCustomProperty('date', now()->toDateString());
$date = $media->getCustomProperty('date', $media->created_at?->toDateString() ?? now()->toDateString());
$docType = $media->getCustomProperty('doc_type');
$feature = str($feature)->slug();