Passed
Push — master ( 6b0e6b...43789e )
by Stephen
03:30
created

TrackAction::query()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Sfneal\Tracking\Models;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use Sfneal\Scopes\CreatedOrderScope;
7
use Sfneal\Scopes\IdOrderScope;
8
use Sfneal\Tracking\Builders\TrackActionBuilder;
9
use Sfneal\Tracking\Models\Base\AbstractTracking;
10
use Sfneal\Tracking\Models\Traits\TrackingRelationships;
11
12
class TrackAction extends AbstractTracking
13
{
14
    use TrackingRelationships;
0 ignored issues
show
introduced by
The trait Sfneal\Tracking\Models\T...s\TrackingRelationships requires some properties which are not provided by Sfneal\Tracking\Models\TrackAction: $task, $planManagement, $project, $model_table, $plan, $taskRecord
Loading history...
15
16
    /**
17
     * The "booting" method of the model.
18
     *
19
     * @return void
20
     */
21
    protected static function boot()
22
    {
23
        parent::boot();
24
        static::addGlobalScope(new CreatedOrderScope());
25
        static::addGlobalScope(new IdOrderScope());
26
    }
27
28
    protected $table = 'track_action';
29
    protected $primaryKey = 'track_action_id';
30
31
    protected $fillable = [
32
        'track_action_id',
33
        'action',
34
        'model_table',
35
        'model_key',
36
        'model_changes',
37
    ];
38
39
    /**
40
     * Query Builder.
41
     *
42
     * @param $query
43
     *
44
     * @return TrackActionBuilder()
45
     */
46
    public function newEloquentBuilder($query)
47
    {
48
        return new TrackActionBuilder($query);
49
    }
50
51
    /**
52
     * @return TrackActionBuilder|Builder
53
     */
54
    public static function query(): TrackActionBuilder
55
    {
56
        return parent::query();
57
    }
58
}
59