/**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(ProductRequest $request)
 {
     $postData = $request->all();
     //获取请求过来的数据
     $user = $request->user();
     $product = $this->product->store($postData, $user->id);
     //使用仓库方法存储
     if ($product->id) {
         //添加成功
         return redirect()->route('admin.product.index')->with('message', '成功发布新产品!');
     } else {
         //添加失败
         return redirect()->back()->withInput($request->input())->with('fail', '数据库操作返回异常!');
     }
 }