Once you update your
__construct method, a lot of developers do
bin/magento setup:di:compile. You don’t have to do this actually, you only need to delete all files inside generated directory but
.htaccess by running this command :
rm -rf generated/*
Then go get to your browser, and refresh. Voila you get your
It’s only working on developer mode. On production or default mode, you still have to do
bin/magento setup:di:compile for every changes you make.