Question

Whenever I made any changes on the construction method, I need to do bin/magento setup:di:compile to get any changes on my code. It was wasting my time, how can I get any changes faster than have to run that command, please?

enter image description here

Was it helpful?

Solution

setup:di:compile => Generates DI (Dependency injection) configuration and all missing classes that can be auto-generated

So whenever you change in constructor you need to run setup:di:compile command to generate auto-generated interceptor files in generated directory.

If you want to bypass this one for development phase you can edit it's interceptor file located in generated/code/Vendor/Module/...

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top