diff src/Generator/Model/snippets/belongs_to_many_relation.stub @ 34:f65ab84ee47f default

merge with codex
author luka
date Wed, 10 Sep 2025 21:00:47 -0400
parents 827efbf4d73c
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Generator/Model/snippets/belongs_to_many_relation.stub	Wed Sep 10 21:00:47 2025 -0400
@@ -0,0 +1,6 @@
+
+public function {{relationName}}()
+{
+    return $this->belongsToMany({{relatedModel}}::class, '{{pivotTable}}', '{{foreignPivotKey}}', '{{relatedPivotKey}}');
+}
+