| @@ 88-102 (lines=15) @@ | ||
| 85 | * |
|
| 86 | * @return $this |
|
| 87 | */ |
|
| 88 | public function disable($reason = null) |
|
| 89 | { |
|
| 90 | $this->enabled = 0; |
|
| 91 | $this->reason = $reason; |
|
| 92 | $this->disabled_at = Carbon::now(); |
|
| 93 | ||
| 94 | if ($reason == self::SPACE_FULL) { |
|
| 95 | $this->full = 1; |
|
| 96 | } |
|
| 97 | ||
| 98 | $this->save(); |
|
| 99 | event(new CloudStorageDisabled($this)); |
|
| 100 | ||
| 101 | return $this; |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * @return $this |
|
| @@ 107-118 (lines=12) @@ | ||
| 104 | /** |
|
| 105 | * @return $this |
|
| 106 | */ |
|
| 107 | public function enable() |
|
| 108 | { |
|
| 109 | $this->reason = null; |
|
| 110 | $this->enabled = 1; |
|
| 111 | $this->full = 0; |
|
| 112 | $this->enabled_at = Carbon::now(); |
|
| 113 | ||
| 114 | $this->save(); |
|
| 115 | event(new CloudStorageEnabled($this)); |
|
| 116 | ||
| 117 | return $this; |
|
| 118 | } |
|
| 119 | } |
|