| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getPicture($size = false) |
||
| 33 | { |
||
| 34 | switch ($this->avatar_type) { |
||
| 35 | case 'gravatar': |
||
| 36 | if (! $size) { |
||
| 37 | $size = config('gravatar.default.size'); |
||
| 38 | } |
||
| 39 | |||
| 40 | return gravatar()->get($this->email, ['size' => $size]); |
||
|
|
|||
| 41 | |||
| 42 | case 'storage': |
||
| 43 | return url('storage/'.$this->avatar_location); |
||
| 44 | } |
||
| 45 | |||
| 46 | $social_avatar = $this->providers()->where('provider', $this->avatar_type)->first(); |
||
| 47 | if ($social_avatar && strlen($social_avatar->avatar)) { |
||
| 48 | return $social_avatar->avatar; |
||
| 49 | } |
||
| 50 | |||
| 51 | return false; |
||
| 52 | } |
||
| 94 |