I have a problem, tried alot things, so I dont know what to do... I have a project on Laravel and I deployed it on Shared Hosting, and I cant access images from storage, I dont know what to do, try hard to access it from storage or recreate file system to /public_html/img/ to show all images
Directory to Laravel project: marijuscoding.lt/motosvajone Directory to Laravel public folder: marijuscoding.lt/public_html
I tried creating symlink with .php file, tried create it with Routes, tried access from storage, tried access some images from public_html.
CodePudding user response:
Did you link your storage before?
Try using php artisan storage:link
You can show your /config/filesystems.php Filesystem Disks array
CodePudding user response:
you should run this command first, that will create a symbolic link, read more here
php artisan storage:link
Then use the built in asset
function in your view like this, read more here
{{ asset('storage/your_folder/photo.jpg') }} // http://example.com/storage/your_folder/photo.jpg
CodePudding user response:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],