I try to upgrade from Laravel 3 to 4 but i get this error everywhere
Call to undefined method Illuminate\Database\Query\Builder::getAfterFilters()
Someone know where this can come ?
I had this error too so I'll just post my observations here. It can always help someone !
It appears that getAfterFilters() is a method that is required for all controllers in L4. If the error says it's not defined, you probably forgot to extend BaseController in your class.
Knowing that, the obvious fix would be to extend BaseController... but you don't nececarly have to if it's not needed. In my case, my class had to be a valid controller because of a very stupid reason. I was using the following route syntax :
Route::get('sse', 'SSE@deamon');
SSE was not extending BaseController (didn't need to imho) But this route syntax requires you to use a controller class that extends BaseController... so I changed it for:
Route::get('sse', [function() {
SSE::deamon();
}]);
and it now works without the missing getAfterFilters() error !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With