protected function moveModel($model)
    {
        $this->model = $model;
        DB::beginTransaction();
        try {
            if ($this->request->position === 'firstChild' || $this->request->position === 'lastChild') {
                $this->model->fill($this->getDefineDatas($this->model))->save();
            }
            $this->model->setNode(get_class($this->model), $this->request, 'move');

            // eğer başka ilişki varsa onları da ekle
            if ($this->opsRelation && ! $this->fillModel($this->opsRelation)) {
                throw new StoreException($this->request->all());
            }

            event(new $this->events['success']($this->model));
            DB::commit();
            $attribute = "{$this->name}_uc_first";
            return response()->json([
                'id'        => $this->model->id,
                'name'      => $this->model->$attribute
            ]);
        } catch (UpdateException $e) {
            DB::rollback();
            event(new $this->events['fail']($e->getDatas()));
            return response()->json($this->returnData('error'));
        }
    }
protected function moveModel($model)
    {
        $this->model = $model;
        DB::beginTransaction();
        try {
            if ($this->request->position === 'firstChild' || $this->request->position === 'lastChild') {
                $this->model->fill($this->getDefineDatas($this->model))->save();
            }
            $this->model->setNode(get_class($this->model), $this->request, 'move');

            // eğer başka ilişki varsa onları da ekle
            if ($this->opsRelation && ! $this->fillModel($this->opsRelation)) {
                throw new StoreException($this->request->all());
            }

            event(new $this->events['success']($this->model));
            DB::commit();
            $attribute = "{$this->name}_uc_first";
            return response()->json([
                'id'        => $this->model->id,
                'name'      => $this->model->$attribute
            ]);
        } catch (UpdateException $e) {
            DB::rollback();
            event(new $this->events['fail']($e->getDatas()));
            return response()->json($this->returnData('error'));
        }
    }
protected function moveModel ( $ model ) { $ this -> model = $ model ; DB :: beginTransaction ( ) ; try { if ( $ this -> request -> position === 'firstChild' || $ this -> request -> position === 'lastChild' ) { $ this -> model -> fill ( $ this -> getDefineDatas ( $ this -> model ) ) -> save ( ) ; } $ this -> model -> setNode ( get_class ( $ this -> model ) , $ this -> request , 'move' ) ; // eğer başka ilişki varsa onları da ekle if ( $ this -> opsRelation && ! $ this -> fillModel ( $ this -> opsRelation ) ) { throw new StoreException ( $ this -> request -> all ( ) ) ; } event ( new $ this -> events [ 'success' ] ( $ this -> model ) ) ; DB :: commit ( ) ; $ attribute = "{$this->name}_uc_first" ; return response ( ) -> json ( [ 'id' => $ this -> model -> id , 'name' => $ this -> model -> $ attribute ] ) ; } catch ( UpdateException $ e ) { DB :: rollback ( ) ; event ( new $ this -> events [ 'fail' ] ( $ e -> getDatas ( ) ) ) ; return response ( ) -> json ( $ this -> returnData ( 'error' ) ) ; } }
move nestable node

@param $model
@throws StoreException
@return array
move nestable node