Using Illuminate\Filesystem

I’ve found this useful page, but the steps to configuring it isn’t the same as userfrosting’s config.

I’ve tried following it without configuring, but all I get is a “No Facade Root Set”.

Thanks in Advance

Might not work out the box if you want to use any driver. For normal filesystem operation, should work out the box.

You can check here how I used Laravel Cache service : https://github.com/userfrosting/cache/blob/master/src/RedisStore.php

I’ve looked at the API docs and I can’t seem to find any way of adding the config programmatically like in your example.

I think I’ll use phpleague’s flysystem instead as you can specify the settings when you initialise the object.

I know others have used Flysystem before. We’re not locked with using Laravel. Sometimes others have better tools too.

Filesystem support is something I want to bring as a core functionality eventually. You might be interested in reading this : https://github.com/userfrosting/UserFrosting/issues/869

That issue was why I was trying to use larvel before instead of flysystem.

My plan is to create a community sprinkle that organised files into categories like avatars or newsletters inside app/storage, and then have the files inside them numbered and instead have the file name stored in the database. Having them numbered means it doesn’t matter if two files have the same name.

Also, that way each file could be linked with other objects in the database such as accounts with a simple file_id reference in the table.

I also thought to have a sub folder inside each category that had pre-generated thumbnails for each file - providing the file type allows it such as PDFs.

I prefer a storage system that doesn’t rely on the db (can lose the db, but not the file structure itself), but it’s true a good Filesystem service need to handle multiple files with the same name. Numbering the files could be a simple solution indeed. +1 also for file relations.

Keep us in touch, as this community sprinkle is something I’m really interested on. Don’t forget to give feedback on the issue I linked before. And come say hi on the Chat (http://chat.userfrosting.com). We’re also there to help if you need more input !

1 Like