Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getAvatarAttribute($value)
- {
- $email = $this->email;
- $size = 250;
- $fallback = "https://api.adorable.io/avatars/$size/$email";
- $path = "/uploads/avatars/";
- if ($value == null || !file_exists(public_path($path.$value))) {
- return 'https://www.gravatar.com/avatar/'.md5($email).'?s='.$size.'&d='.urlencode($fallback);
- } else {
- return $path.$value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement