Created
February 19, 2023 03:56
-
-
Save tushargugnani/3f8d8d3e4fe8e9f0840c2d1b4faea989 to your computer and use it in GitHub Desktop.
avatarUrl function in User model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function avatarUrl() | |
{ | |
return $this->avatar | |
? Storage::disk('public')->url($this->avatar) | |
: 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($this->email))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment