Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

No

Because nikic fastroute doesn't support it. You have to specify each route.

0

How to group routes in Laravel Lumen framework.

.......... $app->group(array('prefix' => '/api'), function() use ($app)
.......... {
	// Version group
.......... .......... $app->group(array('prefix' => '/v1'), function() use ($app){
.......... ..........$app->get('users/', function() use ($app) {
.......... ..........return 'hello';
.......... .......... });
.......... });

});

When searched {URL}/api/v1/users it returs page not found error, but works when searched for {URL}/users

0

Yeah, as CedNet said, FastRoute doesn't support this.

0

Hola que tal amigos les comparto una solución rápida saludos!!! Con esto funciona perfecto para lo alias...

$app->group( ['namespace' => 'App\Http\Controllers'] , function($app)
{
    // Variable Prefix
    $api = 'api/';
    $app->get( $api.'/',         ['uses' => 'PaginaController@pagina1',  'as' => 'pagina1']           );
    $app->get( $api.'/otro',     ['uses' => 'PaginaController@pagina2', 'as' => 'pagina2']            );
});
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

RiseupDev riseupdev Joined 15 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.