I was having this issue in Symfony 5 :
src/Entity/Order.php): failed to open stream: No such file or directory
when I tried to
make:entity
and Order, was going to be the name of my new entity.
What is causing the issue ?
I manually deleted an Entity named Order, a few days ago, from my Project because it didn't satisfy my needs back at the time. The Symfony application tries to autoload the old entity called Order (of which it kept track), but it doesn't exist since I deleted it. This prevents me from (re)creating a clean Order entity now.
What did I manually delete ?
- Entity
- Repository
- Crud Controller in EasyAdmin (+ everything linked to this entity)
What did I try ?
- Searching in VSC for Order.php files
- php bin/console make:entity --overwrite (to try and overwrite my Order entity)
- php bin/console cache:clear