示例#1
0
 /**
  * Store a newly created resource in storage.
  * POST /categorie
  *
  * @return Response
  */
 public function store(CategorieRequest $request)
 {
     $data = $request->except('file');
     $file = $this->upload->upload($request->file('file'), 'pictos', 'categorie');
     $data['image'] = $file['name'];
     $categorie = $this->categorie->create($data);
     return redirect('admin/categorie/' . $categorie->id)->with(['status' => 'success', 'message' => 'Catégorie crée']);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, CategorieRequest $request)
 {
     //
     $categorie = ForumCategorie::findOrFail($id);
     $categorie->setNom($request->input('cat_nom'));
     $categorie->update();
     return redirect('forum');
 }