Support the ongoing development of Laravel.io →
Requests Database Views
Last updated 2 years ago.
0

Look at intervention/image.

One way to tackle images is to rename them to random string (ie md5), save that md5 and full name ({md5}.jpg). That should reduce the chances of duplicate names. And save it by date like images/2014/12/08/{image}. Than you can retrieve it by parsing the created_at field. No need to have full path to the image in that case.

But it depends on what exactly you need...

0

It depends on your needs, but I typically rename them to something unique (storing the original name in the DB), then for different sizes I add a suffix:

1.jpg <- the original
1.100x100.jpg <- a 100x100 version
...
Last updated 9 years ago.
0

Just look how Blogging CMS manage their media files. As long as my programming time, the best way is using reverse date format.

Example format: /path/to/your/directories/{year}/{month}/{day}/{file-name}-{uniqid}-{width}-{height}.{ext}
Implementation: /path/to/your/directories/2014/12/10/my-photo-8ej982ejjkie-100-100.jpg

Laravel Package for image manipulation >> Intervention/Image

You also capable to store media detail informations to database.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.