@@ -116,17 +116,24 @@ class="mx-auto mt-5 max-w-2xl text-center text-base/relaxed text-gray-600 sm:tex
116116 -> inRandomOrder ()
117117 -> get ();
118118
119+ // Check if any submissions have user-uploaded images
120+ $hasAnyUserImages = $approvedSubmissions -> contains (fn ($s ) => ! empty ($s -> photo_path ));
121+
119122 // Convert approved submissions to the format expected by the component
120123 $earlyAdopters = $approvedSubmissions
121- -> map (function ($submission ) {
124+ -> map (function ($submission ) use ($hasAnyUserImages ) {
125+ $hasUserImage = ! empty ($submission -> photo_path );
126+
122127 return [
123128 ' name' => $submission -> name ,
124129 ' title' => $submission -> company ,
125130 ' url' => $submission -> url ,
126- ' image' => $submission -> photo_path
131+ ' image' => $hasUserImage
127132 ? asset (' storage/' . $submission -> photo_path )
128- : ' https://avatars.laravel.cloud/' . rand (1 , 70 ) . ' ?vibe=' . array_rand ([' ocean' , ' crystal' , ' bubble' , ' forest' , ' sunset' ]),
129- ' featured' => rand (0 , 4 ) === 0 , // Randomly feature about 20% of submissions
133+ : ' https://avatars.laravel.cloud/' . rand (1 , 70 ) . ' ?vibe=' . array_rand ([' ocean' , ' stealth' , ' bubble' , ' ice' ]),
134+ ' hasUserImage' => $hasUserImage ,
135+ // Only allow featured if has user image (unless no submissions have images)
136+ ' featured' => ($hasAnyUserImages ? $hasUserImage : true ) && rand (0 , 4 ) === 0 ,
130137 ' testimonial' => $submission -> testimonial ,
131138 ];
132139 })
@@ -144,6 +151,7 @@ class="relative z-10 mt-10 grid place-items-center 2xs:block 2xs:columns-[10rem]
144151 :url =" $adopter['url'] ?? null"
145152 :title =" $adopter['title'] ?? null"
146153 :featured =" $adopter['featured'] ?? false"
154+ :hasUserImage =" $adopter['hasUserImage'] ?? false"
147155 />
148156 @endforeach
149157 </div >
0 commit comments