Skip to content
Discussion options

You must be logged in to vote

I came up with something like this after all

await course.preload("subscriptions");
course.subscriptions.map(async (subscription) => {
    await subscription.related("users").detach();
    await subscription.delete();
});

I was trying to avoid that .map() but it appears it's not possible

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@melokki
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by melokki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants