在`laravel`中, 我们用`request`来提取参数
那么怎么输出参数
我们可以用`response`响应类,在`controller`中我们要引入`response`类
>use Illuminate\Support\Facades\Response;
```
public function response(){
return response("hello the world")
->header('Content-Type', "text/html")
->cookie('name', 'value', 1);
return response("hello the world")
->header('Content-Type', "text/html")
->header('X-Header-One', 'Header Value')
->header('X-Header-Two', 'Header Value');
return response()->file(PUBLIC_PATH()."/1.jpg");
//下载
return response()->download(PUBLIC_PATH()."/1.jpg");
//跳转
return redirect()->away('https://www.baidu.com');
//跳转到别的类
return redirect()->action(
'IndexController@index', ['id' => 1]
);
return response('Hello World', 200)->header('Content-Type', 'text/plain');
$data = [ "msg"=>"test"];
//return response()->json($data);
return Response::json($data);
}
```