<?php
declare(strict_types=1);
namespace App\Controller\Api;
use App\Service\AvailableCountriesProvider;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
#[Route(path: '/location')]
class LocationController extends AbstractController
{
#[Route(
path: '/available-countries',
name: 'api_get_available_countries',
options: ['expose' => true],
methods: ['GET'])
]
public function availableCountries(AvailableCountriesProvider $availableCountriesProvider): JsonResponse
{
return $this->json(['countries' => $availableCountriesProvider->provide()]);
}
}