Expand test coverage and improve transaction management code.

This commit is contained in:
James Cole
2019-07-01 20:22:35 +02:00
parent 94acb50a6f
commit 5bbe1eab7c
63 changed files with 1251 additions and 812 deletions

View File

@@ -647,9 +647,13 @@ class BudgetRepository implements BudgetRepositoryInterface
*/
public function searchBudget(string $query): Collection
{
$query = sprintf('%%%s%%', $query);
return $this->user->budgets()->where('name', 'LIKE', $query)->get();
$search = $this->user->budgets();
if ('' !== $query) {
$search->where('name', 'LIKE', sprintf('%%%s%%', $query));
}
return $search->get();
}
/**