app/Containers/Survey/Models/Survey.php
/**
     * use delete event to delete subentities
     */
use delete event to delete subentities
use delete event to delete subentities
public static function boot()
    {
        parent::boot();
        static::deleting(function($element) {
            foreach ($element->trees as $tree) {
                $tree->delete();
            }
        });
    }
public static function boot ( ) { parent :: boot ( ) ; static :: deleting ( function ( $ element ) { foreach ( $ element -> trees as $ tree ) { $ tree -> delete ( ) ; } } ) ; }
use delete event to delete subentities
use delete event to delete subentities
//trees