Files & Disks

Managing uploaded files in every application is inevetible at some point.

Create Separate disks in the config/filesystems.php for each code section, for instance user avatars will have their own disk called avatars to store the files in, because they can be made public, user documents can never be public, as these files may contain sensetive information related to a user. The benefit of creating separate disks for each section is, better control of where the files are with minimal to no changes to the actual code. We can just update the driver of the disk from S3 to local, public ftp etc and all the files will be uploaded to the new location, or visibility of the objects.

Do not put individual files in the root of the buckets, the can become very messy very quickly.