search

Home  >  Q&A  >  body text

php - Ask a question about laravel service container

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中文网2858 days ago640

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-27 17:44:46

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

    Directresolve('HelpSpotAPI')

    reply
    0
  • Cancelreply