Total Complexity | 6 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 33.33% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class MyriadOrder extends Model |
||
13 | { |
||
14 | public $incrementing = false; |
||
15 | |||
16 | protected $guarded = []; |
||
17 | |||
18 | protected $casts = [ |
||
19 | 'details' => \JsonFieldCast\Casts\SimpleJsonField::class, |
||
20 | 'order_date' => 'date', |
||
21 | ]; |
||
22 | |||
23 | 3 | public function getTable(): string |
|
24 | { |
||
25 | 3 | return config('myriad-data-store.tables.orders'); |
|
26 | } |
||
27 | |||
28 | public function getNameAttribute(): string |
||
29 | { |
||
30 | return $this->order_date?->format('jS F Y') ?? '-'; |
||
|
|||
31 | } |
||
32 | |||
33 | 3 | public function packages(): HasMany |
|
36 | } |
||
37 | |||
38 | public function despatchContact(): BelongsTo |
||
39 | { |
||
40 | return $this->belongsTo(MyriadDataDownloader::$contactModel, 'despatch_contact_id', 'id'); |
||
41 | } |
||
42 | |||
43 | public function invoiceContact(): BelongsTo |
||
44 | { |
||
45 | return $this->belongsTo(MyriadDataDownloader::$contactModel, 'invoice_contact_id', 'id'); |
||
46 | } |
||
47 | |||
48 | public function agentContact(): BelongsTo |
||
51 | } |
||
52 | } |
||
53 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.