Test Failed
Push — ft/states ( eebc9c )
by Ben
29:42 queued 08:49
created

CheckPreviewTrait::isPreviewAllowed()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Thinktomorrow\Chief\States\Publishable;
4
5
use Illuminate\Support\Facades\Session;
6
7
trait CheckPreviewTrait
8
{
9
    public function isPreviewAllowed()
10
    {
11
        if (PreviewMode::fromRequest()->check()) {
12
            Session::now('note.default', 'U bekijkt een preview.');
13
            return true;
14
        } else {
15
            return false;
16
        }
17
    }
18
}
19