Files
Obsidian-Vault/Career/Others/Laravel relationships.md
2025-10-25 20:11:21 +02:00

556 B

created, updated
created updated
2025-02-06 11:23 2025-07-04 07:36

belongsToMany

Argument query belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null)

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