Skip to content

Commit

Permalink
📝 (ImageSpatie.php): add methods to get image ratios and correspondin…
Browse files Browse the repository at this point in the history
…g CSS classes for aspect ratios
  • Loading branch information
marco76tv committed Jun 18, 2024
1 parent f915fa8 commit 6f21799
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Filament/Blocks/ImageSpatie.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 6f21799

Please sign in to comment.