Skip to content

Commit 0b936e2

Browse files
author
Admin
committed
Fix eager load
1 parent 8c5e211 commit 0b936e2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Providers/CrudProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ function (
145145
);
146146

147147
Relation::macro('noConstraintsForRelationName', function (?string $relation = null): ?string {
148+
if (\property_exists(Relation::class, 'noConstraintsForRelationName')) {
149+
if (\func_num_args() === 0) {
150+
return static::noConstraintsForRelationName;
151+
}
152+
153+
return static::noConstraintsForRelationName = $relation;
154+
}
155+
148156
global $noConstraintsForRelationName;
149157

150158
if (\func_num_args() === 0) {

0 commit comments

Comments
 (0)