From 2ea27acddeea955264030066e22c2f13e3f0d863 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 8 May 2024 12:29:36 +0200 Subject: [PATCH] add cloud scripts --- other/scripts/get-subs.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 other/scripts/get-subs.php diff --git a/other/scripts/get-subs.php b/other/scripts/get-subs.php new file mode 100644 index 000000000..3a23fc073 --- /dev/null +++ b/other/scripts/get-subs.php @@ -0,0 +1,11 @@ +$handle = fopen("/tmp/export.csv", "w"); +App\Models\Team::chunk(100, function ($teams) use ($handle) { + foreach ($teams as $team) { + if ($team->subscription->stripe_invoice_paid == true) { + foreach ($team->members as $member) { + fputcsv($handle, [$member->email, $member->name], ","); + } + } + } +}); +fclose($handle);