From 1adbec35194aabd9fa4aa363ef94f1804d39ec0c Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Fri, 5 Dec 2025 22:54:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Add=20`ExtractLogos`=20?= =?UTF-8?q?command=20to=20export=20meetup=20logos=20to=20public=20storage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Commands/Database/ExtractLogos.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/Console/Commands/Database/ExtractLogos.php diff --git a/app/Console/Commands/Database/ExtractLogos.php b/app/Console/Commands/Database/ExtractLogos.php new file mode 100644 index 0000000..d30ec04 --- /dev/null +++ b/app/Console/Commands/Database/ExtractLogos.php @@ -0,0 +1,44 @@ +with([ + 'media', + ]) + ->get(); + + foreach ($meetups as $meetup) { + $logo = $meetup->getFirstMedia('logo'); + if ($logo) { + if (file_exists($logo->getPath())) { + Storage::disk('public') + ->put('00_logos/'.$meetup->name.'.'.$logo->extension, file_get_contents($logo->getPath())); + } + } + } + } +}