how and where I can store images using laravel?
context: I want display some images in my main view (these are predefined by me). I also want to store images uploaded by users, however, do not know where to store these images.
I'd like to call these from the view...
Thank you very much for the help. :)
Show activity on this post. $files = Storage::files('public/images/'. $dir->name); foreach($files as $file){ Storage::move($file, 'public/images'); } Storage::deleteDirectory('public/images/'. $dir->name); $dir->delete();
Laravel's filesystem configuration file is located at config/filesystems.php . Within this file, you may configure all of your filesystem "disks". Each disk represents a particular storage driver and storage location.
Basically you can save your files wherever you want within your Laravel application provided that you have permissions to create directory and file.
But I prefer saving files in the storage/app
folder. Laravel provides a simple API to manipulate files on disk. See the docs.
Update:
This answer was posted when Laravel was in version 5.2. From version 5.3 on, you can easily create symbolic links by running the artisan command php artisan storage:link
. See the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With