Skip to content

Added ability to define pivot constraints

Choose a tag to compare

@tylernathanreed tylernathanreed released this 07 Jul 14:56
· 177 commits to master since this release
4dbec41

Includes query scope and soft deletion. Supported for Has One/Many Through and Belongs to Many relations.

Example:

// Adding pivot ("role_user") constraints for a "Belongs to Many" relation
User::query()->joinRelation('roles', function ($join, $pivot) {
    $pivot->where('domain', '=', 'web');
});