Passed
Push — master ( c54910...c3bdb3 )
by Adam
16:46
created

CampaignRepository::campaigns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
3
namespace Coyote\Repositories\Eloquent;
4
5
use Coyote\Campaign;
6
use Coyote\Repositories\Contracts\CampaignRepositoryInterface;
7
8
class CampaignRepository extends Repository implements CampaignRepositoryInterface
9
{
10
    /**
11
     * @return string
12
     */
13
    public function model()
14
    {
15
        return Campaign::class;
16
    }
17
18
    public function campaigns()
19
    {
20
        return $this
21
            ->model
22
            ->select()
23
            ->where('is_enabled', true)
24
            ->with('banners')
25
            ->get();
26
    }
27
}
28