| Total Complexity | 4 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class PreviewMode |
||
| 6 | { |
||
| 7 | private $active; |
||
| 8 | |||
| 9 | public function __construct(bool $active) |
||
| 10 | { |
||
| 11 | $this->active = $active; |
||
| 12 | } |
||
| 13 | |||
| 14 | public static function fromRequest() |
||
| 15 | { |
||
| 16 | $active = (request()->has('preview-mode') && auth()->guard('chief')->check()); |
||
| 17 | |||
| 18 | return new static($active); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function check(): bool |
||
| 24 | } |
||
| 25 | } |
||
| 26 |