tighten / parental

Use single table inheritance in your Laravel app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

classToAlias is not a public method

zeng407 opened this issue · comments

public static function bootHasParentModel()
    {
        static::creating(function ($model) {
            if ($model->parentHasReturnsChildModelsTrait()) {

                $model->forceFill(
                    [$model->getInhertanceColumn() => $model->classToAlias(get_class($model))]
                );
            }
        });
        static::addGlobalScope(function ($query) {
            $instance = new static;
            if ($instance->parentHasReturnsChildModelsTrait()) {
                $query->where($instance->getInhertanceColumn(), $instance->classToAlias(get_class($instance)));
            }
        });
    }

Is it actually throwing an error for you? if so can you help me re-create it?