I just found this gem video. I was looking to understand how all these functionalities come to laravel. Lucky I found this video and understand it's all from laravel container via dependency injection. huge thank to you!
4 года назад+1
Teddy Perera Hey Teddy. Thanks so much for leaving a comment. I really, really appreciate it. ❤️
Could you please explain how can I achieve for the following in laravel 8 . 1. Dependency Injection - Use dependency injection for locating controllers for Development and production environment. 2. Dependency Injection - for setting parameters for the Dev and Production environment.
You could also do the if else statement inside of the bind function like this: app()->bind(Gateway::class, function($app) { if(country == 'us'){ return new StripeGateway(); } else { return new PaypalGateway(); } });
I just need to understand one thing... where in laravel is the app () function declared?? It seems it's an alias to Applications class .. please explain to me how it is called
5 лет назад+1
It's a default helper on Laravel. It just returns the Container instance when called without params.
Thank you so much, this was very helpful. It clearified my confusion with service containers.
I just found this gem video. I was looking to understand how all these functionalities come to laravel. Lucky I found this video and understand it's all from laravel container via dependency injection.
huge thank to you!
Teddy Perera Hey Teddy.
Thanks so much for leaving a comment. I really, really appreciate it. ❤️
Nice explanation 👌
I just found your channel. Looks like you have some important deep dive topics covered.
Thank you.
This video makes me feel like everything I thought I knew was wrong
Nice and informative video, could you increase the sound volume and decrease the noise. Other than that it's great.
Hey Ram, the newer videos should have better audio quality. Thanks!
Could you please explain how can I achieve for the following in laravel 8 . 1. Dependency Injection - Use dependency injection for locating controllers for Development and production environment. 2. Dependency Injection - for setting parameters for the Dev and Production environment.
Saved me, thanks.
Glad you liked it
this is pretty good
You could also do the if else statement inside of the bind function like this:
app()->bind(Gateway::class, function($app) {
if(country == 'us'){
return new StripeGateway();
} else {
return new PaypalGateway();
}
});
I just need to understand one thing... where in laravel is the app () function declared?? It seems it's an alias to Applications class .. please explain to me how it is called
It's a default helper on Laravel. It just returns the Container instance when called without params.
@ thank you I now understand
solid, thanks
nice! thanks!