Completed
Push — master ( 5c46bf...f77784 )
by Mahmoud
03:22
created

CreatedTodayCriteria   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 4 1
1
<?php
2
3
namespace App\Port\Criteria\Eloquent;
4
5
use App\Port\Criteria\Abstracts\Criteria;
6
use Carbon\Carbon;
7
use Prettus\Repository\Contracts\RepositoryInterface as PrettusRepositoryInterface;
8
9
/**
10
 * Class CreatedTodayCriteria
11
 *
12
 * @author  Mahmoud Zalt  <[email protected]>
13
 */
14
class CreatedTodayCriteria extends Criteria
15
{
16
17
    /**
18
     * @param                                                   $model
19
     * @param \Prettus\Repository\Contracts\RepositoryInterface $repository
20
     *
21
     * @return  mixed
22
     */
23
    public function apply($model, PrettusRepositoryInterface $repository)
24
    {
25
        return $model->where('created_at', '>=', Carbon::today()->toDateString());
26
    }
27
}
28