Laravel 4 - 调用未定义的方法SomeController :: getAfterFilters()

I get

Call to undefined method ContestsCpController::getAfterFilters()

on a specific controller. All other controllers are working fine and I do not remember any change that would cause this breakage. In fact, I haven't touched the code in weeks. The last thing I did was some refactoring.

Route

Route::get("contestscp/home", "ContestsCpController@getHome");

Controller

<?php

class ContestsCpController extends BaseController
{

    public function getHome() {
        return Redirect::to("contestscp/give_award");
    }
...
some other methods
...
}
?>

Debug output

/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @param string $method
* @return mixed
*/
protected function assignAfter($instance, $route, $request, $method)
{
foreach ($instance->getAfterFilters() as $filter) //fails here
{
// If the filter applies, we will add it to the route, since it has already been

Google and SO suggest that this is caused when controller does not extend BaseController but this is obviously not the case. So I assume that for some reason my class is not being extended. Or.. the class fails to initialize and $instance is null. But I have no idea why and how to debug this.

Any suggestions?

I knew this had to be something stupid.. because it always is.

The problem was my refactoring. I used to have all validators extended in a single file. When I separated the validators into different files I misnamed my ContestsCpValidator class as ContestsCPController (duh..). So I had a second class with the same name with no methods obviously.

So basically, if you happen to have this error and you are indeed extending the BaseController make sure you don't autoload another class with the same name.