Passed
Push — develop ( dce829...c223e6 )
by ReliQ
03:41
created

Trackable::trackingUpdates()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\Logistiq\Utility\Eloquent;
6
7
use Illuminate\Database\Eloquent\Relations\HasMany;
8
use Illuminate\Support\Collection;
9
10
/**
11
 * @property Collection $trackingUpdates
12
 */
13
class Trackable extends Model
14
{
15
    /**
16
     * @return HasMany
17
     */
18
    public function trackingUpdates(): HasMany
19
    {
20
        return $this->hasMany(
21
            TrackingUpdate::class,
22
            TrackingUpdate::COLUMN_TRACKABLE_IDENTIFIER
23
        )->where(TrackingUpdate::COLUMN_TRACKABLE_TYPE, static::class);
24
    }
25
}
26