EloquentRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 4 1
A getAllPublished() 0 4 1
1
<?php
2
3
namespace Yajra\CMS\Repositories\Article;
4
5
use Yajra\CMS\Entities\Article;
6
use Yajra\CMS\Repositories\RepositoryAbstract;
7
8
class EloquentRepository extends RepositoryAbstract implements Repository
9
{
10
    /**
11
     * Get repository model.
12
     *
13
     * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder
14
     */
15
    public function getModel()
16
    {
17
        return new Article;
18
    }
19
20
    /**
21
     * Get all published articles.
22
     *
23
     * @return \Illuminate\Database\Eloquent\Collection
24
     */
25
    public function getAllPublished()
26
    {
27
        return $this->getModel()->with('permissions')->published()->get();
28
    }
29
}
30