public static function boot()
    {
        parent::boot();

        // Delete hierarchies first.
        static::deleting(function($model)
        {
            $model->children()->detach();

            $model->parents()->detach();
        });
    }