Ejemplo n.º 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(PostRequest $request, $id)
 {
     //dd($request->except('_token','_method'));
     $post = Post::find($id);
     $post->update($request->except('_token'));
     return redirect()->route('posts.show', $post);
 }
Ejemplo n.º 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(PostRequest $request, $id)
 {
     $post = \App\Post::find($id);
     $post->update($request->except('_token'));
     return redirect()->route('posts.show', $id);
 }
Ejemplo n.º 3
0
 public function update(PostRequest $request, Post $post)
 {
     $post->update($request->except(['_token']));
     $this->syncTags($post, $request->input('tag_list'));
     return redirect('dash/post')->with('message', 'Post was update success.');
 }