Gallery

Home / Gallery

@php function getAspectRatio($imagePath) { [$width, $height] = getimagesize($imagePath); // Get width and height $difference = $width - $height; if ($difference > 1000) { return 'wide'; // Significantly wider than tall } elseif ($height > $width) { return 'tall'; // Taller than wide } elseif ($width > 1000) { return 'big'; // Large square image } else { return ''; // No specific classification } } @endphp
@foreach ($gallery as $item) @php $imagePath = public_path('images/' . $item->image); // Use public_path for correct image location $size = getAspectRatio($imagePath); @endphp @endforeach {{-- --}}