10

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.

HichamEch
  • 635
  • 1
  • 10
  • 18
Soumik Chakraborty
  • 243
  • 1
  • 2
  • 15

6 Answers6

10

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

Soumik Chakraborty
  • 243
  • 1
  • 2
  • 15
6

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.

Jaydeep Mor
  • 1,690
  • 3
  • 21
  • 39
4

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
Nisar Ahmed
  • 151
  • 1
  • 6
3

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
Yunnosch
  • 26,130
  • 9
  • 42
  • 54
Kamlesh
  • 5,233
  • 39
  • 50
  • This solution worked for me. I hope, this will also help you. Thank you very much to ask this question. – Kamlesh Apr 29 '21 at 06:45
  • I am just appreciating question owner, why are you trying to restricting me? I am not doing any wrong thing or using any abuse words for any one then why do you changing my answer again and again? Is this .... your nature? – Kamlesh Apr 29 '21 at 06:48
3

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.

VPZ
  • 741
  • 8
  • 19
0

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.

etihadsep
  • 23
  • 3