在laravel文档中看到绑定容器的说法,在provider里这样绑定了之后具体是怎么实现的,能不能给举个例子详细说明一下
$this->app->bind('HelpSpot\API', function ($app) {
return new HelpSpot\API($app->make('HttpClient'));
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
https://laravel.com/docs/5.4/...
直接
resolve('HelpSpot\API')