Skip to content

Commit dc7d7d6

Browse files
committed
Updates
+ fix base repository dd method to not require an array param + fix fiels from post/put to allow any field/relation in allowd fields + parser for sort now uses a left join
1 parent f283fc5 commit dc7d7d6

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/Contracts/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected function parseJoinSorts(Collection $sorts)
149149

150150
$withTableName = strpos($withTable, '.') === false ? $withConnection.'.'.$withTable : $withTable;
151151

152-
$this->repository->join($withTableName, "{$withTableName}.{$foreignKey}", "{$currentTable}.{$localKey}");
152+
$this->repository->leftJoin($withTableName, "{$withTableName}.{$foreignKey}", "{$currentTable}.{$localKey}");
153153
$this->repository->orderBy("{$withTableName}.{$key}", $sortD);
154154
}
155155
}

src/Helpers.php

-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ protected static function fieldsFromPutPost($request, $fields): array
170170
if (in_array($key, $fields)) {
171171
return false;
172172
}
173-
if (! is_array($item) && ! is_object($key)) {
174-
return false;
175-
}
176173

177174
return true;
178175
})->map(function ($item, $key) {

src/Repository/BaseRepository.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ public function get(array $columns = ['*'])
254254
return $models;
255255
}
256256

257-
public function dd(array $columns = ['*'])
257+
public function dd()
258258
{
259259
$this->newQuery()->eagerLoad()->setClauses()->setScopes();
260-
$this->query->dd($columns);
260+
$this->query->dd();
261261
}
262262

263263
public function getRaw(array $columns = ['*'])

0 commit comments

Comments
 (0)