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

CreatedTodayCriteria::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
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