I have a very weird problem.
On my local machine (Windows 8, XAMPP) the Laravel filters work as they should, but on the server they don't. (Ubuntu with Apache).
Route::filter('test_filter', function($request) {
echo 'Inside filter<br />';
});
Route::get('test_server2', array('before' => 'test_filter', function() {
return 'After filter<br />';
}));
When I run this from my local server, the output is:
Inside filter
After filter
When I run the same script from the web, I get:
After filter
As you can see, the filter is not being applied. They are never executed. It's not a random or temporary thing.
I noticed this problem in a large application that I have. I created this simple code to check if the basic stuff works, but it doesn't.
Does anyone know why filters may not be executed?
I've checked the routing classes in the source code of Laravel and I haven't found anything that might help to solve my issue.