0

I'd like to display images in the columns (that are inserted through a drop-down) in the Admin panel. The image does load when inserted, but when I want it to display in the column, it won't load, displaying this:

this

Here's the code that I'm trying to run:

//Inserting...
return $form
            ->schema([   
                FileUpload::make('image')
                    ->image()
                    ->disk('public')
                    ->directory('products')
                    ->imagePreviewHeight('250')
                    ->label('Product Image')
                    ->nullable()
                    ->columnSpan(12),
            ])
//output...
return $table
            ->columns([
                ImageColumn::make('image')
                    ->label('Image')
                    ->disk('public')
                    ->circular()
                    ->height(50)
                    ->width(50),

            ])

In DB, it's storing the filepath to the image like so: products/image.png. I made sure that the paths are indeed correct and the link was established.
Note: I found images in two directories: storage/app/public/products/ and public/storage/products/. I also attempted making a link ( php artisan storage:link )

Display an image in the column. Expected to preview it, but it won't load, displaying a weird icon.

Browser console errors: Failed to load resource: net::ERR_BLOCKED_BY_CLIENT Failed to load resource: net::ERR_CONNECTION_REFUSED

2
  • do you get any errors in the browser console, eg a failed request for the image? Please check and share it Commented Jun 6 at 9:50
  • @julaine Failed to load resource: net::ERR_BLOCKED_BY_CLIENT Failed to load resource: net::ERR_CONNECTION_REFUSED Commented Jun 6 at 10:24

1 Answer 1

0

What's your project APP_URL?

Try to replace it for example:
My project name is:
example

Then APP_URL:
example.test

By this way you can solve the image issue.

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.