File tree Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Expand file tree Collapse file tree 3 files changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,12 @@ class CustomerModel extends Model
16
16
17
17
protected $ guarded = [];
18
18
19
- protected $ casts = [
20
- 'data ' => 'json ' ,
21
- ];
19
+ public function casts (): array
20
+ {
21
+ return [
22
+ 'data ' => 'json ' ,
23
+ ];
24
+ }
22
25
23
26
public function orders (): HasMany
24
27
{
Original file line number Diff line number Diff line change @@ -18,18 +18,21 @@ class OrderModel extends Model
18
18
19
19
protected $ guarded = [];
20
20
21
- protected $ casts = [
22
- 'order_number ' => 'integer ' ,
23
- 'items ' => 'json ' ,
24
- 'grand_total ' => 'integer ' ,
25
- 'items_total ' => 'integer ' ,
26
- 'tax_total ' => 'integer ' ,
27
- 'shipping_total ' => 'integer ' ,
28
- 'coupon_total ' => 'integer ' ,
29
- 'use_shipping_address_for_billing ' => 'boolean ' ,
30
- 'gateway ' => 'json ' ,
31
- 'data ' => 'json ' ,
32
- ];
21
+ public function casts (): array
22
+ {
23
+ return [
24
+ 'order_number ' => 'integer ' ,
25
+ 'items ' => 'json ' ,
26
+ 'grand_total ' => 'integer ' ,
27
+ 'items_total ' => 'integer ' ,
28
+ 'tax_total ' => 'integer ' ,
29
+ 'shipping_total ' => 'integer ' ,
30
+ 'coupon_total ' => 'integer ' ,
31
+ 'use_shipping_address_for_billing ' => 'boolean ' ,
32
+ 'gateway ' => 'json ' ,
33
+ 'data ' => 'json ' ,
34
+ ];
35
+ }
33
36
34
37
public function customer (): BelongsTo
35
38
{
Original file line number Diff line number Diff line change @@ -16,11 +16,14 @@ class StatusLogModel extends Model
16
16
17
17
protected $ guarded = [];
18
18
19
- protected $ casts = [
20
- 'order_id ' => 'integer ' ,
21
- 'timestamp ' => 'datetime ' ,
22
- 'data ' => 'json ' ,
23
- ];
19
+ public function casts (): array
20
+ {
21
+ return [
22
+ 'order_id ' => 'integer ' ,
23
+ 'timestamp ' => 'datetime ' ,
24
+ 'data ' => 'json ' ,
25
+ ];
26
+ }
24
27
25
28
public function order (): BelongsTo
26
29
{
You can’t perform that action at this time.
0 commit comments