Passing parameter to controller from route in laravel

前端 未结 4 1864
孤城傲影
孤城傲影 2020-12-16 09:15

THIS IS A QUESTION FOR LARAVEL 3

Given the following route

Route::get(\'groups/(:any)\', array(\'as\' => \'group\', \'uses\' =>         


        
4条回答
  •  执念已碎
    2020-12-16 10:01

    This is what you need in 1 line of code.

    Route::get('/groups/{groupId}', 'GroupsController@getShow');

    Suggestion: Use CamelCase as opposed to underscores, try & follow PSR-* guidelines.

    Hope it helps.

提交回复
热议问题