Esempio n. 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = Input::except('_method', '_token');
     if (!$this->validator->with($input)->passes()) {
         return Response::json($this->validator->errors(), 400);
     }
     $this->repo->update($input, $id);
     return Response::json(trans('main.updated successfully', array('item' => $input['name'])), 201);
 }
Esempio n. 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = Input::except('_method', '_token');
     if (!$this->validator->with($input)->passes()) {
         return Redirect::back()->withErrors($this->validator->errors())->withInput($input);
     }
     $this->actor->update($input);
     return Redirect::back()->withSuccess(trans('main.updated successfully', array('item' => $input['name'])));
 }