title: Using Enum classes in Laravel 5 project
body: <p>I want to use some enum classes in my laravel 5 app.
  They are modeled after this PHP man page example: <a href="http://php.net/manual/en/class.splenum.php" rel="nofollow">http://php.net/manual/en/class.splenum.php</a></p>
  
  <p>The file app\Enums.php looks like this:</p>
  
  <pre><code>&lt;?php
  namespace MyApp\Enums;
  class ItemStates extends SplEnum 
  {
      const __default = self::Active;
  
      const Active = 1;
      const Pending = 2;
  }
  
  class ItemVisibility extends SplEnum
  {
      const __default = self::Community;
  
      const Community = 1;
      const Personal = 2;
  }
  </code></pre>
  
  <p>I want to use these from a controller. 
  I put a use statement at the top of my controller:</p>
  
  <pre><code>use MyApp\Enums;
  </code></pre>
  
  <p>When I try to use the class like this:</p>
  
  <pre><code>if ($category['Family'] == CategoryFamily::General)
  </code></pre>
  
  <p>I get an error:
  Class 'MyApp\Http\Controllers\Quiz\CategoryFamily' not found</p>
  
  <p>I have run compose dump-autoload in case that matters.</p>
  
  <p>How can I use my Enum classes from inside controllers (multiple controllers)?</p>