public function view($id)
    {
        $component = null;
        DB::transaction(function() use($id, &$component) {
            $resource = Input::get('from');

            $model = $this->repository->findOneById($id);
            if (is_null($model)) {
                throw new ComponentNotFoundException('Component not found');
            }
            $data             = $model->data;
            $data['disabled'] = false;
            $model->data      = $data;
            $model->resource  = strlen($resource) > 0 ? $resource : uri();
            $this->repository->saveEntity($model);


            $component  = app()->make($data['classname']);
            $attributes = array_only($data, ['x', 'y', 'width', 'height', 'disabled']) + ['id' => $id];
            $component->setAttributes($attributes);
            $inputs     = Input::get('attributes');

            if (!is_null($attributes) and method_exists($component, 'hydrate')) {
                $args = empty($inputs) ? [] : unserialize($inputs);
                $component->hydrate($args);
            }
            $component->setView('antares/ui-components::admin.partials._base');
        });



        return ['component' => $component];
    }