Open Programmatore-Web opened 2 years ago
The UploadsController handles storing images.
How does your proposition improve SEO?
SEO specialists argue that the filename must match the keyword. Then: original-name = keyword random-number = avoid replacing an existing file.
A better solution would be: title-post / keyword.ext.
Thanks for the suggestion. Drop any links here that support that hypothesis.
I'll see about adding this to the v7 features.
I tried this solution.
public function store()
{
$payload = request()->file();
if (! $payload) {
return response()->json(null, 400);
}
// Only grab the first element because single file uploads
// are not supported at this time
$file = reset($payload);
$name = time() . '-' . $file->getClientOriginalName();
//$path = $file->storePublicly(Canvas::baseStoragePath(), [
// 'disk' => config('canvas.storage_disk'),
//]);
$path = $file->storeAs(Canvas::baseStoragePath(), $name);
return Storage::disk(config('canvas.storage_disk'))->url($path);
}
Thanks for that @ServizioWebmaster. I'll get this addition in the next major release.
Is your feature request related to a problem? Please describe.
SEO improvement: change rename image file.
Describe the solution you'd like
I propose to replace the renaming of the image files like this: original-name-random-number.extension. Can anyone tell me where to look in the files? Thanks.
Describe alternatives you've considered
No response
Additional context
No response
Validations