# How to integrate Doctrine into a Zend-Expressive project?

**URL:** https://discourse.laminas.dev/t/how-to-integrate-doctrine-into-a-zend-expressive-project/1840
**Category:** Mezzio
**Created:** [September 21, 2020, 5:29pm UTC](https://discourse.laminas.dev/t/how-to-integrate-doctrine-into-a-zend-expressive-project/1840 "2020-09-21T17:29:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![michele74](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@michele74](https://discourse.laminas.dev/u/michele74)
#### Post date: [September 21, 2020, 5:29pm UTC](https://discourse.laminas.dev/t/how-to-integrate-doctrine-into-a-zend-expressive-project/1840/1 "2020-09-21T17:29:57Z")

</div>

I have created a zend-expressive project, I would like to integrate Doctrine, I am using this documentation

> **[Generating HAL for Doctrine Entities - zend-expressive-hal - Zend Framework Docs](https://docs.zendframework.com/zend-expressive-hal/doctrine/)**

but I get this error:

Too few arguments to function Album \ Handler \ ListAlbumsHandler :: \_\_ construct (), 0 passed in C: \ xampp \ htdocs \ expressive \ vendor \ zendframework \ zend-expressive \ src \ MiddlewareContainer.php on line 64 and exactly 4 expected

what did i do wrong?

---

<div class="post-metadata">

### Author: ![xtreamwayz](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/xtreamwayz/32/27_2.png) [@xtreamwayz](https://discourse.laminas.dev/u/xtreamwayz)
#### Post date: [September 21, 2020, 6:34pm UTC](https://discourse.laminas.dev/t/how-to-integrate-doctrine-into-a-zend-expressive-project/1840/2 "2020-09-21T18:34:01Z")

</div>

First of all, you might want to read the latest docs here: [https://docs.mezzio.dev/mezzio-hal/doctrine/](https://docs.mezzio.dev/mezzio-hal/doctrine/)  
zend-expressive is renamed to mezzio and the zend-expressive components will not get any more updates.

Without seeing any code and only that error message, I’m guessing you forgot to create a factory for the album handler and add it to the service container. You can find more information about factories here: [https://docs.mezzio.dev/mezzio/v3/features/container/config/#factories](https://docs.mezzio.dev/mezzio/v3/features/container/config/#factories)
