AdminOperationLogRepositoryEloquent::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Yeelight\Repositories\Eloquent;
4
5
use Yeelight\Models\AdminOperationLog;
6
use Yeelight\Presenters\AdminOperationLogPresenter;
7
use Yeelight\Repositories\Criteria\RequestCriteria;
8
use Yeelight\Repositories\Interfaces\AdminOperationLogRepository;
9
use Yeelight\Validators\AdminOperationLogValidator;
10
11
/**
12
 * Class AdminOperationLogRepositoryEloquent
13
 *
14
 * @category Yeelight
15
 *
16
 * @package Yeelight\Repositories\Eloquent
17
 *
18
 * @author Sheldon Lee <[email protected]>
19
 *
20
 * @license https://opensource.org/licenses/MIT MIT
21
 *
22
 * @link https://www.yeelight.com
23
 */
24
class AdminOperationLogRepositoryEloquent
25
    extends BaseRepository
26
    implements AdminOperationLogRepository
27
{
28
    /**
29
     * @var array
30
     */
31
    protected $fieldSearchable = [
32
        'id',
33
        'user_id',
34
        'method',
35
        'path'  => 'like',
36
        'ip'    => 'like',
37
        'input' => 'like',
38
    ];
39
40
    /**
41
     * $isSearchableForceAndWhere
42
     *
43
     * @var bool
44
     */
45
    protected $isSearchableForceAndWhere = true;
46
47
    /**
48
     * Specify Model class name.
49
     *
50
     * @return string
51
     */
52
    public function model()
53
    {
54
        return AdminOperationLog::class;
55
    }
56
57
    /**
58
     * Specify Validator class name.
59
     *
60
     * @return mixed
61
     */
62
    public function validator()
63
    {
64
        return AdminOperationLogValidator::class;
65
    }
66
67
    /**
68
     * Specify Presenter class name.
69
     *
70
     * @return mixed
71
     */
72
    public function presenter()
73
    {
74
        return AdminOperationLogPresenter::class;
75
    }
76
77
    /**
78
     * Boot up the repository, pushing criteria.
79
     */
80
    public function boot()
81
    {
82
        $this->pushCriteria(app(RequestCriteria::class));
83
    }
84
}
85