app/Http/Controllers/ProductCategoriesController.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)
    {
        ProductCategories::where('id',$id)->update([
            'category_name'=>$request->nama_kategori,
            'updated_at'=>Carbon::now()->format('Y-m-d H:i:s')
        ]);
        return redirect('/product-category')->with('berhasil','Data kategori berhasil diubah!');
    }
public function update ( Request $ request , $ id ) { ProductCategories :: where ( 'id' , $ id ) -> update ( [ 'category_name' => $ request -> nama_kategori , 'updated_at' => Carbon :: now ( ) -> format ( 'Y-m-d H:i:s' ) ] ) ; return redirect ( '/product-category' ) -> with ( 'berhasil' , 'Data kategori berhasil diubah!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//memperbarui data