In-Touch / laravel-newrelic

Laravel NewRelic ServiceProvider
173 stars 48 forks source link

Support Laravel 6 #63

Open DanKeeble opened 4 years ago

ngrevet commented 4 years ago

@DanielKeeble is this working as-is in Laravel 6.x?

DanKeeble commented 4 years ago

@DanielKeeble is this working as-is in Laravel 6.x?

Yeah appears to be working fine for us.

ngrevet commented 4 years ago

I'm guessing you forked it while you wait for this to be merged/updated?

DanKeeble commented 4 years ago

I'm guessing you forked it while you wait for this to be merged/updated?

That's correct.

thiagorb commented 4 years ago

A small change is required for the library to work also with lumen 6. In src/Intouch/LaravelNewrelic/LumenNewrelicMiddleware.php, replace:

app()->getRoutes()

with

app()->router->getRoutes()

EDIT This change was actually introduced in Lumen/Laravel 5.5, so app()->getRoutes() will not work for any version above 5.5, and app()->router->getRoutes() wouldn't work for the versions before 5.5.