如何检查api密钥传递请求url laravel

时间:2015-08-21 05:42:45

标签: php api request laravel-5

如何通过post url传递api密钥。

下面是我的控制员,请指教

 public function postOrder(Request $request)
 {
        $api_key = Config::get('app.key');
        if ($api_key)  
        {

            $Order = $request->only('no_of_kits', 'total')
            $Order = new OrderTestKits;

            $Order ->no_of_kits = $request->input('no_of_kits');
            $Order ->total = $request->input('total');

            $Order ->save();

            return $Order ;
        }                
        else 
        {
            return "api key not found";
        }
}

0 个答案:

没有答案