title: Laravel-Core: Why does Laravel store Aliases multiple times?
body: <p>Laravel does in its core in Application.php register a lot of the Default Implementations like this:</p>
  
  <pre><code>'url' =&gt; ['Illuminate\Routing\UrlGenerator', 'Illuminate\Contracts\Routing\UrlGenerator'],
  </code></pre>
  
  <p>Which will in effekt call the method below two times</p>
  
  <pre><code>public function alias($abstract, $alias)
      {
          $this-&gt;aliases[$alias] = $abstract;
      }
  </code></pre>
  
  <p>resulting in the following values in <code>Container-&gt;aliases</code>:</p>
  
  <pre><code>"Illuminate\Routing\UrlGenerator" =&gt; "url"
  "Illuminate\Contracts\Routing\UrlGenerator" =&gt; "url"
  </code></pre>
  
  <p>If I later call: 
  <code>$this-&gt;app-&gt;alias('url', 'App\Util\Portal\UrlGenerator');</code> 
  it even stores it a thrid time in the Container im the alias array: </p>
  
  <pre><code>"App\Util\Portal\UrlGenerator" =&gt; "url" 
  </code></pre>
  
  <p><strong>My Question:</strong></p>
  
  <p>Why does laravel store them all two or three and not override them? It should be sufficient to store the concrete class. 
  But why does laravel store them all three? How can laravel tell, which  one to resolve, when I now use App::make('url')? Laravel has now three to choose from, one interface and two implementations. </p>