src/Listify.php
protected function handleListifyScopeChange()
    {
        if ( ! $this->hasListifyScopeChanged()) return;

        $this->rememberCurrentlyUsedScope();

        // swap the attributes so the record is scoped in its old scope
        $this->swapChangedAttributes();

        if ( ! $this->excludeFromList() && $this->lowerItem()) {
            $this->decrementPositionsOfItemsBelow();
        }

        // swap the attributes back, so the item can be positioned in its new scope
        $this->swapChangedAttributes();

        // unset its position, so it will get the correct new position in its new scope
        $this->setListifyPosition(null);

        $this->performConfiguredAddMethod($this);
    }
protected function handleListifyScopeChange()
    {
        if ( ! $this->hasListifyScopeChanged()) return;

        $this->rememberCurrentlyUsedScope();

        // swap the attributes so the record is scoped in its old scope
        $this->swapChangedAttributes();

        if ( ! $this->excludeFromList() && $this->lowerItem()) {
            $this->decrementPositionsOfItemsBelow();
        }

        // swap the attributes back, so the item can be positioned in its new scope
        $this->swapChangedAttributes();

        // unset its position, so it will get the correct new position in its new scope
        $this->setListifyPosition(null);

        $this->performConfiguredAddMethod($this);
    }
protected function handleListifyScopeChange ( ) { if ( ! $ this -> hasListifyScopeChanged ( ) ) return ; $ this -> rememberCurrentlyUsedScope ( ) ; // swap the attributes so the record is scoped in its old scope $ this -> swapChangedAttributes ( ) ; if ( ! $ this -> excludeFromList ( ) && $ this -> lowerItem ( ) ) { $ this -> decrementPositionsOfItemsBelow ( ) ; } // swap the attributes back, so the item can be positioned in its new scope $ this -> swapChangedAttributes ( ) ; // unset its position, so it will get the correct new position in its new scope $ this -> setListifyPosition ( null ) ; $ this -> performConfiguredAddMethod ( $ this ) ; }
Checks and handles when the model's list scope has changed.
Makes sure that the old list positions are adjusted and the model
is correctly placed in the new list.
Checks and handles when the model s list scope has changed . Makes sure that the old list positions are adjusted and the model is correctly placed in the new list .