Passed
Push — master ( a736f4...2cb6b2 )
by Stephen
03:13
created

TrackSpam::getCreatedAtTimeAttribute()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Sfneal\Honeypot\Models;
4
5
use Illuminate\Database\Eloquent\Relations\BelongsTo;
6
use Sfneal\Models\AbstractModel;
7
use Sfneal\Scopes\CreatedOrderScope;
8
use Support\Tracking\Models\TrackTraffic;
0 ignored issues
show
Bug introduced by
The type Support\Tracking\Models\TrackTraffic was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class TrackSpam extends AbstractModel
11
{
12
    /**
13
     * The "booting" method of the model.
14
     *
15
     * @return void
16
     */
17
    protected static function boot()
18
    {
19
        parent::boot();
20
        static::addGlobalScope(new CreatedOrderScope('desc'));
21
    }
22
23
    protected $connection = 'mysql';
24
    protected $table = 'track_spam';
25
    protected $primaryKey = 'track_spam_id';
26
27
    protected $fillable = [
28
        'track_spam_id',
29
        'request_token',
30
    ];
31
32
    /**
33
     * @var array Relationships that are always eager loaded
34
     */
35
    protected $with = [
36
        'tracking',
37
    ];
38
39
    /**
40
     * Related TrackTraffic data.
41
     *
42
     * @return BelongsTo
43
     */
44
    public function tracking()
45
    {
46
        return $this->belongsTo(TrackTraffic::class, 'request_token', 'request_token');
47
    }
48
}
49