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+ ![ composer.json] ( images/composer.png )
9+
810``` text
911"dotkernel/dot-cache": "^4.0",
1012"ramsey/uuid": "^4.5.0",
@@ -45,6 +47,8 @@ After successfully installing our dependencies we now need to configure our Doct
4547
4648In the file ` config/autoload/local.php ` the structure would be updated like this:
4749
50+ ![ local.php] ( images/local.png )
51+
4852``` php
4953$databases = [
5054 'default' => [
@@ -80,6 +84,10 @@ This package takes all the provided configs from the `config/config.php` file an
8084
8185Our new ` src/App/src/ConfigProvider.php ` class would look like this now:
8286
87+ ![ config-provider-1] ( images/config-provider-1.png )
88+
89+ ![ config-provider-1] ( images/config-provider-2.png )
90+
8391``` php
8492public function __invoke(): array
8593{
@@ -191,6 +199,8 @@ return DependencyFactory::fromEntityManager(
191199Now that everything has been configured we only need to do one last thing, to create an executable for the Doctrine CLI.
192200In our case we will create a ` doctrine ` file inside the application's ` bin ` directory:
193201
202+ ![ doctrine] ( images/doctrine.png )
203+
194204``` php
195205#!/usr/bin/env php
196206<?php
@@ -214,6 +224,8 @@ ConsoleRunner::run(new SingleManagerProvider($entityManager));
214224(Optional) To keep things tidy, we recommend making an executable for the migrations of Doctrine as well.
215225For this, we create ` doctrine-migrations ` file inside the application's ` bin ` directory:
216226
227+ ![ doctrine-migrations] ( images/doctrine-migrations.png )
228+
217229``` php
218230#!/usr/bin/env php
219231<?php
0 commit comments