F
Filament10mo ago
Pan

Images & Barcode not working when web hosted (Hostinger)

What I am trying to do: I want the barcode from milon barcode to work properly and image to actually load. I can upload normally but it doesn't show the image in the tables. What I did: I tried running php artisan storage:link before uploading it to the hostinger files. It works locally, but on the hostinger it doesn't Issues: It works locally as shown in the images and does not in the hostinger when hosted despite running php artisan storage:link before uploading However, we're not in the part of public_html folder, we just duplicated the public_html and create a public folder and we just uploaded the same exact files (the css wasn't working when that wasn't done and were not sure why). But the main issue really is the image and barcode not working properly. Code: barcode table column
Tables\Columns\TextColumn::make('barcode')
->url(fn(Equipment $record): string => route('barcode', ['barcode' => $record->barcode]))
->openUrlInNewTab()
->formatStateUsing(function ($record){
$barcode = DNS1D::getBarcodeHTML($record->barcode, 'C128');
return $barcode;
})->html(),
Tables\Columns\TextColumn::make('barcode')
->url(fn(Equipment $record): string => route('barcode', ['barcode' => $record->barcode]))
->openUrlInNewTab()
->formatStateUsing(function ($record){
$barcode = DNS1D::getBarcodeHTML($record->barcode, 'C128');
return $barcode;
})->html(),
Image upload in form
FileUpload::make('image')
->image()
->imageEditor(),
FileUpload::make('image')
->image()
->imageEditor(),
and Image column table Tables\Columns\ImageColumn::make('image'),
No description
No description
No description
No description
10 Replies
Melchior
Melchior10mo ago
ran the following commands? npm run build php artisan storage:link You can check your browser console for CSP violations, APP_URL needs to be set correctly or CORS headers need to be adjusted maybe
Patrick
Patrick10mo ago
ye u need to apply that symlink on production as well And if i'm correct, filament uses the env var APP_URL to build the full url to an image, so this should be a correct value too on production
Pan
PanOP10mo ago
I get this error doing it in the ssh of the hostinger
No description
BOT_Larry
BOT_Larry10mo ago
Can you make a righ click on the missing image html symbol and klick "open in new tab". And check if the requested url is correct (Or in dev tools network tab...)
Pan
PanOP10mo ago
the image is still not found
No description
No description
tinkypinky
tinkypinky10mo ago
Check image using ssh. Does it exist in public/storage folder?
dhanar98
dhanar9810mo ago
check the imagick and gd extensions are installed image related actions imagick and gd extensions are needed.
Hdev
Hdev10mo ago
change storage folder permissions to 775
awcodes
awcodes10mo ago
Chances are with something like hostinger or any shared hosting provider there is a permissions issue preventing the tmp uploaded file from being copied over to the storage directory. Would be really surprised if this was a filament issue and not a host issue.
Want results from more Discord servers?
Add your server