Added Reseller view

This commit is contained in:
Deon George
2018-07-17 14:10:40 +10:00
parent 1821810570
commit 0ce640c283
12 changed files with 308 additions and 28 deletions

View File

@@ -9,6 +9,15 @@ class Account extends Model
protected $table = 'ab_account';
public $timestamps = FALSE;
protected $appends = [
'active_display',
];
protected $visible = [
'id',
'company',
'active_display',
];
/**
* Return the country the user belongs to
*/
@@ -26,4 +35,14 @@ class Account extends Model
{
return $this->belongsTo(\App\User::class);
}
public function getCompanyAttribute($value)
{
return $value ? $value : $this->user->SurFirstName;
}
public function getActiveDisplayAttribute($value)
{
return sprintf('<span class="btn-sm btn-block btn-%s text-center">%s</span>',$this->active ? 'primary' : 'danger',$this->active ? 'Active' : 'Inactive');
}
}