获取请求信息

     $data['base_path']   = base_path();
        $data['config_path'] = config_path();
        $data['yuming']      = url()->previous();
        $data['app_path']    = app_path();
        $data['public_path'] = public_path();
        $data['ip']          = $request->ip();  //127.0.0.1
        $data['url']         = $request->url(); //http://www.laravel6.com/test/index
        $data['fullUrl']     = $request->fullUrl(); //http://www.laravel6.com/test/index?a=1
        $data['path']        = $request->path();   //test/index
        $data['method']      = $request->method();   //GET
        $data['isMethod']    = $request->isMethod('get');  //true
        return $data;

 

posted @ 2021-09-08 17:36  CanyingV  阅读(27)  评论(0编辑  收藏  举报