Skip to content

Instantly share code, notes, and snippets.

@kbirmhrjn
Forked from migrs/Kernel.php
Created January 30, 2016 17:10
Show Gist options
  • Save kbirmhrjn/beac9edd5f277438f720 to your computer and use it in GitHub Desktop.
Save kbirmhrjn/beac9edd5f277438f720 to your computer and use it in GitHub Desktop.
newrelic patch for laravel5.2
<?php
namespace App\Http\Middleware;
use Closure;
class NewRelicPatch
{
public function handle($request, Closure $next)
{
$response = $next($request);
event('router.filter:after:newrelic-patch', [$request, $response], true);
return $response;
}
}
<?php
Route::macro('after', function ($callback) {
$this->events->listen('router.filter:after:newrelic-patch', $callback);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment