app/Http/Controllers/LoaiSanPhamController.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)
    {
        $loaisp= loaiSanPham::findOrFail($id);
        $loaisp->tenloai = $request->tenloai;
        $loaisp->slug = $request->slug;
        $loaisp->mota = $request->mota;
        $loaisp->id_parent = $request->id_parent;
        $loaisp->save();
        return back()
            ->with('success','Sửa thành công');
    }
public function update ( Request $ request , $ id ) { $ loaisp = loaiSanPham :: findOrFail ( $ id ) ; $ loaisp -> tenloai = $ request -> tenloai ; $ loaisp -> slug = $ request -> slug ; $ loaisp -> mota = $ request -> mota ; $ loaisp -> id_parent = $ request -> id_parent ; $ loaisp -> save ( ) ; return back ( ) -> with ( 'success' , 'Sửa thành công'); }
Update the specified resource in storage.
Update the specified resource in storage .
//