UserResource class), promoting separation of concerns between domain logic and API representation.nocarrier/hal (v0.9.4), which may introduce compatibility risks with newer versions.nocarrier/hal (abandoned in 2014). Modern alternatives (e.g., api-platform/core) offer better support.behat, phpunit).Serializer + custom normalizers) would be costly.behat@2.5, phpunit@3.7) may not work with current CI/CD pipelines.nelmio/api-doc-bundle, api-platform/core) for HAL support?symfony/flex, symfony/ux) will not integrate cleanly.symfony/serializer + custom normalizers for HAL.spatie/hal or darkaonline/l5-swagger for HAL support.composer.lock) to avoid updates.HttpClient) to forward requests to the legacy bundle and transform responses for modern clients.# config/packages/api_platform.yaml
api_platform:
formats:
jsonhal: ['application/hal+json']
resources:
- App\Entity\User
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
class HalNormalizer implements ContextAwareNormalizerInterface {
public function normalize($object, string $format, array $context = []): array {
return [
'_links' => [
'self' => ['href' => '/users/1']
],
'data' => $object->toArray()
];
}
}
@Route). Modern Symfony uses YAML/XML/PHP attributes.nocarrier/hal (v0.9.4) is incompatible with modern PHP. Replace with a polyfill or fork.behat@2.5 and phpunit@3.7 require polyfills or replacement with symfony/panther and phpunit@9.composer require with --ignore-platform-reqs to bypass PHP version checks.behat in a PHP 5.3 container (e.g., php:5.3-apache).HttpCache) or async features.haproxy).doctrine/dbal connection pooling).nocarrier/hal or behat dependencies break, the bundle may fail silently.addLink) may produce malformed URIs if router changes.How can I help you explore Laravel packages today?