title: Laravel 4 IoC Container - Setting Up & Using Providers
body: <p>I am trying to use <a href="http://geotools-php.org/" rel="nofollow">http://geotools-php.org/</a> in Laravel 4 (L4).</p>
  
  <p>I followed the instructions for downloading through Composer (and verified geotools existance in the vendors folder).</p>
  
  <p>I added "app/providers/GeoTools.php" to my autoload classmap.</p>
  
  <p>Here's the contents:</p>
  
  <pre><code>{
      "require": {
          "laravel/framework": "4.0.*",
          "toin0u/geotools": "@stable"
      },
      "autoload": {
          "classmap": [
              "app/commands",
              ... more laravel stuff
              "app/providers/GeoTools.php"
          ]
      }
      ... more laravel stuff
  </code></pre>
  
  <p>I created /providers/GeoTools.php file.</p>
  
  <p>Here are the contents:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\ServiceProvider;
  
  class GeoToolsServiceProvider extends ServiceProvider {
  
      public function register()
      {
          $this-&gt;app-&gt;bind('Coordinate', function()
          {
  
              return new Geotools\Coordinate;
  
          });
      }
  
  }
  </code></pre>
  
  <p>In my app.php providers array I added "GeoToolsServiceProvider".</p>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li>Obviously I have done something wrong, how <em>should</em> this be done.</li>
  <li>Once you have the above code correct how do you properly use it throughout the application?</li>
  </ol>