Post   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 32
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A scopePublished() 0 4 1
1
<?php
2
3
namespace App;
4
5
use App\Libraries\Presenterable\Presenterable;
6
use App\Libraries\Presenterable\Presenters\PostPresenter;
7
use App\Traits\ActivateableTrait;
8
use App\Traits\HasImages;
9
use Keyhunter\Administrator\Repository;
10
use Keyhunter\Translatable\HasTranslations;
11
12
class Post extends Repository
13
{
14
    use HasTranslations, ActivateableTrait, Presenterable, HasImages;
15
16
    /**
17
     * @var PostPresenter
18
     */
19
    protected $presenter = PostPresenter::class;
20
    
21
    /**
22
     * @var array
23
     */
24
    protected $fillable = ['status', 'active', 'view_count'];
25
26
    /**
27
     * @var array
28
     */
29
    public $translatedAttributes = [
30
        'title', 'slug', 'body', 'seo_title', 'seo_description', 'seo_keywords'
31
    ];
32
33
    /**
34
     * Status is published scope.
35
     *
36
     * @param $query
37
     * @return mixed
38
     */
39
    public function scopePublished($query)
40
    {
41
        return $query->whereStatus('published');
42
    }
43
}