Skip to content

Instantly share code, notes, and snippets.

@deehidayat
Forked from migrs/Kernel.php
Created February 10, 2016 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deehidayat/195913f4068f1a7befae to your computer and use it in GitHub Desktop.
Save deehidayat/195913f4068f1a7befae 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);
});
@juan55860
Copy link

Cheers!! Yet it´s valid ? I'm testing the patch, but it does not work.
I put this code and include 'newrelic-patch' how application route middleware.in Kernel.php in $routeMiddleware array and all my routes after the Route::macro(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment