Added Reseller view
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user