Laravel 5从url获取代码

Laravel 5从url获取代码,url,laravel,get,Url,Laravel,Get,如何从http://domain.com/auth/fb?code=kakakak 因为$request->input('code')返回null,我不知道为什么。 谢谢尝试input()方法: echo $request->input('code'); 如上所述(在本例中,Request::input()和$Request->input()执行相同的操作) 试验路线 这里有一个基本的测试,看看查询参数是否真的不起作用。将此添加到routes.php: Route::get('test

如何从
http://domain.com/auth/fb?code=kakakak

因为
$request->input('code')
返回null,我不知道为什么。 谢谢

尝试
input()
方法:

echo $request->input('code');
如上所述(在本例中,
Request::input()
$Request->input()
执行相同的操作)


试验路线 这里有一个基本的测试,看看查询参数是否真的不起作用。将此添加到
routes.php

Route::get('test', function(){
    dd(Request::input('foo'));
});
和访问:

http://domain.com/test?foo=bar

您应该会看到屏幕上打印的
“bar”

使用
query()
方法怎么样,因为
代码是。例如:

$request->query('code')


有关更多信息,请参阅。

将此代码放入您的域配置中

location / {
     try_files $uri $uri/ /index.php?$args;
}

您可以使用
Request::get('code')
从url获取代码。

dd($Request)返回:`#内容:null#语言:null#字符集:null#编码:null#可接受内容类型:null#路径信息:“/auth/fb”#requestUri:/auth/fb?code=dupa”#baseUrl:#basePath:null#方法:“get”#格式:null#会话存储#{#113 ▶} #语言环境:null#defaultLocale:“en”`如何准确地获取
$request
变量?我可以看更多的代码吗?
公共函数fb(AuthenticateUser$AuthenticateUser,request$request){dd($request->query('code');//$hasCode=$request->has('code');//返回$AuthenticateUser->execute($hasCode,$this);}
确保键入正确的提示
请求
。完整路径是
Illumb\Http\Request
我有以下链接:使用Illumb\Http\Request;