diff --git a/app/Models/DelayedGood.php b/app/Models/DelayedGood.php index e61e508..d40023f 100644 --- a/app/Models/DelayedGood.php +++ b/app/Models/DelayedGood.php @@ -16,15 +16,18 @@ class DelayedGood extends Model protected $guarded = ['id']; - protected $casts = [ - 'stored_date' => 'date', - 'payment_date' => 'date', - 'quantity' => 'integer', - 'unit_price' => 'integer', - 'total_amount' => 'integer', - 'paid_amount' => 'integer', - 'is_paid' => 'boolean', - ]; + protected function casts(): array + { + return [ + 'stored_date' => 'date', + 'payment_date' => 'date', + 'quantity' => 'integer', + 'unit_price' => 'integer', + 'total_amount' => 'integer', + 'paid_amount' => 'integer', + 'is_paid' => 'boolean', + ]; + } public function customer(): BelongsTo { diff --git a/app/Models/EggPrice.php b/app/Models/EggPrice.php index 31ea348..1b7e6d1 100644 --- a/app/Models/EggPrice.php +++ b/app/Models/EggPrice.php @@ -13,9 +13,12 @@ class EggPrice extends Model protected $guarded = ['id']; - protected $casts = [ - 'price' => 'integer', - ]; + protected function casts(): array + { + return [ + 'price' => 'integer', + ]; + } public function unit(): BelongsTo { diff --git a/app/Models/Expense.php b/app/Models/Expense.php index c4ada37..956836d 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -14,7 +14,10 @@ class Expense extends Model implements HasMedia protected $guarded = ['id']; - protected $casts = [ - 'expense_date' => 'date', - ]; + protected function casts(): array + { + return [ + 'expense_date' => 'date', + ]; + } } diff --git a/app/Models/FeedPurchase.php b/app/Models/FeedPurchase.php index 9f77359..0c6db3e 100644 --- a/app/Models/FeedPurchase.php +++ b/app/Models/FeedPurchase.php @@ -16,10 +16,13 @@ class FeedPurchase extends Model protected $guarded = ['id']; - protected $casts = [ - 'purchase_date' => 'date', - 'total_price' => 'integer', - ]; + protected function casts(): array + { + return [ + 'purchase_date' => 'date', + 'total_price' => 'integer', + ]; + } public function items(): HasMany { diff --git a/app/Models/FeedPurchaseItem.php b/app/Models/FeedPurchaseItem.php index 18f457c..eb6e904 100644 --- a/app/Models/FeedPurchaseItem.php +++ b/app/Models/FeedPurchaseItem.php @@ -13,11 +13,14 @@ class FeedPurchaseItem extends Model protected $guarded = ['id']; - protected $casts = [ - 'quantity' => 'integer', - 'unit_price' => 'integer', - 'subtotal' => 'integer', - ]; + protected function casts(): array + { + return [ + 'quantity' => 'integer', + 'unit_price' => 'integer', + 'subtotal' => 'integer', + ]; + } protected function formattedUnitPrice(): Attribute { diff --git a/app/Models/Order.php b/app/Models/Order.php index f746358..bfb43d2 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -13,13 +13,16 @@ class Order extends Model protected $guarded = ['id']; - protected $casts = [ - 'order_date' => 'date', - 'egg_quantity' => 'integer', - 'unit_price' => 'integer', - 'total_amount' => 'integer', - 'discount' => 'integer', - ]; + protected function casts(): array + { + return [ + 'order_date' => 'date', + 'egg_quantity' => 'integer', + 'unit_price' => 'integer', + 'total_amount' => 'integer', + 'discount' => 'integer', + ]; + } public function customer(): BelongsTo {