取得route中設定的網址參數

Route

Route::get('/products/{category}/{pid}-{name}', '[email protected]');

Controller

$pid = $request->route('pid');