Esempio n. 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(CreateCategoryRequest $request, $id)
 {
     $category = Category::findOrFail($id);
     $category->update($request->all());
     session()->flash('flash_message', 'Data Updated!');
     return redirect('categories');
 }
Esempio n. 2
0
 /**
  * Store a newly created Category in storage.
  *
  * @param CreateCategoryRequest $request
  *
  * @return Response
  */
 public function store(CreateCategoryRequest $request)
 {
     $input = $request->all();
     $category = $this->categoryRepository->create($input);
     Flash::success('Category saved successfully.');
     return redirect(route('categories.index'));
 }
 /**
  * Store a newly created Category in storage.
  *
  * @param CreateCategoryRequest $request
  *
  * @return Response
  */
 public function store(CreateCategoryRequest $request)
 {
     $input = $request->all();
     $category = $this->categoryRepository->create($input);
     $messages = "Transporte Creado";
     Toastr::success($messages, $title = null, $options = ['positionClass' => 'toast-bottom-right']);
     return redirect(route('categories.index'));
 }
Esempio n. 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateCategoryRequest $request
  * @return Response
  */
 public function store(CreateCategoryRequest $request)
 {
     $category = new Category();
     $category->fill($request->all());
     $category->save();
     $message = trans('messages.category_created_successfully');
     Flash::success($message);
     return redirect()->route('admin.categories.index');
 }
Esempio n. 5
0
 /**
  * Store a newly created Category in storage.
  *
  * @param CreateCategoryRequest $request
  *
  * @return Response
  */
 public function store(CreateCategoryRequest $request)
 {
     $input = $request->all();
     $input['objectId'] = str_random(10);
     if ($request->file('image')) {
         $image = $this->uploadImage($request->file('image'), '/categories_photo/');
         $input['image'] = $image['resize_url'][0];
     }
     $category = $this->categoryRepository->create($input);
     Flash::success('Category saved successfully.');
     return redirect(route('categories.index'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateCategoryRequest|Request $request
  *
  * @param Category                      $category
  *
  * @return \Illuminate\Http\Response
  */
 public function store(CreateCategoryRequest $request, Category $category)
 {
     $category->create($request->all());
     return redirect()->route('admin.categories.index')->withMessage('<b>Success!</b> category created successfully')->withClass('success');
 }
 /**
  * Update the specified Category in storage.
  *
  * @param  int    $id
  * @param CreateCategoryRequest $request
  *
  * @return Response
  */
 public function update($id, CreateCategoryRequest $request)
 {
     /** @var Category $category */
     $category = Category::find($id);
     if (empty($category)) {
         Flash::error('Category not found');
         return redirect(route('admin.categories.index'));
     }
     $category->fill($request->all());
     $category->save();
     Flash::message('Category updated successfully.');
     return redirect(route('admin.categories.index'));
 }
Esempio n. 8
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreateCategoryRequest $request)
 {
     Categories::create($request->all());
     return redirect()->back();
 }
 public function update($id, Requests\CreateCategoryRequest $request)
 {
     $category = Category::findOrFail($id);
     $category->update($request->all());
     return redirect('kategoriat');
 }
 /**
  * Update the specified Category in storage.
  *
  * @param  int    $id
  * @param CreateCategoryRequest $request
  *
  * @return Response
  */
 public function update($id, CreateCategoryRequest $request)
 {
     $category = $this->categoryRepository->findCategoryById($id);
     if (empty($category)) {
         Flash::error('Category not found');
         return redirect(route('categories.index'));
     }
     $category = $this->categoryRepository->update($category, $request->all());
     Flash::message('Category updated successfully.');
     return redirect(route('categories.index'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(CreateCategoryRequest $request)
 {
     $category = App\Category::create($request->all());
     flash()->success('Success!', 'New category created: <strong>' . e($request->input('name')) . '</strong>.');
     return redirect()->action('CategoryListsController@show', [$category->id]);
 }
Esempio n. 12
0
 /**
  * Store a newly created category in storage.
  *
  * @param CreateCategoryRequest|Request $request
  */
 public function store(CreateCategoryRequest $request)
 {
     Category::create($request->all());
     return redirect()->route('admin.category.index');
 }
Esempio n. 13
0
 /**
  * Persists a category to the database.
  * Uses CreateCategoryRequest request type.
  * 
  * @param  CreateCategoryRequest $request [description]
  * @return [type]                         [description]
  */
 public static function persist(CreateCategoryRequest $request)
 {
     $request->validate();
     $category = CategoryFactory::make($request->all());
     return Auth::user()->categories()->save($category);
 }