Displaying estimates

This commit is contained in:
2026-05-26 11:07:59 +02:00
parent fe3429cd4e
commit 575fb27018
10 changed files with 506 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Repositories;
use App\Models\CostUnit;
class EstimatesRepository {
public function getEstimates(CostUnit $costUnit, string $estimateType) : array {
$return = [];
foreach ($costUnit->estimates()->where('type', $estimateType)->get() as $estimate) {
$return[] = $estimate->toResource()->toArray(request());
}
return $return;
}
}