Skip to content

Commit

Permalink
Merge pull request #25 from stevensunny/patch-1.1
Browse files Browse the repository at this point in the history
return string 'controller@action' instead of boolean value
  • Loading branch information
pleckey committed Apr 24, 2015
2 parents d170386 + a74a803 commit af02c53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Intouch/LaravelNewrelic/LaravelNewrelicServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@ public function getTransactionName( $request, $response, $app )
/** @var \Illuminate\Routing\Router $router */
$router = $app['router'];

$name = $router->currentRouteName()
?: $router->current() && $router->currentRouteAction()
?: $request->getMethod() . ' ' . $request->getPathInfo();
if ( $router->currentRouteName() ) {
$name = $router->currentRouteName();
} else {
if ( $router->current() && $router->currentRouteAction() ) {
$name = $router->currentRouteAction();
} else {
$name = $request->getMethod() . ' ' . $request->getPathInfo();
}
}
}

return $name;
Expand Down

0 comments on commit af02c53

Please sign in to comment.