Posted on • Updated on

Laravel Storage link On Server / Local

author

Kai

 

To make these files accessible from the web, you should create a symbolic link from public/storage to storage/app/public.

There Are multiple ways to achieve this.

#Local

To create the symbolic link, you may use the storage:link Artisan command:

$ php artisan storage:link

#Terminal

//create

$ ln -s /path/to/target /path/to/link

//update

$ ln -sfn /path/to/target /path/to/link

#URL

Route::get('/storage-link', function () {
    Artisan::call('storage:link');
});

#symlink file

symlink('/home/{username}/myLaravelApp/storage/app/public','/home/{username}/public_html/storage');

Credit: Laravel docs

end of article

Related Posts

Join Our Newsletter

Want the latest & greatest from our blog straight to your inbox with some exclusive offers from our partners and sponsors?

We won't spam. Promise.