Home  >  Q&A  >  body text

How to set up a dynamic secondary directory in Laravel

How to generate such a Group

  • /{area}/

    • /index

    • /mine

    • /shop

    • /market

Do we need to specify an {area} parameter for each route?

曾经蜡笔没有小新曾经蜡笔没有小新2734 days ago711

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-16 16:50:49

    Like this

    Route::group(['prefix'=>'/{area}'],function (\Illuminate\Routing\Router $route){
        $route->get('a','GoodController@a');
        $route->get('b','GoodController@b');
        $route->get('c','GoodController@c');
    });

    reply
    0
  • Cancelreply