Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

strategicsdemexico's avatar

Get route params in service provider?

is that possible? I want to get a route param in the service provider class, how to do it?

0 likes
4 replies
DiogoGomes's avatar

Hi,

Yes, its possible:

$parameters = Route::current()->parameters();

Cheers

2 likes
bestmomo's avatar
Level 52
$this->app->request->all()
2 likes
strategicsdemexico's avatar

it works i just use

$this->app->request->route('slug')

to get the slug in the url

Please or to participate in this conversation.