Laravel 4: Class does not exist

laravel, laravel-4, php

Solution

Typically, in Laravel 4, you'll find `class UserController` residing in `app/controllers/UserController.php`.

Laravel doesn't actually care, so long as the class in your routes.php can be auto-loaded. Consequently, always consider running `php artisan dump-autoload` after class name or class file name changes to ensure the autoloader is updated.

Problem

I'm using Laravel v4.2 and getting the following error: ``` Class UserController does not exist ``` Here is my code: user.php ``` class UserController extends BaseController { public function index(){ return View::make('/')->with('title', 'Home | Public Review'); } } ``` routes.php ``` Route::get( '/', array( 'as' => 'index', 'uses' => 'UserController@index' ) ); ``` How do I resolve this error?

Original source