Merge remote-tracking branch 'origin/master' into Development

This commit is contained in:
Simon Pocrnjič
2026-01-05 20:45:18 +01:00
4 changed files with 19 additions and 3 deletions
+7 -2
View File
@@ -64,6 +64,12 @@ public function show(Segment $segment)
->withQueryString();
$contracts = $this->hydrateClientShortcut($contracts);
// Hide addresses array since we're using the singular address relationship
$contracts->getCollection()->each(function ($contract) {
$contract->clientCase?->person?->makeHidden('addresses');
$contract->clientCase?->client?->person?->makeHidden('addresses');
});
$clients = Client::query()
->whereHas('clientCases.contracts.segments', function ($q) use ($segment) {
@@ -191,8 +197,7 @@ private function buildContractsQuery(Segment $segment, ?string $search, ?string
->where('contract_segment.active', '=', 1);
})
->with([
'clientCase.person',
'clientCase.client.person',
'clientCase.person.address',
'type',
'account',
])