added it_get_user_invoices test

This commit is contained in:
Peter Papp
2021-03-04 14:15:07 +01:00
parent 7e4bd191d7
commit d4df26bf35
5 changed files with 121 additions and 100 deletions

View File

@@ -18,44 +18,28 @@ class User extends Authenticatable
{
use Notifiable, Billable, Sortable, HasFactory, HasApiTokens;
protected $guarded = ['id', 'role'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password', 'avatar',
protected $guarded = [
'id',
'role'
];
protected $fillable = [
'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
protected $appends = [
'used_capacity', 'storage'
'used_capacity',
'storage'
];
/**
* Sortable columns
*
* @var string[]
*/
public $sortable = [
'id',
'name',
@@ -144,26 +128,6 @@ class User extends Authenticatable
->get();
}
/**
* Format avatar to full url
*
* @return \Illuminate\Contracts\Routing\UrlGenerator|string
*/
public function getAvatarAttribute()
{
// Get avatar from external storage
if ($this->attributes['avatar'] && is_storage_driver(['s3', 'spaces', 'wasabi', 'backblaze'])) {
return Storage::temporaryUrl($this->attributes['avatar'], now()->addDay());
}
// Get avatar from local storage
if ($this->attributes['avatar']) {
return url('/' . $this->attributes['avatar']);
}
return url('/assets/images/' . 'default-avatar.png');
}
/**
* Set user billing info
*