I have used the following command to create symnlink for storage public folder for my project which I'm doing in Lumen . => php artisan storage:link
But I am getting this error in terminal =>
There are no commands defined in the "storage" namespace.
Another query is though I'm able to upload file in storage folder , how I'm able to access, I need some sample code for this. Kindly help.
You can create a symlink via SSH by running the following command: ln -s /path/to/target /path/to/shortcut. It can also be created via a cronjob using the same command: You can also create a symlink using the PHP function.
php artisan storage:link. Once a file has been stored and the symbolic link has been created, you can create a URL to the files using the asset helper: echo asset('storage/file.txt'); You may configure additional symbolic links in your filesystems configuration file.
How do I access storage files in Laravel? Laravel's filesystem configuration file is located at config/filesystems. php . Within this file, you may configure all of your filesystem "disks".
How do I save a file in Laravel? Symlink public/storage to storage/app/public using php artisan storage:link. Upload file using $path = $request->file('avatar')->store('avatars');
I created by this unix command :
ln -s sourceforwhich symnlinkfolderpath e.g.:
ln -s /data/html/projectfolder/storage/app/public /data/html/projectfolder/public/storage
This is for windows,
First of all run cmd
with administrator if you are on another user not in admin and then go to your project's public path e.g. project/path/public
.
Then run below command,
mklink /D "storage\" "E:absolute/static/path~/storage/app/public/"
For e.g.,
mklink /D "storage\" "E:/User Name/Work/My Projects/storage/app/public/"
Hopefully it will help for Lumen windows users.
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