skip to Main Content

Php – Symfony 6 Validation Constraints: How to assert that a string has exact length 4

Here is my simplified class of my DTO which is filled by the Serializer: <?php namespace AppApiDto; use OpenApiAttributes as OA; use SymfonyComponentSerializerAnnotationGroups as SerializerGroups; use SymfonyComponentValidatorConstraints as Assert; #[OASchema()] readonly class WorkHour implements DtoInterface { public function __construct( #[OAProperty(description:…

VIEW QUESTION

Php – Symfony Doctrine have two property for the same column in database

Here's a sample entity use ApiPlatformMetadataApiResource; use DoctrineORMMapping as ORM; use SymfonyComponentSerializerAnnotationGroups; #[ORMTable(name: 'user')] #[ApiResource( operations: [new GetCollection()], normalizationContext: [ 'groups' => [ 'user:id', 'user:score', 'user:user_score', ], ] )] class User { #[ORMId] #[ORMGeneratedValue] #[ORMColumn(name: 'ID_USER', type: 'integer')] #[Groups(groups: ['user:id'])]…

VIEW QUESTION

Php – Symfony 6 website skeleton 404 for controller

I am trying out Symfony the first time. I installed it with composer create-project symfony/website-skeleton crudapp I have an Apache config like this: <VirtualHost *:80> ServerName localhost DocumentRoot "c:/.../Symfony/crudapp/public/" <Directory "c:/.../Symfony/crudapp/public/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local…

VIEW QUESTION
Back To Top
Search