From 6f217991fc702d95aac3d41224e43d96715fc96b Mon Sep 17 00:00:00 2001 From: marco76tv Date: Tue, 18 Jun 2024 08:43:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20(ImageSpatie.php):=20add=20metho?= =?UTF-8?q?ds=20to=20get=20image=20ratios=20and=20corresponding=20CSS=20cl?= =?UTF-8?q?asses=20for=20aspect=20ratios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Filament/Blocks/ImageSpatie.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Filament/Blocks/ImageSpatie.php b/Filament/Blocks/ImageSpatie.php index cf2615d6..3e41a618 100755 --- a/Filament/Blocks/ImageSpatie.php +++ b/Filament/Blocks/ImageSpatie.php @@ -61,5 +61,26 @@ function (HasForms $livewire, SpatieMediaLibraryFileUpload $component, Temporary ->label('didascalia'), ]) ->columns($context === 'form' ? 2 : 1); +<<<<<<< HEAD +======= + } + + public static function getRatios(): array + { + return [ + '4-3' => '4/3', + '3-4' => '3/4', + 'free' => 'free', + ]; + } + + public static function getRatioClass(string $ratio): string + { + return match ($ratio) { + '4-3' => 'aspect-[4/3]', + '3-4' => 'aspect-[3/4]', + default => '', + }; +>>>>>>> d76209a (Dusting) } }