title: Laravel: Controller does not exist
body: <p>I added new controller in /app/controllers/admin/ folder and added the route in /app/routes.php file as well. Then i run the following command to autoload them</p>
  
  <pre><code>php artisan dump-autoload
  </code></pre>
  
  <p>I got the following error</p>
  
  <pre><code>Mcrypt PHP extension required.
  </code></pre>
  
  <p>I followed instruction given at <a href="https://askubuntu.com/questions/460837/mcrypt-extension-is-missing-in-14-04-server-for-mysql">https://askubuntu.com/questions/460837/mcrypt-extension-is-missing-in-14-04-server-for-mysql</a> and able to resolve the mcrypt issue.</p>
  
  <p>After that i run the <code>php artisan dump-autoload</code> command but still getting following error</p>
  
  <pre><code>{"error":{"type":"ReflectionException","message":"Class CoursesController does not exist","file":"\/var\/www\/html\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php","line":504}}
  </code></pre>
  
  <p>Here is code of my <strong>routes.php</strong> file</p>
  
  <pre><code>Route::group(array('before' =&gt; 'adminauth', 'except' =&gt; array('/admin/login', '/admin/logout')), function() {
      Route::resource('/admin/courses', 'CoursesController');
      Route::resource('/admin/teachers', 'TeachersController');    
      Route::resource('/admin/subjects', 'SubjectsController');
  });
  </code></pre>
  
  <p>Here is code of <strong>CoursesController.php</strong> file</p>
  
  <pre><code>&lt;?php
  
  class CoursesController extends BaseController
  {
  
      public function index()
      {
          $courses = Course::where('is_deleted', 0)-&gt;get();
          return View::make('admin.courses.index', compact('courses'));
      }
  
      public function create()
      {
          return View::make('admin.courses.create');
      }
  
     public function store()
      {
          $validator = Validator::make($data = Input::all(), Course::$rules);
  
          if ($validator-&gt;fails()) {
              $messages = $validator-&gt;messages();
              $response = '';
              foreach ($messages-&gt;all(':message') as $message) {
                  $response = $message;
              }
              return Response::json(array('message'=&gt;$response, 'status'=&gt;'failure'));
          } else {
              Course::create($data);
              return Response::json(array('message'=&gt;'Course created successfully','status'=&gt;'success'));
          }
      }
  
      public function edit($id)
      {
          $course = Course::find($id);
          return View::make('admin.courses.edit', compact('course'));
      }
  
      public function update($id)
      {
          $course = Course::findOrFail($id);
          $validator = Validator::make($data = Input::all(), Course::editRules($id));
  
          if ($validator-&gt;fails()) {
              $messages = $validator-&gt;messages();
              $response = '';
              foreach ($messages-&gt;all(':message') as $message) {
                  $response = $message;
              }
              return Response::json(array('message'=&gt;$response, 'status'=&gt;'failure'));
          } else {
              $course-&gt;update($data);
              return Response::json(array('message'=&gt;'Course updated successfully','status'=&gt;'success'));
          }
      }
  
      public function destroy($id)
      {
          Course::findOrFail($id)-&gt;update(array('is_deleted' =&gt; '1'));
          return Response::json(array('message'=&gt;'Course deleted successfully','status'=&gt;'success'));
      }
  
  }
  </code></pre>