Q:

Events not firing on before filters in a standalone Illuminate 4.1 stack

The past days I've been attempting to get up and running a fully function API with JWT support based on Illuminate 4.1 packages.
The current stack includes:

events
routing
cache
database
config
auth

And for JWT I'm using a modified version of tymon/jwt-auth 0.4 (only modification is downgrading array syntax to pre-PHP 5.4 and Closure changes to ommit $this)
So far I've gotten everything mostly working: The routing works, config works, Container works and all but I seem to be struggling to get the routing before filters working. The issue is that the before filter gets "ignored". Using a test route, it responds with the output of the controller instead of giving a reply, that the token is missing or similar.
Following the tymon/jwt-auth setup wiki, I have created a routing group which uses the jwt-auth filter in my routes.php
<?php

/** @var \Illuminate\Routing\Router $router */
$router = $app['router'];

$router->post('/auth', 'MyApp\Api\Controllers\Auth\AuthController@authenticate');

$router->group(array('before' => 'jwt-auth'), function (\Illuminate\Routing\Router $router) {
    $router->post('/authed', 'MyApp\Api\Controllers\HelloController@loggedIn');
});

I also tested by manually parsing the token by doing JWTAuth::parseToken()->toUser() and that worked perfectly so I've isolated the issue to the before filter.
I walked through the stack on how before filters are handled and I reached the part where it fires and event in the events Dispatcher. My theory on this is that it either isn't firing the event or some listener isn't reacting like it should.
As a test subject, I created a Laravel 4.1 app with original tymon/jwt-auth 0.4. I set up everything similarly and there the before filter works like it should.
As a reference, here is my entire Illuminate-stack API bootstrapper (public/index.php)
<?php

header('Content-Type: application/json');

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, HEAD');

require_once(__DIR__ . '/../../../vendor/autoload.php');
require_once(__DIR__ . '/../../../vendor/illuminate/support/Illuminate/Support/helpers.php');

use Illuminate\Auth\AuthServiceProvider;
use Illuminate\Cache\CacheServiceProvider;
use Illuminate\Config\FileLoader;
use Illuminate\Config\Repository;
use Illuminate\Container\Container;
use Illuminate\Events\EventServiceProvider;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemServiceProvider;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\RoutingServiceProvider;
use Illuminate\Support\ClassLoader;
use Illuminate\Support\Facades\Facade;
use Tymon\JWTAuth\Providers\JWTAuthServiceProvider;

$configDir = __DIR__ . '/../config';
$controllersDir = __DIR__ . '/../src/Controllers';
$modelsDir = __DIR__ . '/../../../models';

ClassLoader::register();
ClassLoader::addDirectories(array($controllersDir, $modelsDir));

$app = new Container;
Facade::setFacadeApplication($app);

$app['app'] = $app;

$app['env'] = env('APP_ENVIRONMENT');

$loader = new FileLoader(new Filesystem, $configDir);
$config = new Repository($loader, 'production');

$app['config'] = $config;

$request = Request::createFromGlobals();
$app['request'] = $request;

with(new EventServiceProvider($app))->register();
with(new CacheServiceProvider($app))->register();
with(new RoutingServiceProvider($app))->register();
with(new FilesystemServiceProvider($app))->register();
with(new AuthServiceProvider($app))->register();
with(new JWTAuthServiceProvider($app))->register();

require(__DIR__ . '/../src/routes.php');

try {
    $response = $app['router']->dispatch($request);
} catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
    $response = new JsonResponse(array(
        'status_code' => $e->getStatusCode(),
        'message' => $e->getMessage()
    ), $e->getStatusCode());
} catch (\Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
    $response = new JsonResponse(array(
        'status_code' => $e->getStatusCode(),
        'message' => $e->getMessage()
    ), $e->getStatusCode());
} catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
    $response = new JsonResponse(array(
        'status_code' => $e->getStatusCode(),
        'message' => $e->getMessage()
    ), $e->getStatusCode());
} catch (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e) {
    $response = new JsonResponse(array(
        'status_code' => JsonResponse::HTTP_NOT_FOUND,
        'message' => 'Route not found'
    ), JsonResponse::HTTP_NOT_FOUND);
} catch (\Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException $e) {
    $response = new JsonResponse(array(
        'status_code' => JsonResponse::HTTP_FORBIDDEN,
        'message' => 'Method not allowed'
    ), JsonResponse::HTTP_FORBIDDEN);
}

$response->send();

Could anyone give me some pointers on how to get the before filter to work?
Could it be related to service provider registering?
Could I be missing something to successfully fire events?
Could I be missing some default event listener?

A:

Not sure in 100% but it looks like you've missed boot() step for registered providers.
jwt-auth package provider is registering a filter in boot() method:
public function boot()
{
    $this->package('tymon/jwt-auth', 'jwt', __DIR__.'/../');
    $this->bootBindings();
    // register the command
    $this->commands('tymon.jwt.generate');
    // register the filter
    $this->app['router']->filter('jwt-auth', 'tymon.jwt.filter');
}

I'd say that before calling register() method of JWTAuthServiceProvider you should also call boot() method.

