• Developer New

    Friday, March 24, 2017

    how to use IoC in laravel

    App::bind('foo', function($app){ return new Foo; });
    App::make('foo');
    // If this class exists, it's returnedApp::make('FooBar');
    App::singleton('foo', function(){ return new Foo; });
    App::instance('foo', new Foo);
    App::bind('FooRepositoryInterface', 'BarRepository');
    App::register('FooServiceProvider');
    // Listen for object resolutionApp::resolving(function($object){});

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel