Laravel route with parameters

前端 未结 3 1604
陌清茗
陌清茗 2021-01-18 08:28

Am using laravel route for approving some form from email. So i have encrypted some variables and created link which is like



        
3条回答
  •  日久生厌
    2021-01-18 09:25

    Simply write a GET route to approveRequest :

    Route::get('approveRequest', 'ApproveController@approve');
    

    Because you are using URL parameters, you can simply get them in the approve() function like this

    public function approve(Request $request) 
    {
         $id = $request->id;
         $gsID = $request->get('gsID');
         .... and so on for all your variables.
    }
    

    With this approach the order of parameters does not matter.

提交回复
热议问题