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($id,Request $request)
    {
        $post = \App\Post::findOrFail($id);
        $post->update($request->all());
        $pencipta = $post->pencipta;
        $pencipta->nama_pencipta = $request->input('nama_pencipta');
        $post->pencipta()->save($pencipta);
        $post->tag()->sync($request->input('tag_post'));
        return redirect('/post');
    }
public function update ( $ id , Request $ request ) { $ post = \ App \ Post :: findOrFail ( $ id ) ; $ post -> update ( $ request -> all ( ) ) ; $ pencipta = $ post -> pencipta ; $ pencipta -> nama_pencipta = $ request -> input ( 'nama_pencipta' ) ; $ post -> pencipta ( ) -> save ( $ pencipta ) ; $ post -> tag ( ) -> sync ( $ request -> input ( 'tag_post' ) ) ; return redirect ( '/post' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .