コード例 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if (Request::isMethod('get')) {
         $this->data['items'] = Position::get();
         $this->data['lala'] = Position::find($id);
         if ($this->data['lala']) {
             return view('pages.position.update', $this->data);
         } else {
             return redirect('position');
         }
     } elseif (Request::isMethod('post')) {
         $position = Position::find($id);
         $position->update(Input::all());
         return redirect('position/detail/' . $id);
     }
 }