I like the way you deliver information. I like to have videos like this run while I am doing physical tasks like making breakfast. I listen and glance at the screen occasionally to soak up possibilities. Sometimes I will stop what I'm doing, rewind a bit, and focus in more detail. Other delivery types require you to follow along with the coding requiring too much focus to multitask. I find it helpful when learning new languages to be able to scan new approaches while multitasking. It kind of primes my mind to know what is possible so when I need that approach, I know it exists and go study how to implement it. Laravel is so feature rich it is easy to do things because someone said do it this way and not really know why you are doing it. This particular video is really helpful to understand why.
I cant thank you enough for the service you did to laravel comunity. When i search for something in laravel i wish i would come across a video made by you...
Love those explanations about the docs. Most of the times when somebody explains you instead of reading you understand the concept more. Please make more such video's.
@@LaravelDaily Could you make more detailed videos about polymorphic relationships with multiple user types? and filters by catefory like in e-commerce (Ik you have a video about this but i'd like to see a more detailed one)
My first mentioned of service provider was in Domain Driven Laravel book before then I used to ignore service providers. This video take it more deeper
Fantastic. “Convert into more practical, more readable human language with {real life} examples”. An entire movement can be created on this idea.Thanks and keep it up.
Thank you very much for exposing this topic, it is very important to know what is the use case to make a more standard code, greetings from Panama, keep up the good work.
I've been making my own packages now for a couple of years, even though they're not intended to be shared externally I like the process for compartmentalising aspects of my projects, and it makes bits easier to share between projects too. Would be good if you could do a video on making packages, just to make sure i'm still doing it all right :)
There are a lot of articles about how to create a package, not sure that I need a separate video on that, cause perhaps 1% of developers would actually create packages, and I'm trying to appeal to as broader audience as possible.
Found out dependency injection is not limited to service providers. You can actually call any method in your application using dependency injection. You can also bind any class name or interface name to an initialized object. For example, if you had several types of posts, but wanted to grab any injected post, or anything that resembles a post, you could have each model implement (PostThing) then use (PostThing) with implicit route binding. To take it a step further, you can call your methods using App::call to invoke a method with DI. There is so much to learn from the service provider architecture!
THX a lot for this explanation , ihope you explain to us where and in wich projects to use "API" and where to use the old "Database tables" to get the data ...
In my opinion using the register() method is kind of a "must", because in every well structured application there are always interfaces to bind to actual implementation classes
Hello dear Povilas, This video helped me a lot to learn more about the AppServiceProviders. Because I skipped the entire Architecture Concept chapter in laravel docs while learning. You know, it was kinda difficult for me to understand those concepts. By the way, it would be great if you can refer me to any of your playlist that explicitly covers the documentation part of laravel. Unfortunately I couldn’t find any specific playlist for that in this channel. Thanks!
I don't cover the documentation specifically, that's the whole point of what I'm doing here. I cover practical bits of real scenarios and questions, and then tie them to SOME parts in the docs, if necessary.
I don't think it's practical enough, in 99% of the projects no one really needs to know about containers or how they work. On this channel, I'm trying to be as practical as possible.
Povilas, would you be able to approach the concept of multi-tenancy with multi-databases? I am studying this concept for a project but I am stuck. In his 'Practical Roles and Permissions in Laravel' course I was able to understand the basic multi-tenancy process, but I believe that I need to broaden my understanding of Laravel's request lifecycle and know WHERE I interfere to switch connections to the database for their respective tenant. I'm sorry for the long text, but I believe I can learn anything from you by explaining the topic. I'm sorry for the long text and thanks for another clarifying video.
If I have and contract and 2 classes impements that contract, if I make 2 binds in any serviceProvider, but in my controller I call app(MyContract::class)->getData(), which classe will be called in some situation like that?
This is another problem I have with the Laravel docs. It constantly says "you may", it needs to say "you can". And it ultimately needs to say "if you want to do this, here is the recommended way to do this".
thanks , it will be good if u explan more deep service containers , for me as a newcomer service containers are most hard topic to understand how it works
Actually changing the order of the providers won't have any effect in application layer. Because in application layer, you define aliases. You bind aliases, mostly singletons. Aliases are just names, it will resolve after the requests are made. Your statement is wrong: "In theory, if we change the order It may break something" . No it wont break anything; if you change the order of the service providers in config/app.php Regards.
Pov, if I have a service/utility class I use in various places, do service providers help me use these more efficiently, or should I just continue with my service classes? Can you give an example where a service class makes more sense to use via a service provider?
@@LaravelDaily Well, that doesn't answer my question, Pov. That's like saying I'm too stupid to understand your video. I'm a subscriber to your channel and it was a genuine question. I expected a better answer even if it makes me look stupid. Your answer just makes you look stupid.
Sorry, I didn't mean anything insulting. I meant that service providers are not for service classes, although they share the same word "service". They are just for configuration things, like I mentioned in this video. So if you don't see what global configurations could be set for your service/utility classes, you shouldn't look for the use-case to adopt this service provider thing. And I think it's a genuine logic in all design patterns: if you don't EXACTLY know what you would use the pattern for, then you probably shouldn't use it. Again, not saying it in insulting way, I think it's a normal statement, sorry if it made you feel bad.
@@LaravelDaily I'm not confused by the word service. We could use any word for abstractions of functionality. The question obviously is if I have a certain functionality that I use in several places, is there a reason I should place it in a service provider as opposed to in a service class.
I don't really understand how would you place the repeating functionality there. Service provider is for CONFIGURATION, not for putting FUNCTIONALITY inside of them.
So service providers can be imagined basically like huge configuration arrays, where bindings for dependancy injections and other configurations are registered? Am I right?
I don't feel that service container is a practical enough thing, only small amount of developers actually need them. I'm trying to be practical as much as possible
I like the way you deliver information. I like to have videos like this run while I am doing physical tasks like making breakfast. I listen and glance at the screen occasionally to soak up possibilities. Sometimes I will stop what I'm doing, rewind a bit, and focus in more detail. Other delivery types require you to follow along with the coding requiring too much focus to multitask.
I find it helpful when learning new languages to be able to scan new approaches while multitasking. It kind of primes my mind to know what is possible so when I need that approach, I know it exists and go study how to implement it.
Laravel is so feature rich it is easy to do things because someone said do it this way and not really know why you are doing it. This particular video is really helpful to understand why.
I cant thank you enough for the service you did to laravel comunity. When i search for something in laravel i wish i would come across a video made by you...
Love those explanations about the docs. Most of the times when somebody explains you instead of reading you understand the concept more. Please make more such video's.
Any exact topics you would suggest? :)
@@LaravelDaily maybe Queues? Or how to use the API Documentation? Just thinking out loud.
Yes queues are in plans. Api docs were kinda covered here and there but maybe will repeat with different examples.
@@LaravelDaily Could you make more detailed videos about polymorphic relationships with multiple user types? and filters by catefory like in e-commerce (Ik you have a video about this but i'd like to see a more detailed one)
@@LaravelDaily Yes jobs, queues, schedulers
Really appreciate your topic selection. Exceptional content.
I'm so happy I found your channel. Your comment is making me a better developer
Your videos are the best for explaining the concept with practical real world examples.
My first mentioned of service provider was in Domain Driven Laravel book before then I used to ignore service providers. This video take it more deeper
at this point, your videos gonna be my breakfast before going to work lol. thanks for sharing
His video is for me during my lunch break lmao
Fantastic. “Convert into more practical, more readable human language with {real life} examples”. An entire movement can be created on this idea.Thanks and keep it up.
Thank you very much for exposing this topic, it is very important to know what is the use case to make a more standard code, greetings from Panama, keep up the good work.
I've been making my own packages now for a couple of years, even though they're not intended to be shared externally I like the process for compartmentalising aspects of my projects, and it makes bits easier to share between projects too. Would be good if you could do a video on making packages, just to make sure i'm still doing it all right :)
There are a lot of articles about how to create a package, not sure that I need a separate video on that, cause perhaps 1% of developers would actually create packages, and I'm trying to appeal to as broader audience as possible.
Appreciate the work you put into to this. Even though I am experienced with Laravel I learn new things everyday thanks to your videos
Found out dependency injection is not limited to service providers. You can actually call any method in your application using dependency injection. You can also bind any class name or interface name to an initialized object. For example, if you had several types of posts, but wanted to grab any injected post, or anything that resembles a post, you could have each model implement (PostThing) then use (PostThing) with implicit route binding. To take it a step further, you can call your methods using App::call to invoke a method with DI. There is so much to learn from the service provider architecture!
Very clean explanation, thank you!
THX a lot for this explanation , ihope you explain to us where and in wich projects to use "API" and where to use the old "Database tables" to get the data ...
In my opinion using the register() method is kind of a "must", because in every well structured application there are always interfaces to bind to actual implementation classes
I do to share your opinion, Dependency Inversion Principle is really easy in Laravel through Registering Interfaces in Services.
thank u for the clarity
Hello dear Povilas,
This video helped me a lot to learn more about the AppServiceProviders. Because I skipped the entire Architecture Concept chapter in laravel docs while learning. You know, it was kinda difficult for me to understand those concepts.
By the way, it would be great if you can refer me to any of your playlist that explicitly covers the documentation part of laravel.
Unfortunately I couldn’t find any specific playlist for that in this channel.
Thanks!
I don't cover the documentation specifically, that's the whole point of what I'm doing here. I cover practical bits of real scenarios and questions, and then tie them to SOME parts in the docs, if necessary.
@@LaravelDaily that make sense. Thank you again!
You are so amazing at laravel
awesome, please do talk about service containers too👌
I don't think it's practical enough, in 99% of the projects no one really needs to know about containers or how they work. On this channel, I'm trying to be as practical as possible.
@@LaravelDaily oh, I see. i've always hear some people say its essential to know how service containers work thats why I got curious about it
Thank you for your video. Could you explain the Service Container in a new video? What is it and why do we need it?
Wonderful video! Keep up the great work
Yeah, I've mentioned it at the end of the video.
@@LaravelDaily Oh man I am sorry! Came back to the tab and video was over, missed that @_@
Povilas, would you be able to approach the concept of multi-tenancy with multi-databases? I am studying this concept for a project but I am stuck. In his 'Practical Roles and Permissions in Laravel' course I was able to understand the basic multi-tenancy process, but I believe that I need to broaden my understanding of Laravel's request lifecycle and know WHERE I interfere to switch connections to the database for their respective tenant. I'm sorry for the long text, but I believe I can learn anything from you by explaining the topic. I'm sorry for the long text and thanks for another clarifying video.
Quite recently I've done video reviewing another project of multi tenancy with multi-database, please search the channel
@@LaravelDaily Dude, I missed it! Very enlightening! Thank you, Povilas!
Thank You for Your work.
Thanks a lot. Exactly what i needed
Great video, thank you!
Nice attempt
Good video, thanks!
If I have and contract and 2 classes impements that contract, if I make 2 binds in any serviceProvider, but in my controller I call app(MyContract::class)->getData(), which classe will be called in some situation like that?
This is another problem I have with the Laravel docs. It constantly says "you may", it needs to say "you can". And it ultimately needs to say "if you want to do this, here is the recommended way to do this".
Hi Sir, how do call the Auth::user() inside the boot method of AppServiceProvider, mine is giving me NULL everytime
thank you very much
Awesome sir.
thanks , do you have a video about service containers?
Similar topic is in this video: ruclips.net/video/Ti0lHeqVSV0/видео.html
thanks , it will be good if u explan more deep service containers , for me as a newcomer service containers are most hard topic to understand how it works
As a newcomer, I don't think you need that deep knowledge.
So,let's say we have a crud system , instead of doing the whole stuff we want to do in the controller we can use observers ?
Not really, observers are for narrow case of watching the changes on models
Actually changing the order of the providers won't have any effect in application layer. Because in application layer, you define aliases. You bind aliases, mostly singletons. Aliases are just names, it will resolve after the requests are made. Your statement is wrong: "In theory, if we change the order It may break something" .
No it wont break anything; if you change the order of the service providers in config/app.php
Regards.
Thanks. Browser need to update the indicator show in google chrome.
Pov, if I have a service/utility class I use in various places, do service providers help me use these more efficiently, or should I just continue with my service classes? Can you give an example where a service class makes more sense to use via a service provider?
Rule of thumb: if you don't know how/why you would use service providers, you don't need them :)
@@LaravelDaily Well, that doesn't answer my question, Pov. That's like saying I'm too stupid to understand your video. I'm a subscriber to your channel and it was a genuine question. I expected a better answer even if it makes me look stupid. Your answer just makes you look stupid.
Sorry, I didn't mean anything insulting. I meant that service providers are not for service classes, although they share the same word "service". They are just for configuration things, like I mentioned in this video. So if you don't see what global configurations could be set for your service/utility classes, you shouldn't look for the use-case to adopt this service provider thing.
And I think it's a genuine logic in all design patterns: if you don't EXACTLY know what you would use the pattern for, then you probably shouldn't use it. Again, not saying it in insulting way, I think it's a normal statement, sorry if it made you feel bad.
@@LaravelDaily I'm not confused by the word service. We could use any word for abstractions of functionality.
The question obviously is if I have a certain functionality that I use in several places, is there a reason I should place it in a service provider as opposed to in a service class.
I don't really understand how would you place the repeating functionality there. Service provider is for CONFIGURATION, not for putting FUNCTIONALITY inside of them.
So service providers can be imagined basically like huge configuration arrays, where bindings for dependancy injections and other configurations are registered? Am I right?
Kind of. It's just not limited to arrays so you can use other PHP/Laravel classes there.
@@LaravelDaily I see. Thanks for reply
Can you create a course on how to make laravel Package?
laravelpackage.com/#reasons-to-develop-a-package this is the best free course about it
Very interesting
In what platform is building your teachabhle aplication?¿
I didn't build Teachable, it's an online service that I pay $99 / month for.
@@LaravelDaily Thanks for info 🤔
02:45 ♥️
Auth::user() always null when I use in boot () method
excellent
greate
First person to view!!!
Please, is this the same as Service Container?
No
@@LaravelDaily Would you please make a tutorial on Service Container soon?
I don't feel that service container is a practical enough thing, only small amount of developers actually need them. I'm trying to be practical as much as possible
ну и бред же это всё
Great video, thank you!