app/Http/Controllers/PostController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
      $post = Post::findOrFail($id);
      $aux = $post;
      $post->text = $request->text;
      $post->img = $request->img;
      $post->user_id = $request->user_id;
      $post->updated_at = now();
      $post->save();
      return redirect('/post/'.$id.'/edit');
    }
public function update ( Request $ request , $ id ) { $ post = Post :: findOrFail ( $ id ) ; $ aux = $ post ; $ post -> text = $ request -> text ; $ post -> img = $ request -> img ; $ post -> user_id = $ request -> user_id ; $ post -> updated_at = now ( ) ; $ post -> save ( ) ; return redirect ( '/post/' . $ id . '/edit' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .