| Conditions | 4 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public static function fromRequest() |
||
| 19 | { |
||
| 20 | if(!config('thinktomorrow.chief.preview-mode') || Str::startsWith(request()->path(), 'admin/')) { |
||
| 21 | return new static(false); |
||
| 22 | } |
||
| 23 | |||
| 24 | $active = (session()->get('preview-mode', static::default()) === true && auth()->guard('chief')->check()); |
||
| 25 | |||
| 26 | return new static($active); |
||
| 27 | } |
||
| 48 |