获取请求类的几种方式: 1.助手函数(严格不算ba ) input('post.name'): 2.$request=\think\Request::instance(); 3.控制器中必须继承Controller,那么在方法中可用$this->request; 4.依赖注入 .5.直接 new namespace app\admin\controller; use think\Request; class User{ //4.依赖注入 public function index(Request
laravel中为我们提供了绑定不同http请求类型的函数. Route::get('/test', function () {}); Route::post('/test', function () {}); Route::put('/test', function () {}); Route::patch('/test', function () {}); Route::delete('/test', function () {}); Route::options('/test', func