Images in public folder. Hi everyone! I moved app from local to server. During development I had symlink from public/storage to storage/app/public created by php artisan storage:link command. Now I can not see all images.
Any idea how to fix it?
You need to create the symlink on your server as well.
Is it the only way and the best way? Asking as a newbie :-) No idea how to make it :-)
php artisan storage:link or similar.. i believe it does that for you.
you can also manually put folders inside public/images or w/e i dont think there should be a prob with that
You need to run php artisan storage:link on the server and it should work ;)
I did it in cpanel but nothing changed :-(
You can use with command
only change path/to with current dir
ln -s /path/to/laravel/storage/app/public /path/to/public/storage
I found this solution:
Run php artisan storage:link command manually.
Add this code to the top of the web.php file:
Artisan::call('storage:link');
, and it works. Is it a proper way to make it or it's just kind of fix?
very simple steps....
first create a temp. route to call a artisan command
Route::get('/symlink', function () {
Artisan::call('storage:link');
});
then open browser and go to url -> http://example.com/symlink ========> only once
then check your public folder linked or not
hope its help..... if not reply this conversation
select a best answer so in feature other can get solution as fast as possible.
A better solution would be having a server where you have access through SSH so you can run the commands yourself. This is not the most ideal way to run commands to be honest.
Please sign in or create an account to participate in this conversation.