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

CheckPreviewTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPreviewAllowed() 0 7 2
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