Addition:
the route looks like this
Route::group(array('before' => 'auth'), function()
{
Route::controller('admin', 'AdminDashboardController');
});
Due to the filter you added, Laravel is trying to call the getAfterFilters function on your controller, but it is not defined. Your controller should extend the Controller class.
<?php
class AdminDashboardController extends Controller {
/**
* Admin dashboard
*
*/
public function getIndex()
{
return View::make('admin/dashboard');
}
}
This should work.
ah what a stupid mistake! thanks a lot there
I have a similar problem. I get this error "Call to undefined method MainController::getAfterFilters()" when i try to access a route. When I try to access the page "account" I get the error. Here is the code for my route and the controller
Route::get('account',array(
'as'=>'account',
'before'=>'is_guest',
'uses'=>'MainController@getAccount'
));
class MainController extends \BaseController {
public function getAccount()
{
return View::make('account');
}
}
hmpedro said:
No response?
For Laravel 4
It's an undefined filter like is_guest or may be another one. That one is Before filter, not After filter. If it's not that, the problem is not in this code, it could be in the BaseController.
This error could happen on other conditions like a duplicated controller class. You should find the duplicate and then run "composer update" again to fix the bindings for the autoload.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community