images not showing using spatie media library in filamentphp - laravel

I am having trouble displaying the images uploaded using spatie media library with the filament admin panel.
image for clarificatio
This is the code for form schema :
SpatieMediaLibraryFileUpload::make('thumbnail')->collection('posts')
And this is the code for table columns
SpatieMediaLibraryImageColumn::make('thumbnail')->collection('posts')
Thanks.

Check your APP_URL and take care of the correct port.

You should use:
php artisan storage:link

Check in your .env (root folder of your laravel project) file that the APP_URL is the same as your server url.
You get the server url on startup (php artisan server) mine is http://127.0.0.1:8000. (or http://localhost:8000)
So you fill in from APP_URL=http://127.0.0.1 and change to APP_URL=http://127.0.0.1:8000
If you have localhost fill in APP_URL=http://localhost:8000
Check if the files are uploaded to your storgae and been linked with your public folder.
In your CLI: php artisan storage:link

Related

Laravel: Uploaded image not showing

i keep getting 404 image not found when viewing the uploaded image on my project but the image is there. im using laravel's asset() helper to retrieve the image. the url in chrome shows http://127.0.0.1:8000/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png and ive already done php artisan storage:link. any help is greatly appreciated.
You shouldn't use the asset helper for this, the url generated is wrong.
As you use the public storage, the url is supposed to be like this :
http://127.0.0.1:8000/storage/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png
but aren't you supposed to access the image through the public folder if you do php artisan storage:link

Image not showing in blade

I have been working on an open source project recently, currently I am just adding new features in the project.
The project has some images to retrieve and to display them in the view blade that is working perfectly but when I am trying to add a new image through the form, my images are not displaying.
What could be the problem
I have tried
php artisan storage:link
But without success
The issue is when you upload laravel application from one sever to another or from local to live server .It copies shortcut of storage folder too.So before you must delete shortcut folder from public/storage and symbolic link again.
To make these files accessible from the web, you should create a symbolic link from public/storage to storage/app/public.
php artisan storage:link
Ref:https://laravel.com/docs/8.x/filesystem#the-public-disk

User profile image can not show in laravel 8

I'm using laravel 8. I have used jetstream for user registration. Profile photo feature is being used, But it did not show profile image.
I help from you good people.
#coding
Make sure the APP_URL is correct in your .env file including port. ie. if you are running on localhost and port 8000 your APP_URL should be APP_URL=http://127.0.0.1:8000.
If the profile photo is stored successfully and that didn't work try:
Deleting the shortcut folder storage created at /project/public/
run php artisan storage:link
The photo should show up.

Cannot display image from storage directory using vue.js in laravel

I'm saving image in Storage folder path is like:
storage\app\public\img\images_01.png
now in my vue component i'm getting image like this:
this is returning following path :
/storage/img/images_01.png
but the issue is image does not gets displayed.
You can only access files in your public folder. But you can add a symbolic link with php artisan storage:link so you can access what's in storage/app/public

Laravel storage link doesn't work after i push on github

so i just create a storage link with
php artisan storage:link
to store images and view them, but after i push it with github, the storage link seems to disappear on my partner's side, so he can only store and can't view, is there a way to fix this without doing the artisan command on his side
If your partner has no ssh/terminal access, then create symbolic link with Route, run it once & delete it.
route/web.php :
Route::get('/sym', function () {
Artisan::call('storage:link');
});
It's just a symbolic link that is created. Seeing that the base folder is not versioned during php artisan storage:link the symbolic link will also not be versioned. Your partners will have to face a php artisan storage:link at their level. However, it will not be able to access your files unless you decide to version the folder.

Resources