Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create symlink from public/storage to storage/app/public in laravel?

Tags:

laravel-5.2

I have no idea on how to create symbolic link or symlink.

I am working on File system in laravel 5.2.

The document says that i need to create a symbolic link from public/storage to storage/app/public to keep the publicly accessible files in one directory.

How to create that symlink or symbolic link?

Which file or directory should I place that code?

like image 529
Misterk Avatar asked Dec 11 '22 16:12

Misterk


2 Answers

App::make('files')->link(storage_path('app/public'), public_path('storage'));

And don't forget to use App after namespace.

like image 112
Shìpu Ahamed Avatar answered Apr 15 '23 13:04

Shìpu Ahamed


Run this command:

php artisan storage:link
like image 32
Joey Rich Avatar answered Apr 15 '23 13:04

Joey Rich