Created
July 16, 2020 13:07
-
-
Save spresnac/70448cdf5bbd88b527f2befa392492f3 to your computer and use it in GitHub Desktop.
Prevent the Builder to execute with duplicate joins (causes mariadb error)
This file contains hidden or 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
/** @var Builder $result */ | |
// try to prevent duplicate joins that will cause an error on execute | |
$result->getQuery()->joins = collect($result->getQuery()->joins)->unique('table')->toArray(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment