mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 17:24:10 +00:00
Currency dropdowns now display the most-traded currencies (USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, INR, BRL) at the top, followed by the rest alphabetically. The install wizard defaults to USD instead of EUR and formats currency names as "USD - US Dollar" for consistency with the rest of the app.
24 lines
622 B
PHP
24 lines
622 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\CurrencyResource;
|
|
use App\Services\CurrencyService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
|
|
|
|
class CurrenciesController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly CurrencyService $currencyService,
|
|
) {}
|
|
|
|
public function __invoke(Request $request): AnonymousResourceCollection
|
|
{
|
|
$currencies = $this->currencyService->getAllWithCommonFirst();
|
|
|
|
return CurrencyResource::collection($currencies);
|
|
}
|
|
}
|