/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(ResourceInterface $resource) { $response = Redirect::back(); $errors = new MessageBag(); if (Auth::user()->can('edit', $resource)) { $resource->setName(Input::get('container')); if ($this->repository->save($resource)) { $response->with('success', trans('roles::privlege.edit success')); } else { $errors->add('message', trans('roles::resource.edit failed')); } } else { $errors->add('error', trans('roles::resource.edit permission denied')); } $response->withErrors($errors); return $response; }