app/Containers/Tree/Models/Tree.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) {
            optional($element->image)->deleteMedia();
            optional($element->point)->delete();
        });
    }
public static function boot ( ) { parent :: boot ( ) ; static :: deleting ( function ( $ element ) { optional ( $ element -> image ) -> deleteMedia ( ) ; optional ( $ element -> point ) -> delete ( ) ; } ) ; }
use delete event to delete subentities
use delete event to delete subentities
//image //point