55The first step is to add alongside your current packages the required entries for our Doctrine installation.
66We would add the following to our ` composer.json ` file located in our root folder:
77
8- <img src =" images/composer.png " width =" 640 " >
9-
108``` text
119"dotkernel/dot-cache": "^4.0",
1210"ramsey/uuid": "^4.5.0",
@@ -47,8 +45,6 @@ After successfully installing our dependencies we now need to configure our Doct
4745
4846In the file ` config/autoload/local.php ` the structure would be updated like this:
4947
50- <img src =" images/local.png " width =" 550 " >
51-
5248``` php
5349$databases = [
5450 'default' => [
@@ -84,10 +80,6 @@ This package takes all the provided configs from the `config/config.php` file an
8480
8581Our new ` src/App/src/ConfigProvider.php ` class would look like this now:
8682
87- <img src =" images/config-provider-1.png " width =" 620 " >
88- <br />
89- <img src =" images/config-provider-2.png " width =" 620 " >
90-
9183``` php
9284public function __invoke(): array
9385{
@@ -171,7 +163,7 @@ private function getDoctrineConfig(): array
171163We also require a new file ` config/cli-config.php ` .
172164It initializes and returns a ` DependencyFactory ` that Doctrine Migrations uses to run migrations.
173165
174- < img src = " images/cli-config.png " width = " 620 " >
166+ ![ cli-config ] ( images/cli-config.png )
175167
176168``` php
177169<?php
@@ -199,8 +191,6 @@ return DependencyFactory::fromEntityManager(
199191Now that everything has been configured we only need to do one last thing, to create an executable for the Doctrine CLI.
200192In our case we will create a ` doctrine ` file inside the application's ` bin ` directory:
201193
202- <img src =" images/doctrine.png " width =" 620 " >
203-
204194``` php
205195#!/usr/bin/env php
206196<?php
@@ -224,8 +214,6 @@ ConsoleRunner::run(new SingleManagerProvider($entityManager));
224214(Optional) To keep things tidy, we recommend making an executable for the migrations of Doctrine as well.
225215For this, we create ` doctrine-migrations ` file inside the application's ` bin ` directory:
226216
227- <img src =" images/doctrine-migrations.png " width =" 640 " >
228-
229217``` php
230218#!/usr/bin/env php
231219<?php
0 commit comments