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