skip to Main Content

I did a fresh installation.

  • OS: Ubuntu Linux 22.04.1
  • Kernel: Linux 5.15.0-58-generic on x86_64
  • PHP 8.1.2
  • Symfony 6.2.6 (env: dev, debug: true)
  • Doctrine: 2.14.1

This is what I did to create an empty project with Symfony:

cd /var/www/html
symfony new <project>
cd <project>
composer req --dev symfony/profiler-pack
composer req maker doctrine twig asset

Server (symfony server:start) is working fine. Profiler also.

But maker does not know about repositories.

php bin/console make:repository
[critical] Error thrown while running command "’make:repository’".
Message: "Command "make:repository" is not defined.

What now?

2

Answers


  1. Chosen as BEST ANSWER

    This worked:

    php bin/console make:entity --regenerate App
    

    It generates the repository classes.

    God knows why.


  2. The repository is created only after the entity is created, namely, you must initially create the entity through the bin/console make:entity command, and only then will you have the repository created

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search