Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kabircse's avatar

What are the pros and cons of laravel disk file sytem over tradional file system ?

I am a newbie on laravel. I am using file upload on laravel. I found laravel provides disk system . But I do not know why they provide this technique.

What are the pros and cons of laravel disk file sytem over tradional file system for uploading file?

0 likes
3 replies
ohffs's avatar

You get a lot of flexibility without having to change your code. For instance, you can store a file on your local server, or a remote sftp site, or an AWS S3 bucket and still use the same kind of code, eg :

Storage::disk('avatars')->put('file.jpg', $contents);
Storage::disk('audio')->put('file.mp3', $contents);

If you needed to move your 'audio' disk from a local one to amazon S3 - it would be quite easy and your code wouldn't really change. Compare it to doing it by hand and you can see how it makes life easier :-)

1 like
kabircse's avatar

Is there any scope to hide my file folder or directory of images ?

Please or to participate in this conversation.