-
I'm trying to create a custom class for naming files when uploading. Created class:
Method 'conversionFileName' works perfect. I need a suffix to be added to the original name if a file with that name already exists, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
that code is terrible, public function responsiveFileName(string $fileName): string
{
return pathinfo($fileName, PATHINFO_FILENAME);
} Here is your mistake laravel-medialibrary/src/Support/FileNamer/FileNamer.php Lines 10 to 16 in 1351471 |
Beta Was this translation helpful? Give feedback.
that code is terrible,
Media::where('name', $fileName)->get()
, betterMedia::where('name', $fileName)->count()
you misunderstood how it works
originalFileName
also you must use markdown correctly, example:
Here is your mistake
laravel-medialibrary/src/Support/FileNamer/FileNamer.php
Lines 10 to 16 in 1351471