RedirectResponse 中的 Laravel 访问 url

M a*_*a D 0 laravel-5 laravel-5.8

我正在使用一个支付包,它返回 RedirecResponse 类的实例,然后用户被重定向到支付页面。

我需要在移动应用程序中使用它。我不知道如何告诉应用程序打开该付费页面。我无法将 RedirecResponse 实例返回给应用程序,因此我必须从 RedirecResponse 实例中获取支付页面的 url,然后将其返回给应用程序,然后应用程序必须打开浏览器。

TargetUrl属性包含 url,但 Laravel 在访问此属性时返回以下错误:

无法访问受保护的属性 Illuminate\Http\RedirectResponse::$targetUrl

如何从 RedirectResponse 获取 url?

谢谢

NoO*_*Z24 5

经确认:

$redirectResponse->getTargetUrl()

成功了