我的路线错误(404)
我的路线
Route::get('tg/{tg}', 'PP\PayPalController@getHooks');
但返回包含?
https://mydoamin/tg/?code=TG-53125542=id=523651
如何在路线上使用正则表达式来拒绝?
Route::get('tg/{tg}', 'PP\PayPalController@getHooks')->where('tg', regex);
答案 0 :(得分:1)
只需:
Route::get('tg', 'PP\PayPalController@getHooks');
并在函数中处理the GET parameter:
public function getHooks(Request $request) {
$tg = $request->query('tg');
// do something with it now
}