https://g.co/gemini/share/fb345a50575a
// src/Entity/Author.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
#[Assert\Collection(
fields: [
'personal_email' => new Assert\Email,
'short_bio' => [
new Assert\NotBlank,
new Assert\Length(
max: 100,
maxMessage: 'Your short bio is too long!'
)
]
],
allowMissingFields: true,
)]
protected array $profileData = [
'personal_email' => '...',
'short_bio' => '...',
];
}Powered by Froala Editor