Remove empty fields from user return, add avatar

This commit is contained in:
Nabeel Shahzad
2020-03-24 15:53:59 -04:00
parent 877d5a5479
commit 3f7a7d0f2e
3 changed files with 23 additions and 10 deletions

View File

@@ -21,6 +21,7 @@ use Laratrust\Traits\LaratrustUserTrait;
* @property string ident
* @property string curr_airport_id
* @property string home_airport_id
* @property string avatar
* @property Airline airline
* @property Flight[] flights
* @property int flight_time
@@ -142,7 +143,7 @@ class User extends Authenticatable
public function getAvatarAttribute()
{
if (!$this->attributes['avatar']) {
return;
return $this->gravatar();
}
return new File([