Пример #1
0
 /**
  * Get the user avatar.
  *
  * @return string
  */
 public function presentAvatarUrl()
 {
     if ($this->object->avatar) {
         return url($this->object->avatar);
     }
     return Gravatar::get($this->object->email);
 }
Пример #2
0
 private function getAvatarPlaceholder($avatar)
 {
     if (empty($avatar)) {
         try {
             return Gravatar::get($this->attributes['email'], ['fallback' => 'identicon']);
         } catch (InvalidEmailException $e) {
             return Gravatar::get('*****@*****.**', ['fallback' => 'identicon']);
         }
     }
     return $avatar;
 }
Пример #3
0
 /**
  * Bind data to the view.
  *
  * @return void
  */
 public function compose()
 {
     view()->share('isGuest', auth()->guest());
     view()->share('signedIn', auth()->check());
     view()->share('user', auth()->user());
     if (auth()->user()) {
         view()->share('gravatarURL', Gravatar::get(auth()->user()->email, ['size' => 24, 'secure' => true]));
         view()->share('appointments', auth()->user()->appointments()->active()->get());
     } else {
         view()->share('gravatarURL', 'http://placehold.it/150x150');
         view()->share('appointments', []);
     }
 }