Completed
Push — master ( 09bacc...1bea48 )
by ReliQ
13:49 queued 01:30
created

Trackable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A trackingUpdates() 0 6 1
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