|
|
|
|
@ -18,7 +18,8 @@ class Paramedic extends SoftDeletesModel
|
|
|
|
|
static::addGlobalScope(new AdminProjectScope());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getStatusNameAttribute() {
|
|
|
|
|
public function getStatusNameAttribute()
|
|
|
|
|
{
|
|
|
|
|
$status_name = $this->status;
|
|
|
|
|
switch ($this->status) {
|
|
|
|
|
case self::STATUS_ACTIVE:
|
|
|
|
|
@ -31,6 +32,23 @@ class Paramedic extends SoftDeletesModel
|
|
|
|
|
return $status_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function toggle()
|
|
|
|
|
{
|
|
|
|
|
switch ($this->status) {
|
|
|
|
|
case self::STATUS_ACTIVE:
|
|
|
|
|
$this->update([
|
|
|
|
|
"status" => self::STATUS_INACTIVE
|
|
|
|
|
]);
|
|
|
|
|
break;
|
|
|
|
|
case self::STATUS_INACTIVE:
|
|
|
|
|
$this->update([
|
|
|
|
|
"status" => self::STATUS_ACTIVE
|
|
|
|
|
]);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAvatarUrlAttribute()
|
|
|
|
|
{
|
|
|
|
|
$protocol = request()->secure() ? "https" : "http";
|
|
|
|
|
|