app/Http/Controllers/Kategori.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)
    {
        $data = ModelKontak::where('id',$id)->first();
        $data->kode_kategori = $request->kode_kategori;
        $data->nama_kategori = $request->nama_kategori;
        $data->save();
        return redirect()->route('kategori.index')->with('alert-success','Data berhasil diubah!');
    }
public function update ( Request $ request , $ id ) { $ data = ModelKontak :: where ( 'id' , $ id ) -> first ( ) ; $ data -> kode_kategori = $ request -> kode_kategori ; $ data -> nama_kategori = $ request -> nama_kategori ; $ data -> save ( ) ; return redirect ( ) -> route ( 'kategori.index' ) -> with ( 'alert-success' , 'Data berhasil diubah!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// dd($request);