Lookitsatravis\Listify\Listify::bootListify PHP Method

bootListify() public static method

Returns whether the scope has changed during the course of interaction with the model
public static bootListify ( ) : boolean
return boolean
    public static function bootListify()
    {
        //Bind to model events
        static::deleting(function ($model) {
            $model->reloadPosition();
        });
        static::deleted(function ($model) {
            $model->decrementPositionsOnLowerItems();
        });
        static::updating(function ($model) {
            $model->checkScope();
        });
        static::updated(function ($model) {
            $model->updatePositions();
        });
        static::creating(function ($model) {
            if ($model->addNewAt()) {
                $method_name = "addToList" . $model->addNewAt();
                $model->{$method_name}();
            }
        });
    }