Support the ongoing development of Laravel.io →
Authentication Database Validation
Last updated 2 years ago.
0

Addition:

the route looks like this

Route::group(array('before' => 'auth'), function()
{
    Route::controller('admin', 'AdminDashboardController');
});
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

ah what a stupid mistake! thanks a lot there

Last updated 2 years ago.
0

thank you, this was really helpful!

Last updated 2 years ago.
0

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');
	}


	
}
Last updated 2 years ago.
0

No response?

0

hmpedro said:

No response?

For Laravel 4

  1. 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.

  2. 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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

reshadf reshadf Joined 4 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.