Mercurial > packages > magicforger
annotate src/Generator/Model/snippets/belongs_to_many_relation.stub @ 28:f88d2d5dee30 codex
Updated inputs and routes
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Mon, 09 Jun 2025 19:51:31 -0400 |
| parents | 827efbf4d73c |
| children |
| rev | line source |
|---|---|
|
23
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
1 |
|
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
2 public function {{relationName}}() |
|
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
3 { |
|
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
4 return $this->belongsToMany({{relatedModel}}::class, '{{pivotTable}}', '{{foreignPivotKey}}', '{{relatedPivotKey}}'); |
|
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
5 } |
|
827efbf4d73c
Huge changes to the relationships for models and more complex
Luka Sitas <sitas.luka.97@gmail.com>
parents:
diff
changeset
|
6 |
