| 1 | <?php |
||
| 13 | class NewRelicMiddleware |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var Newrelic |
||
| 18 | */ |
||
| 19 | protected $newRelic; |
||
| 20 | |||
| 21 | |||
| 22 | /** |
||
| 23 | * NewRelicMiddleware constructor. |
||
| 24 | * |
||
| 25 | * @param Newrelic $newRelic |
||
| 26 | */ |
||
| 27 | public function __construct(Newrelic $newRelic) |
||
| 31 | |||
| 32 | |||
| 33 | /** |
||
| 34 | * Handles the request by naming the transaction for New Relic |
||
| 35 | * |
||
| 36 | * @param Request $request |
||
| 37 | * @param Closure $next |
||
| 38 | */ |
||
| 39 | public function handle(Request $request, Closure $next) |
||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * Builds the transaction name. It will return the assigned controller action first, then the route name before |
||
| 53 | * falling back to just "index.php" |
||
| 54 | * |
||
| 55 | * @param Request $request |
||
| 56 | * |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | public function getTransactionName(Request $request) |
||
| 75 | |||
| 76 | } |
||
| 77 |