Updates ui component attributes

@param Listener $listener
@param mixed $id
@param array $input
@return Response
163672
public function update(Listener $listener, $id, array $input)
    {
        $model     = with(new Eloquent())->findOrNew($id);
        $memory    = app('antares.memory')->make('ui-components');
        $className = $memory->get($model->name . '.name');
        $component = with(new $className($model->id));
        $rules     = $component->getRules();
        if (empty($rules)) {
            return Response::json([], 200);
        }
        $validation = ValidatorFacade::make($input, $rules);


        if ($validation->fails()) {
            if (app('request')->ajax()) {
                return Response::json($validation->getMessageBag()->getMessages(), 200);
            }
            return $listener->whenValidationFailed($validation->getMessageBag());
        } else {
            $controls      = $component->controls();
            $value         = unserialize($model->value);
            $value['data'] = array_only($input, $controls);
            $model->value  = serialize($value);
            $model->save();
            $memory->getHandler()->forgetCache($this->getResource());
            return Response::json([], 200);
        }
    }
1073972
public function store(BannedEmailStoreListener $listener, array $input)
    {
        if (empty(array_get($input, 'expired_at'))) {
            $input['expired_at'] = null;
        }

        $bannedEmail = new BannedEmail();
        $bannedEmail->fill($input);

        $form = $this->presenter->form($bannedEmail);

        if (!$form->isValid()) {
            return $listener->createBannedEmailFailedValidation($form->getMessageBag());
        }
        try {
            $this->repository->store($bannedEmail);
            $this->bannedEmailsService->saveToFile();
            return $listener->storeBannedEmailSuccess($bannedEmail);
        } catch (Exception $e) {
            Log::critical($e->getMessage());
            return $listener->storeBannedEmailFailed(['error' => $e->getMessage()]);
        }
    }
1296852
public function getListeners($id, $event)
    {
        $this->addConfigListeners($id, $event);
        return parent::getListeners($id, $event);
    }
1363498
public function delete($id, IndexListener $listener)
    {
        try {
            $model = $this->repository->makeModel()->findOrFail($id);
            $model->delete();
            return $listener->deleteSuccess();
        } catch (Exception $ex) {
            return $listener->deleteFailed();
        }
    }
1280195
public function activate(Selector $listener, string $type, string $id)
    {
        $theme = $this->getAvailableTheme($type)->get($id);

        if (! in_array($type, $this->type) || is_null($theme)) {
            return $listener->themeFailedVerification();
        }

        $this->memory->put("site.theme.{$type}", $id);

        return $listener->themeHasActivated($type, $id);
    }
878075
public function setDefault(LanguageListener $listener, $id)
    {
        DB::beginTransaction();
        try {
            $current             = Languages::query()->where('is_default', 1)->firstOrFail();
            $current->is_default = 0;
            $current->save();

            $language             = Languages::query()->findOrFail($id);
            $language->is_default = 1;
            $language->save();
        } catch (Exception $ex) {
            DB::rollback();
            return $listener->defaultFailed($ex->getMessage());
        }
        DB::commit();
        return $listener->defaultSuccess();
    }
1251196
public function publish(Listener $listener, array $input)
    {
        $queues = $this->publisher->queued();

        try {
            $this->publisher->connect($input);
        } catch (ServerException $e) {
            Log::emergency($e);
            $this->session->forget('antares.ftp');

            return $listener->publishingHasFailed(['error' => $e->getMessage()]);
        }

        $this->session->put('antares.ftp', $input);

        if ($this->publisher->connected() && !empty($queues)) {
            $this->publisher->execute();
        }

        return $listener->publishingHasSucceed();
    }
812743
public function update(int $id, array $input)
    {
        return $this->model->find($id)->update($input);
    }
1232790
protected function callListenerBindings(Listener $listener, Event $event)
    {
        $binding = $listener->determineEventBinding($event);

        if ($listener->hasBinding($binding)) {
            foreach ($listener->getBindings($binding) as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $resource, $resource->getPath());
            }
        }

        // If a listener has a binding for anything we'll also spin through
        // them and call each of them.
        if ($listener->hasBinding('*')) {
            foreach ($listener->getBindings('*') as $callback) {
                $resource = $event->getResource();

                call_user_func($callback, $event, $resource, $resource->getPath());
            }
        }
    }
772233
public function handle(EventListenerInterface $listener)
    {
        if (!$listener->getListeners()) {
            return;
        }

        $content = $this->request->getContent();

        try {
            $options = Serializer::parse($content);
        } catch (\InvalidArgumentException $e) {
            $options = [];
        }

        foreach ($listener->getListeners() as $namespace => $callable) {
            $event = new $namespace($options);
            if ($event->isValid()) {
                $listener->trigger($namespace, $event);
                break;
            }
        }
    }
1089633
function addListener(element, listener) {
        var id = idHandler.get(element);

        if(!eventListeners[id]) {
            eventListeners[id] = [];
        }

        eventListeners[id].push(listener);
    }
308374
public function update(FieldUpdater $listener, $id, array $input)
    {
        $customfield = Foundation::make('antares.customfields.model')->findOrFail($id);
        $this->attachValidator();
        $on          = $customfield->imported ? 'imported' : 'update';
        $validation  = $this->validator->on($on)->with($input);

        if ($validation->fails()) {
            return $listener->updateFieldFailedValidation($validation->getMessageBag(), $id);
        }


        try {
            $this->saving($customfield, $input, 'update');
        } catch (Exception $e) {
            Log::emergency($e);
            return $listener->updateFieldFailed(['error' => $e->getMessage()]);
        }

        return $listener->fieldUpdated();
    }
271851
public function destroy(RuleListener $listener, $id)
    {
        $rule = $this->repository->findById($id);

        if (!$rule) {
            return $listener->notFound($id);
        }

        try {
            $this->fireEvent('deleting', [$rule]);
            $this->repository->delete($rule);
            $this->fireEvent('deleted', [$rule]);
        } catch (Exception $e) {
            Log::critical($e->getMessage());
            return $listener->deleteRuleFailed(['error' => $e->getMessage()]);
        }

        return $listener->deleteRuleSuccess();
    }
817476
public function update($id, array $values, $idCol)
    {
        return (bool) $this->getSelection()
            ->where('?name = ?', $idCol, $id)
            ->update($values);
    }
897799
public function update(Listener $listener, array $input)
    {
        $user = Auth::user();

        if (! $this->validateCurrentUser($user, $input)) {
            return $listener->abortWhenUserMismatched();
        }

        $validation = $this->validator->on('changePassword')->with($input);

        if ($validation->fails()) {
            return $listener->updatePasswordFailedValidation($validation->getMessageBag());
        }

        if (! Hash::check($input['current_password'], $user->password)) {
            return $listener->verifyCurrentPasswordFailed();
        }

        try {
            $this->saving($user, $input);
        } catch (Exception $e) {
            return $listener->updatePasswordFailed(['error' => $e->getMessage()]);
        }

        return $listener->passwordUpdated();
    }
976758
public function updateById($id, array $inputs)
    {
        $inputs = $this->purifyInputs($inputs);

        $model = $this->model->findOrFail($id);

        return $model->update($inputs);
    }
1324834
public static function update(array $id = [], array $data = [], ClientInterface $client = null)
    {
        return (new RequestService($client))
            ->setResourceClass(static::class)
            ->setResourcePath(static::RESOURCE_PATH . "/:" . static::RESOURCE_ID)
            ->update($id, $data);
    }