Avatar Image in Laravel

Hi. I have fresh installed Metronic Laravel. I tried to edit the avatar. The link is saved to the db, but the avatar not shown neither in the profile page or the navbar.

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (19)

Hi Reza,

Could you please verify if the image is being uploaded properly? Please check it in the Laravel storage folder.

storage/app/public

Thanks

Yes I have the images inside

storage/app/public/images

Hi,

Could you please check the browser console log if there is any error? Could you please send the screenshot?

Thanks

I got an upload success response. And for the console log, I only got error for the logo

Failed to load resource: the server responded with a status of 403 (Forbidden)

We have to check what error cause it. Maybe you can try to check on this network log. If there is an error in the response, we can see it after submitting it.

image


Thanks

Got this message in both preview and response
"Failed to load response data: No content available because this request was redirected"

Deleted comment

https://ibb.co/f95dWnf

Deleted comment

How can I upload a captured image here so it will be easier for you to see it

You can use embed code HTML from here.

image

Upload succeed and image saved to the storage>images folder. But still not shown. Are there any other Metronic Laravel settings or Laravel classes I missed?

Any new updates?

I also tried to use the absolute image path to replace the img src link but not working

<img src="{{ auth()->user()->avatar_url }}" alt="image"/>

Hi Reza,

How about the folder permission? Have you tried to check on it? Could you please try to set some read-write permission for the storage folder? Here is some guidance for the Laravel folders.

https://stackoverflow.com/a/66109044

Thanks

Hi Faizal,

The app is still in local dev. And yes, the storage permission to read-write

I am using Laragon, if it helps for troubleshooting

Hi Reza,

Sorry for the delay. Have you found the solution to this issue?

Could you please check in the HTML inspector and check the image URL?
image
ismail image

Thanks

I did have found the solution. I think it's related to the storage link command. Maybe you should check the default Metronic Laravel files for the avatar file routing. It will not work after running the storage link command since it will require the

asset
. Or, perhaps it's just me.
Thank you for the excellent support.

Sorry for the inconvenience. I hope this will help other users as well. We already put the step (no 14) in the documentation.

https://preview.keenthemes.com/metronic8/laravel/documentation/getting-started/build

Thanks

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(