added timestamp to avatar

This commit is contained in:
tracer 2022-11-03 19:04:12 +01:00
parent e8327f9de0
commit ce8867465f

View File

@ -27,7 +27,7 @@ class UserCrudController extends AbstractCrudController
yield ImageField::new(propertyName: 'avatar')
->setBasePath(path: 'uploads/avatars')
->setUploadDir(uploadDirPath: 'public/uploads/avatars')
->setUploadedFileNamePattern(patternOrCallable: '[timestamp]-[slug].[extension]');
->setUploadedFileNamePattern(patternOrCallable: '[slug]-[timestamp].[extension]');
$roles = ['ROLE_FOUNDER', 'ROLE_ADMIN', 'ROLE_MODERATOR', 'ROLE_USER'];
yield ChoiceField::new(propertyName: 'roles')
->setChoices(choiceGenerator: array_combine(keys: $roles, values: $roles))