When we do something like this:
Storage::disk('local')->put('file.txt', 'Contents');
How do you make a link to that file in a view? Something like this:
<a href="path_to_file.txt">Download File</a>
there are so many things in documentation and yet not even one example how to create a link to that file
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.
This file allows you to configure the disks of any file system. Each disk represents a specific storage driver and location. The local driver interacts with files stored locally on the server running the Laravel application while the S3 driver is used to write to Amazon's S3 cloud storage service.
Try this command on your terminal : php artisan storage:link, then laravel storage become public access.
<a href="{{url('/')}}/{{ Storage::disk('local')->url('file.txt')}}">Download File</a>
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