Remove laravel pagination from contract table / ClientCase view and used replacing it with client pagination

This commit is contained in:
Simon Pocrnjič
2026-02-14 21:05:01 +01:00
parent dda118a005
commit 245caea4dc
6 changed files with 31 additions and 38 deletions
+3 -4
View File
@@ -11,9 +11,9 @@
class ClientCaseDataService
{
/**
* Get paginated contracts for a client case with optional segment filtering.
* Get contracts for a client case with optional segment filtering.
*/
public function getContracts(ClientCase $clientCase, ?int $segmentId = null, int $perPage = 50): LengthAwarePaginator
public function getContracts(ClientCase $clientCase, ?int $segmentId = null): Collection
{
$query = $clientCase->contracts()
->select(['id', 'uuid', 'reference', 'start_date', 'end_date', 'description', 'meta', 'active', 'type_id', 'client_case_id', 'created_at'])
@@ -40,9 +40,8 @@ public function getContracts(ClientCase $clientCase, ?int $segmentId = null, int
$query->forSegment($segmentId);
}
$perPage = max(1, min(100, $perPage));
return $query->paginate($perPage, ['*'], 'contracts_page')->withQueryString();
return $query->get();
}
/**