Reputation: 253
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.
Upvotes: 11
Views: 14218
Reputation: 738
If you are on Windows, running below command in a Lumen project folder simply helps:
mklink /J public\storage storage\app\public
It does not require any Administrator privileges.
Upvotes: 3
Reputation: 6145
I am using Lumen 8.0 on Mac and Linux machine. I did not find any solution for lumen but we can create symbolic link by using full/complete path in command line:
ln -s /var/www/storage/app /var/www/public/storage
Upvotes: 2
Reputation: 1703
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.
Upvotes: 6
Reputation: 331
More simple and short way using unix command :
Go to the lumen/public folder in the terminal or via ssh etc.
Run :
ln -s ../storage/app/public storage
Upvotes: 5
Reputation: 23
Lumen's artisan doesn't support "storage", that's why you got an error. Try to upload your file to app/public folder instead.
Change your upload path to app/public, too.
Upvotes: 0
Reputation: 253
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
Upvotes: 10