sorry but the definition of DI using the invoke method is wrong, invoke method needs a Request parameter, that's not DI, DI is when the whole class depend upon another module to be able to execute its logic, and there are two ways to achieve this, one is what you mentioned about constructor injection and other ways are by for example having a method to inject the dependencies (setter injection)
Is it so? So, if I have a route which is calling a single method class and we are loading the request class then what will it be? It's possible that my concept on that can be wrong. But if that's the case then I need to understand so that I can correct myself. Thanks for pointing that out.
@@amitavroydev __invokes are still methods, like any other method, and methods may or may not require parameters which is not the same as DI, but there are some cases as I explained in my previous comment where you inject dependencies through setters (methods), but these methods are usually used by frameworks to inject dependencies on runtime or compilation
Hey hi awesome content again. If possible could you please do couple of videos on Testing, Test Doubles, Laravel Roles and Permissions, Security. I know it's lot of them, just a kind of suggestions for your upcoming videos. And hope many of them expects them too