我正在尝试使用路由控制器方法编写代码。但是我无法说明这个问题
Route::get('/',[
'uses' => 'ProductController@getIndex','as' => 'product.index','do' => function()
{
$url = parse_url(Request::fullUrl());
$domain = explode('.',$url['host']);
$subdomain = $domain[0];
$name = DB::table('users')->where('name',$subdomain)->first();
dd($name);
if ($name==true) {
return url('/') . '/?ref=' .$name->id;
}}
]);