public function redirectToForm()
{
$redirect = url('/form_callback') . '/redirect_to_url=' .
request('redirect_to_url');
}
在laravel中我想创建一个包含其他网站URL的路由。高于request('redirect_to_url')
包含
其他网站的网址,例如' http://localhost.studentform.com/
&#39 ;.
所以生成的URL是:
http://localhost.studentInformation.com/form_callback/redirect_to_url=http://localhost.studentform.com/
所以我需要在laravel 5.3中创建相同的路线 目前我正在关注:
Route::get('/form_callback/{redirectTo}', ['as' => 'student.callback.to', 'uses' => 'StudentController@functionCallback']);
但它说未找到路线
答案 0 :(得分:2)
1。将其更改为:
Route::get('/form_callback/redirect_to_url={redirectTo}', ....
以控制器方法获取数据:
public function functionCallback($redirectTo)
{
dd($redirectTo);
2. 或将其更改为:
Route::get('form_callback', ....
网址:
http://localhost.studentInformation.com/form_callback?redirect_to_url=http://localhost.studentform.com/
使用以下命令获取控制器中的数据:
$url = request('redirect_to_url')