Images Stored in Seperate folders not displaying

When I upload images I put each of them in a seperate folder but am failing to reference that folder in the table so the images are not displaying
No description
12 Replies
Tieme
Tieme11mo ago
How does your upload code look like. How does your image column code look like
codeartisan
codeartisanOP11mo ago
Tables\Columns\ImageColumn::make('logo')
->label('Category Image')
->circular(),
Tables\Columns\ImageColumn::make('logo')
->label('Category Image')
->circular(),
Thats the column however I can access the image publically on the browser This is the code for uploading the image
Forms\Components\FileUpload::make('image')
->directory('amentities')
->image()
->label('Amentity Image'),
Forms\Components\FileUpload::make('image')
->directory('amentities')
->image()
->label('Amentity Image'),
` that was for amentities I have for different services just they differ in folder names I have realized even removing the directory still the image fails to show
codeartisan
codeartisanOP11mo ago
I have set up a custom disk storage but seems nto to work
'amentities' => [
'driver' => 'local',
'root' => storage_path('app/public/amentities'),
'url' => env('APP_URL') . '/storage/amentities',
'visibility' => 'public',
'throw' => false,
],
'amentities' => [
'driver' => 'local',
'root' => storage_path('app/public/amentities'),
'url' => env('APP_URL') . '/storage/amentities',
'visibility' => 'public',
'throw' => false,
],
When I do something like this am able to view the storage image
http://localhost:8000/storage/amentities/01HMS2TF7CJA8NZKRWHWJ93BQB.png
http://localhost:8000/storage/amentities/01HMS2TF7CJA8NZKRWHWJ93BQB.png
But actual path stored in the db starts fron amentities DB url=> amentities/01HMS2TF7CJA8NZKRWHWJ93BQB.png
codeartisan
codeartisanOP11mo ago
the image is publically accessible
No description
Tieme
Tieme11mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
codeartisan
codeartisanOP11mo ago
No description
codeartisan
codeartisanOP11mo ago
Yeah I always create that first
Tieme
Tieme11mo ago
What console error do you have on the table page? What image is it actualt pulling from the server that can not be loaded ?
codeartisan
codeartisanOP11mo ago
when I inspect the src is empty
codeartisan
codeartisanOP11mo ago
No description
codeartisan
codeartisanOP11mo ago
TextColumn::make('image')->label('Image')->formatStateUsing(fn (string $state): string => url($state))
TextColumn::make('image')->label('Image')->formatStateUsing(fn (string $state): string => url($state))
When I tried that code I got that
Want results from more Discord servers?
Add your server