Skip to content

Commit 2b8948f

Browse files
author
Ferry Ariawan
committed
Fix Builder
1 parent 4f56be7 commit 2b8948f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Core/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Class Builder
88
* @package Crocodic\LaravelModel\Core
99
* @method \Illuminate\Database\Query\Builder addSelectTable(string $table)
10-
* @method \Illuminate\Database\Query\Builder with($table)
10+
* @method \Illuminate\Database\Query\Builder withTable($table)
1111
*/
1212
abstract class Builder extends \Illuminate\Database\Query\Builder
1313
{

src/Helpers/BuilderMacro.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static function registerMacro()
1616
return $this;
1717
});
1818

19-
Builder::macro("with", function($table) {
19+
Builder::macro("withTable", function($table) {
2020
/** @var Builder $this */
2121
if(is_array($table)) {
2222
foreach($table as $tbl) {
@@ -27,6 +27,7 @@ public static function registerMacro()
2727
$this->leftJoin($table, $table.".id", "=", $table."_id");
2828
$this->addSelectTable($table);
2929
}
30+
return $this;
3031
});
3132
}
3233
}

0 commit comments

Comments
 (0)