fix: fallback to media creation date when custom date property is missing in CustomPathGenerator
This commit is contained in:
parent
1286c15f57
commit
e5c1776caa
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user