F
Filament6mo 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
awcodes6mo 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
NoorOP6mo ago
->disk('storage') ??
awcodes
awcodes6mo ago
->disk(‘public’)
Noor
NoorOP6mo ago
ok let me try with that
awcodes
awcodes6mo 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
NoorOP6mo 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
awcodes6mo ago
Yep, that’s the disk you want unless your images need to be private. It should be the default in filament.
Noor
NoorOP6mo ago
And if needs to be private then ?
awcodes
awcodes6mo ago
Then you have to do more. That gets into more complicated setup. But it’s doable.
Noor
NoorOP6mo ago
What I need to do for private
awcodes
awcodes6mo ago
Have a look at the laravel docs on storage to understand the difference first.
Noor
NoorOP6mo ago
ok
awcodes
awcodes6mo ago
If that is all set up correctly the image column should have the same modifiers for the disk and directory etc.
Noor
NoorOP6mo 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
NoorOP6mo ago
No description
Noor
NoorOP6mo ago
getting this console error now /var/www/html/storage/app/public/product-image
awcodes
awcodes6mo ago
When you run php artisan storage:link it will create a symlink from storage/app/public to /public/storage
Noor
NoorOP6mo ago
yeah it created that
awcodes
awcodes6mo 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
NoorOP6mo ago
hmmm idk I have to see
awcodes
awcodes6mo 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
Egit6mo 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
LeandroFerreira6mo ago
Is there a hot file in the public folder?
Noor
NoorOP6mo ago
It was some permission issue on server its solved now .. thanks for the help though 🙏🏻
Want results from more Discord servers?
Add your server