本文整理汇总了PHP中Rating::createNewRating方法的典型用法代码示例。如果您正苦于以下问题:PHP Rating::createNewRating方法的具体用法?PHP Rating::createNewRating怎么用?PHP Rating::createNewRating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rating
的用法示例。
在下文中一共展示了Rating::createNewRating方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: scan
public function scan()
{
$user_id = Session::get('user_id');
if (!Input::hasFile('file')) {
return Response::json(array("result" => "No file"));
}
$result = "";
$file = Input::file('file');
$destinationPath = public_path() . "/uploads/";
$file_name = date('YmdHis') . '_' . $file->getClientOriginalName();
$uploadSuccess = $file->move($destinationPath, $file_name);
if ($uploadSuccess) {
$result = Wine::scan($destinationPath . $file_name);
if ($result != -2) {
$wine = Wine::where('wine_id', $result)->first();
if ($wine != null) {
$input = $wine->toArray();
$rating = Rating::createNewRating($input);
}
}
}
return Response::json(array("result" => $result));
}
示例2: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$result = Rating::createNewRating($this->_getInput());
return Response::json($result);
}