Closed ctf0 closed 6 years ago
it turned out that the FlySystem Api have some methods which aren't in the laravel docs, which allow us to get the file along with its metadata except for a couple of items which isn't possible
url
a laravel specific feature, but found a solution for that.mimetype
not available in local nor in aws disk, but with some tinkring we can get it as well.folder size & count
not possible in anywhere, even in plain php but again i've found a solution for that with a one down side, for each folder we need to make an extra call to get its data.
for example if we have 5 folders in a directory, we will make 5 + 1
requests "we can escape that and make it all in one request but it needs extra work to filter them which am not into doing atm".
atm in order for laravel to fetch the files info, it will have to make a new request for every piece of info we need for each file.
for example, imagine you have 100 record in a db table & you want to fetch the content of those records,
except in our case, it get data by column not by row, docs
so in-order for the manager to display the file info we need
so those 100 files are essentially
500 + 1
requests, not to mention getting the folders size.this is a bad architecture and its related to laravel not the media-manager it self, this also renders the manager almost inaccessible for remote disk storages like S3.
Example Case
if anyone knows an idea/solution for this mess, am all ears.