title: Autoloading Php Packages with Hyphens
body: <p>Packagist does not allow package names to have capital letters. To workaround this, it recommends using hyphens <code>-</code>. Thus my package name went from TableCreator to table-creator. Unfortunately, this seems to have prevented my library from autoloading with the following error message:</p>
  
  <pre><code>Class 'Company\TableCreator\DatabaseField' not found
  </code></pre>
  
  <p>This error message disappears as soon as I manually include the specific file rather than relying on the <code>vendor/autoload.php</code> file.</p>
  
  <p>My packages composer.json file is as follows</p>
  
  <pre><code>{
      "name": "company/table-creator",
      "type": "library",
      "description": "Package creating or editing MySQL tables.",
      "keywords": ["mysql", "mysqli","models"],
      "license": "MIT",
      "authors": [
          {
              "name": "xxx xxx",
              "email": "xxx@xxx.org",
              "role": "Developer"
          }
      ],
      "require": {
          "php": "&gt;=5.3.0"
      },
      "autoload": {
          "psr-4": {
              "company\\table-creator\\": ""
          }
      }
  }
  </code></pre>
  
  <p>The namespace declared in the file is still <code>namespace Company\TableCreator;</code></p>
  
  <p>What do I need to tweak in the composer config for the classes to autload now that the package name has a hyphen?</p>