title: Singleton binding constructed multiple times in Laravel
body: <p>In my service provider I bind a class with singleton:</p>
  
  <pre><code>public function register()
  {
      $this-&gt;app-&gt;singleton('ResourceContainer', function($app){
          return new ResourceContainer();
      });
  }
  </code></pre>
  
  <p>The laravel doumentation says that this class will be resolved one time and the same object will be returned:</p>
  
  <blockquote>
    <p>The singleton method binds a class or interface into the container that should only be resolved one time. Once a singleton binding is resolved, the same object instance will be returned on subsequent calls into the container:</p>
  </blockquote>
  
  <p>But in my app the constructor of <code>ResourceContainer</code> is called twice.</p>
  
  <p>I want to call this instance in my boot method of the serviceprovider:</p>
  
  <pre><code>public function boot()
  {
      $resourceContainer = $this-&gt;app-&gt;make('ResourceContainer');
  </code></pre>
  
  <p>And I inject the class in a controller:</p>
  
  <pre><code>public function index(ResourceContainer $container, $resource){
  </code></pre>
  
  <p>When I debug, the constructor of ResourceContainer is called twice. I get a different object in my controller than in the boot method of the service provider.</p>