From 0c2bed605f02471b654a64c1232a148e2682b03b Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 14 Aug 2024 19:33:06 +0100 Subject: [PATCH] Added plural relationship Signed-off-by: snipe --- app/Models/AccessoryCheckout.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Models/AccessoryCheckout.php b/app/Models/AccessoryCheckout.php index 0bcc55b3a8..1881ff6c29 100755 --- a/app/Models/AccessoryCheckout.php +++ b/app/Models/AccessoryCheckout.php @@ -39,7 +39,12 @@ class AccessoryCheckout extends Model */ public function accessory() { - return $this->hasOne(Accessory::class, 'accessory_id'); + return $this->hasOne(Accessory::class, 'id', 'accessory_id'); + } + + public function accessories() + { + return $this->hasMany(Accessory::class, 'id', 'accessory_id'); } /**