Hello,
where would it be best to put filename normalization?
For example"
"image (1).jpg"
I would like to run "str_slug($filename)", so I get better, error-less filenames?
Thank you
You can use usingFileName to set the filename to anything you want:
$yourModel
->addMedia($pathToFile)
->usingFileName($normalizedFileName)
->toMediaLibrary();
How can I change the name only, not the extension?
Most helpful comment
You can use
usingFileNameto set the filename to anything you want: