title: Laravel 5.0, Cannot redeclare class App\models\Category
body: <p>I recently upgraded my project from laravel 4.2 to laravel 5.0 and have been facing several errors.</p>
  
  <p>I didn't define any namespaces in 4.2 version, but as suggested <a href="https://stackoverflow.com/questions/30375950/upgrading-laravel-4-2-to-5-0-getting-reflectionexception-class-app-http-contr/">here,</a></p>
  
  <p>I have started defining namespaces in my code. I don't know if the problem that I am facing is related to that, but it occured in the middle of this process.</p>
  
  <p>I am getting the following error while running the code:</p>
  
  <pre><code>exception 'Symfony\Component\Debug\Exception\FatalErrorException' with
  message 'Cannot redeclare class App\models\Category' in  
  /Users/yash/summers/lightsCameraDinner/lcd_updated/app/models/Category.php:19
  </code></pre>
  
  <p>Here is my Category.php:</p>
  
  <pre><code>&lt;?php namespace App\models;
  
  use Eloquent;
  
  class Category extends Eloquent {
  
    protected $table = 'categories';
    protected $guarded = array('id');
  
    // Defining 'Many to Many' Relationship with 'VendorProfile' Model
    public function clients() {
      return $this-&gt;belongsToMany('Client');
    }
  
    // Defining 'One to Many' Relationship with 'Job' Model
    public function jobs() {
      return $this-&gt;hasMany('Job');
    }
  }
  </code></pre>
  
  <p>I searched for the similar errors on SO, but didn't find any.</p>
  
  <p>This is the function in my controller that is called on "/" route.</p>
  
  <pre><code>    public function getIndex() {
      $categories = Category::all();
  
      $messages = Message::groupBy('receiver_id')
                  -&gt;select(['receiver_id', \DB::raw("COUNT('receiver_id') AS total")])
                  -&gt;orderBy('total', 'DESC')
                  -&gt;get()
                  -&gt;toArray();
  
      $vendors_ids = array();
      foreach ($messages as $message) {
        $vendors_ids[] = $message['receiver_id'];
      }
  
      $clients = Client::where('profile_type', 'VendorProfile')
                        -&gt;where('is_activated', 1)
                        -&gt;whereIn('id', $vendors_ids)
                        -&gt;limit(4)
                        -&gt;get();
  
      if($clients-&gt;count() &lt; 4) {
        $clients = Client::where('profile_type', 'VendorProfile')
                          -&gt;where('is_activated', 1)
                          -&gt;limit(4)
                          -&gt;get();
      }   
      Log::info('getIndex function of PagesController');
      $this-&gt;layout = View::make('layouts.homepage');
      $this-&gt;layout-&gt;content = View::make('pages/index', ['categories' =&gt; $categories, 'clients' =&gt; $clients]);
      return $this-&gt;layout;
    }
  </code></pre>
  
  <p>Let me know if you need anything else from the code. I have been trying to figure out the solution for quite some time now.</p>