php - Ask a question about laravel service container
PHP中文网
PHP中文网 2017-05-27 17:42:46
0
1
575

I saw the term binding container in the laravel document. How is it implemented after binding like this in the provider? Can you give an example to explain in detail

$this->app->bind('HelpSpot\API', function ($app) {
    return new HelpSpot\API($app->make('HttpClient'));
});
PHP中文网
PHP中文网

认证0级讲师

reply all(1)
过去多啦不再A梦

https://laravel.com/docs/5.4/...

Directresolve('HelpSpotAPI')

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!