app/Http/Controllers/BukuController.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)
    {
        $this->validate($request, [
            'nama' => 'required',
            'tahun_terbit' => 'required',
            'kategori' => 'required',
        ]);
        Buku::find($id)->update($request->all());
        return redirect()->route('buku.index')
                        ->with('success','Update buku sukses');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'nama' => 'required' , 'tahun_terbit' => 'required' , 'kategori' => 'required' , ] ) ; Buku :: find ( $ id ) -> update ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'buku.index' ) -> with ( 'success' , 'Update buku sukses' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .