Пример #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(CityRequest $request, $id)
 {
     $city = City::findOrFail($id);
     $city->name = $request->get('name');
     $city->status = $request->get('status');
     $city->save();
     return redirect('city');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(CityRequest $request, $id)
 {
     $postData = $request->all();
     //获取请求过来的数据
     $this->city->update($id, $postData);
     //使用仓库方法存储
     return redirect()->route('admin.city.index')->with('message', '修改成功!');
 }