Rob Rob - 1 year ago 142
PHP Question

Implicit route model binding in Lumen?

I'm trying to use implicit route model binding in Lumen but seems it's not working.

Is there anyway to enable this?

$app->get('/users/{user}', 'UsersController@get');

It's just returning the value in
but it's not type hinting it and returning the model.

Answer Source

I ran into the same issue recently and doubt that it's possible. Lumen 5.2 does not use the Illuminate router but FastRoute instead. more info on the differences here However, it should be possible to write a custom middleware if that's an option.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download