Skip to content

A free open source IT asset/license management system

Revert hasMany “fix”

snipe15c96f753c2b
diff --git a/app/Models/PredefinedKit.php b/app/Models/PredefinedKit.php
index 42dfdd9377..2d0c87066e 100644
--- a/app/Models/PredefinedKit.php
+++ b/app/Models/PredefinedKit.php
@@ -189,7 +189,7 @@ class PredefinedKit extends SnipeModel
*/
public function accessories()
{
- return $this->hasMany(\App\Models\Accessory::class, 'accessory_id', 'kit_id')->withPivot('id', 'quantity');
+ return $this->belongsToMany(\App\Models\Accessory::class, 'kits_accessories', 'kit_id', 'accessory_id')->withPivot('id', 'quantity');
}
/**