Symfony 4 - Multiple DataFixtures files
I recently upgraded a Symfony 3.3 application to Symfony 4
Part of the upgrade was loading the DataFixtures.
Symfony 4 recommends you put all your DataFixtures in a single file. I'll get around to that later. However, due to the way I organized the file system for the project, the Doctrine Fixtures Loader could not find the demo data.
To resolve the issue, I created a services_dev.yaml file with the following:
services:
App\DataFixtures\Demo\:
resource: '../src/DataFixtures/Demo/*'
tags: [ doctrine.fixture.orm ]
Once I added this file to the development server, the data loaded fine.
Ref: https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html#multiple-files
Print article | This entry was posted by elvis on 05/13/18 at 03:34:00 am . Follow any responses to this post through RSS 2.0. |