.Morph3us.'s avatar

Service provider confusion

Hi guys, I want to understand better the service container functionality and I am developing a test app in Lumen. The purpose of this app is just to learn. I am imagining that this app is using a database called "datastorage" and this is holding different infos. now in my Lumen app I want to be able to do something like $dataStorage->getUser. So in order to have that I am thinking to register a Service Provider and to have something like config settings send to it and methods that can return data, like the getUser method. I am super confused with the service providers and I want to ask if someone can give me a example in order to understand better? FYI I've seen the video on Laracasts, read the documentation, but I am in the point that things are not clicking so I need some kind of example. Thank you

0 likes
0 replies

Please or to participate in this conversation.