Search code examples
phplaravellaravel-8gravatar

How to display user's profile picture using email hash


Previously, I worked in Laravel 5, there user's profile image was showing using getHash() of user's email. Now I am working in Laravel 8, but there is not showing user's profile image as previously showing. So, please tell me how I can display user's profile image using email hash in Laravel 8.


Solution

  • Below are the steps to generate the URLs required to request gravatar profile images which i have missed while creating app in Laravel 8 -

    1. Create a valid email hash.
    2. Build the URL to request a profile image.
    3. Append .php to that URL to indicate that you want the results in serialized PHP format.