/**
  * Update the specified resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  * @param int                      $id
  *
  * @return \Illuminate\Http\Response
  */
 public function update(UpdateBillRequest $request, $id)
 {
     $bill = Bill::findOrFail($id);
     if (policy($bill)->update(Auth::user(), $bill)) {
         $bill->update($request->billFillData());
         $bill->syncCategories($request->get('categories', []));
         $successInfo = '成功修改账单 <strong>' . $bill->name . '</strong>。';
         return redirect('bill')->withSuccess($successInfo);
     } else {
         return redirect('bill')->withErrors('你没有足够的权限来执行此操作。');
     }
 }
 /**
  * Update the specified Bill in storage.
  *
  * @param  int              $id
  * @param UpdateBillRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateBillRequest $request)
 {
     $bill = $this->billRepository->find($id);
     if (empty($bill)) {
         Flash::error('Bill not found');
         return redirect(route('bills.index'));
     }
     $this->billRepository->updateRich($request->all(), $id);
     Flash::success('Bill updated successfully.');
     return redirect(route('bills.index'));
 }