dimanche 6 décembre 2020

Get url prefix in lumen controller

I am working in Lumen app and i have created route group like below,

$router->group(['prefix' => 'clare'], function() use ($router) {

    $router->get('routetest', ['uses' => 'ChannelController@index']);
});

I want to get the current route prefix in ChannelController index method. I don't know how to do that. I could not find this in documentation for lumen. But I've find this one for laravel but its not working in lumen.

$this->getRouter()->getCurrentRoute()->getPrefix();


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire