Laravel 5 获取我动态创建的最终Uri(guzzel)

Laravel 5 获取我动态创建的最终Uri(guzzel),laravel-5,guzzle6,Laravel 5,Guzzle6,嗨,我想得到我调用的最终URI;我想知道我正在调用哪个URI,因为我正在动态创建URI。这是我尝试过的代码,但失败了。我使用的是Guzzel的最新版本 你能提供更多的信息吗,比如你得到的错误或不正确的和预期的输出?我没有得到任何错误,但我想得到我必须为bhash sms调用的最终uri public function index(Request $request) { $firstName = '{% First Name %}'; $lastName = '{% Las

嗨,我想得到我调用的最终URI;我想知道我正在调用哪个URI,因为我正在动态创建URI。这是我尝试过的代码,但失败了。我使用的是Guzzel的最新版本


你能提供更多的信息吗,比如你得到的错误或不正确的和预期的输出?我没有得到任何错误,但我想得到我必须为bhash sms调用的最终uri
public function index(Request $request)
{   
    $firstName = '{% First Name %}';
    $lastName = '{% Last Name %}';
    $emailID = '{% Email ID %}';
    $mobileNumber = '{% Mobile Number %}';
    $sms = urldecode($request->input('sms'));

    foreach (json_decode(substr(urldecode($request->input('messages')), 0, -6)) as $user) 
    {
        $smsText = $sms;

        if(strpos($sms, $firstName) != false || strpos($sms, $lastName) != false || strpos($sms, $emailID) != false || strpos($sms, $mobileNumber) != false)
        {             
            $smsText = str_replace($firstName, explode(" ",$user->field_full_name_value)[0], $smsText);
            $smsText = str_replace($lastName, explode(" ",$user->field_full_name_value)[1], $smsText);
            $smsText = str_replace($emailID, $user->mail, $smsText);
            $smsText=str_replace($mobileNumber, $user->field_phone_no_value, $smsText);
        }

        $response = $this->client->request(null,'/api/sendmsg.php',
                    ['query'=>[
                               ['user' => 'ray'],
                               ['pass' => 'as'],
                               ['sender' => 'abc'],
                               ['phone' => 7411220923], //$user->field_phone_no_value
                               ['text' => 'Test Message'], //$smsText
                               ['priority' => 'ndnd'],
                               ['stype' => 'normal']
                    ]]);           
    }  
}