Init
This commit is contained in:
11
Career/Others/Laravel relationships.md
Normal file
11
Career/Others/Laravel relationships.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
created: 2025-02-06 11:23
|
||||
updated: 2025-07-04 07:36
|
||||
---
|
||||
### belongsToMany
|
||||
|
||||
Argument query
|
||||
belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null)
|
||||
```mysql
|
||||
select `related_table`.*, `table`.`foreignPivotKey` as `pivot_foreignPivotKey`, `table`.`relatedPivotKey` as `pivot_relatedPivotKey` from `networks` inner join `table` on `networks`.`relatedKey` = `table`.`relatedPivotKey` where `table`.`foreignPivotKey` in (?) and `related_table`.`deleted_at` is null
|
||||
```
|
||||
Reference in New Issue
Block a user