Esempio n. 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(ProductTypeRequest $request, $id)
 {
     $product_type = ProductType::findOrFail($id);
     $product_type->title = $request->input('title');
     $product_type->status = $request->input('status');
     $product_type->updated_at = time();
     $product_type->updated_by = Auth::user()->id;
     $product_type->update();
     Session()->flash('flash_message', 'Data has been Updated');
     return redirect('product_types');
 }
 public function store(ProductTypeRequest $request)
 {
     $this->repository->create($request->all());
     flash()->success(trans('product_type.main_name'), trans('product_type.create_success_message'));
     return redirect('/product-types');
 }