F
Filament5w ago
Noor

ImageColumn is not showing image

I'm trying to show image on table but its not showing it and I'm getting this console error. Note: Images are getting stored in /var/www/html/storage/app/product-image
No description
25 Replies
awcodes
awcodes5w ago
You either need to store them in storage/app/public/product-image or create a disk that you can symlink that isn’t in the storage public directory.
Noor
Noor5w ago
->disk('storage') ??
awcodes
awcodes5w ago
->disk(‘public’)
Noor
Noor5w ago
ok let me try with that
awcodes
awcodes5w ago
You’ll need to reupload the image though Look at config/filesystem.php to see how the disks are setup in laravel. Only things in storage/app/public are accessible in the browser without a temporary signed url.
Noor
Noor5w ago
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
awcodes
awcodes5w ago
Yep, that’s the disk you want unless your images need to be private. It should be the default in filament.
Noor
Noor5w ago
And if needs to be private then ?
awcodes
awcodes5w ago
Then you have to do more. That gets into more complicated setup. But it’s doable.
Noor
Noor5w ago
What I need to do for private
awcodes
awcodes5w ago
Have a look at the laravel docs on storage to understand the difference first.
Noor
Noor5w ago
ok
awcodes
awcodes5w ago
If that is all set up correctly the image column should have the same modifiers for the disk and directory etc.
Noor
Noor5w ago
/var/www/html/public/storage
/var/www/html/public/storage
/var/www/html/storage/app/product-image
/var/www/html/storage/app/product-image
it shows me these two paths are they same as showing same pictures
Noor
Noor5w ago
No description
Noor
Noor5w ago
getting this console error now /var/www/html/storage/app/public/product-image
awcodes
awcodes5w ago
When you run php artisan storage:link it will create a symlink from storage/app/public to /public/storage
Noor
Noor5w ago
yeah it created that
awcodes
awcodes5w ago
Anything in the app outside of the /public path will not be resolvable directly by the browser. That’s the reason for the link Something is off at your server level.
Noor
Noor5w ago
hmmm idk I have to see
awcodes
awcodes5w ago
Yea. To be honest I’m making my best guesses at this point without being able to see the whole setup, but serving laravel in a sub path/directory will create issues if the server is not configured correctly.
Egit
Egit5w ago
Hello, sir. it seems I have the same problem. why when displaying the imagecolumn does the localhost URL appear instead of the domain URL set in the env?
LeandroFerreira
Is there a hot file in the public folder?
Noor
Noor4w ago
It was some permission issue on server its solved now .. thanks for the help though 🙏🏻