Allow uploading images

This commit is contained in:
2024-06-11 20:40:01 +02:00
parent 8859cd0000
commit 361c4fd0a3
11 changed files with 280 additions and 2 deletions

View File

@@ -18,4 +18,5 @@ return [
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
];

View File

@@ -0,0 +1,11 @@
vich_uploader:
db_driver: orm
metadata:
type: attribute
mappings:
posts:
uri_prefix: /images/posts
upload_destination: '%kernel.project_dir%/public/images/posts'
namer: Vich\UploaderBundle\Naming\SmartUniqueNamer