public function getCascadeDeletesRelationQuery($relation)
    {
        $query = $this->$relation();

        // If this is a force delete and the related model is using soft deletes,
        // we need to use the withTrashed() scope on the relationship query to
        // ensure all related records, plus soft deleted, are force deleted.
        if ($this->isCascadeDeletesForceDeleting()) {
            // Laravel 4.1 has the withTrashed method directly on the Eloquent
            // query builder, however Laravel 4.2+ uses a withTrashed macro
            // on the Eloquent query builder.
            if (!class_exists(SoftDeletingScope::class) || !is_null($query->getMacro('withTrashed'))) {
                $query = $query->withTrashed();
            }
        }

        return $query;
    }