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