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
+2 -3
View File
@@ -825,9 +825,8 @@ public function show(ClientCase $clientCase)
}
// Get contracts using service
$contractsPerPage = request()->integer('contracts_per_page', 10);
$contracts = $this->caseDataService->getContracts($case, $segmentId, $contractsPerPage);
$contractIds = collect($contracts->items())->pluck('id')->all();
$contracts = $this->caseDataService->getContracts($case, $segmentId);
$contractIds = collect($contracts)->pluck('id')->all();
// Get activities using service
$activitiesPerPage = request()->integer('activities_per_page', 15);
+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();
}
/**