I get a bit confused over all the nice things laravel has to offer in terms of the IOC container and facades. Since I'm not an experienced programmer it gets overwhelming to learn.
I was wondering, what is the difference between these two examples:
A facade to 'Foo' and registered in the container via
App::bind()
A facade to 'Foo' and registered in the container via
App::singleton()
In my best understanding Foo::method()
will be rewritten as $app->make['foo']->method()
so in the first example multiple instances of the Foo
class will be created and in the second example, since it's bound via an App::singleton()
, the same instance of Foo
will be returned every time a Method on that object is called.
Is my assumption correct?