Completed
Push — 0.3 ( da43ab...625b56 )
by Ben
96:17 queued 52:29
created

CheckPreviewTrait::isPreviewAllowed()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Thinktomorrow\Chief\Concerns\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