Completed
Push — master ( bcfc51...2533f4 )
by David
01:24 queued 11s
created

PublishedScope   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 1
1
<?php
2
3
namespace Torralbodavid\DuckFunkCore\Scopes;
4
5
use Carbon\Carbon;
6
use Illuminate\Database\Eloquent\Builder;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\Scope;
9
10
class PublishedScope implements Scope
11
{
12
    public function apply(Builder $builder, Model $model)
13
    {
14
        $builder->where('published_at', '<=', Carbon::now());
15
    }
16
}
17