/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $productType = new ProductType();
     $productType->name = $request->name;
     $productType->desc = $request->desc;
     $productType->save();
     return $productType;
 }
	public function postUpdateProducttype(Request $request)
	{
		$arr_return = array(
			"status"=>"error"
		);
		$id = $request->has('id')?$request->input('id'):0;
		$name =$request->has('name')? $request->input('name') : '';
		if( $id ) {
			$producttype = ProductType::find($id);
		} else {
			$producttype = new ProductType;
		}
		$producttype->name = $name;
		if($producttype -> save()){
			$arr_return['status'] = 'success';
		}else{
			$arr_return['message']= "Saving fail";
		}
		return $arr_return;
	}