This commit is contained in:
2025-10-15 14:52:43 +03:00
parent 75790377c4
commit 7d82f5ba39
3 changed files with 22 additions and 3 deletions
+15 -3
View File
@@ -8,12 +8,24 @@ use App\Services\RateService;
class RateController extends Controller
{
public function __invoke( RateService $rateService)
public function __invoke(RateService $rateService)
{
$rates = $rateService->getFormattedRates();
return view('rates', [
'rates' => $rates,
return view('rates', [
'rates' => $rates,
]);
}
public function api(RateService $rateService)
{
$rates = $rateService->getFormattedRates();
return response()->json([
'data' => $rates->items(),
'next_page_url' => $rates->nextPageUrl(),
'path' => $rates->path(),
'per_page' => $rates->perPage(),
]);
}
}