Skip to content

Commit f8db2b3

Browse files
committed
check null on callback method with
1 parent bcdcdc5 commit f8db2b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BaseQueryBuilderExtend.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ public function delete(): int
104104
*/
105105
public function with(array|string $relations, Closure|null|string $callback = null): BaseQueryBuilder
106106
{
107-
$this->builder->with($relations, $callback);
107+
if (is_null($callback)) {
108+
$this->builder->with($relations);
109+
} else {
110+
$this->builder->with($relations, $callback);
111+
}
108112
return $this->baseQueryBuilder;
109113
}
110114

0 commit comments

Comments
 (0)