-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x] Make the
firstOrCreate
methods in relations use `createOrFir…
…st` behind the scenes (#48192) * Use createOrFirst inside firstOrCreate in BelongsToMany relations This should be the same but more robust, since it handles race conditions as well * Use createOrFirst too inside HasOneOrMany relations This should essentially be the same as before, but more robust * Fix tests using mocks * Ensure the firstOrCreate method handles unique violation when just attaching * Fix style * Update BelongsToMany.php --------- Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
27958eb
commit 24cbb80
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters