diff --git a/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php b/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php
index 927f2774..a6d98281 100644
--- a/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php
+++ b/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php
@@ -1,5 +1,7 @@
+@props(['partners' => null])
+
@php
- $partners = [
+ $partners ??= [
[
'url' => 'https://nexcalia.com/?ref=nativephp',
'name' => 'Nexcalia',
@@ -22,54 +24,44 @@
'imageDark' => '/img/sponsors/synergi-dark.svg',
'class' => 'w-full',
],
- [
- 'url' => 'https://laradevs.com/?ref=nativephp',
- 'name' => 'Laradevs',
- 'tagline' => 'Hire the best Laravel developers anywhere',
- 'component' => 'sponsors.logos.laradevs',
- 'class' => 'w-full text-black dark:text-white',
- ],
- [
- 'url' => 'https://beyondco.de/?utm_source=nativephp&utm_medium=logo&utm_campaign=nativephp',
- 'name' => 'BeyondCode',
- 'tagline' => 'Essential tools for web developers',
- 'image' => '/img/sponsors/beyondcode.webp',
- 'imageDark' => '/img/sponsors/beyondcode-dark.webp',
- 'class' => 'w-full',
- ],
];
-
- $partner = $partners[array_rand($partners)];
@endphp
-
-
- @if (isset($partner['component']))
-
- @else
-
![{{ $partner['name'] }} logo]({{ $partner['image'] }})
-
![{{ $partner['name'] }} logo]({{ $partner['imageDark'] }})
- @endif
-
- {{ $partner['tagline'] }}
-
+
diff --git a/resources/views/components/sponsors/lists/docs/sponsors.blade.php b/resources/views/components/sponsors/lists/docs/sponsors.blade.php
index 7fe368e8..475ce906 100644
--- a/resources/views/components/sponsors/lists/docs/sponsors.blade.php
+++ b/resources/views/components/sponsors/lists/docs/sponsors.blade.php
@@ -1,5 +1,7 @@
+@props(['sponsors' => null])
+
@php
- $sponsors = [
+ $sponsors ??= [
[
'url' => 'https://artisan.build/?utm_source=nativephp&utm_medium=logo&utm_campaign=nativephp',
'name' => 'Artisan Build',
@@ -7,37 +9,55 @@
'imageDark' => '/img/sponsors/artisan-build-dark.webp',
'class' => 'w-full',
],
+ [
+ 'url' => 'https://beyondco.de/?utm_source=nativephp&utm_medium=logo&utm_campaign=nativephp',
+ 'name' => 'BeyondCode',
+ 'image' => '/img/sponsors/beyondcode.webp',
+ 'imageDark' => '/img/sponsors/beyondcode-dark.webp',
+ 'class' => 'w-full',
+ ],
+ [
+ 'url' => 'https://laradevs.com/?ref=nativephp',
+ 'name' => 'Laradevs',
+ 'component' => 'sponsors.logos.laradevs',
+ 'class' => 'w-full text-black dark:text-white',
+ ],
];
-
- $sponsor = $sponsors[array_rand($sponsors)];
@endphp
-
- @if (isset($sponsor['component']))
-
- @else
-
-
- @endif
-
+
diff --git a/tests/Feature/SponsorsAndPartnersPlacementTest.php b/tests/Feature/SponsorsAndPartnersPlacementTest.php
index 9a687168..0fe43e16 100644
--- a/tests/Feature/SponsorsAndPartnersPlacementTest.php
+++ b/tests/Feature/SponsorsAndPartnersPlacementTest.php
@@ -11,45 +11,42 @@ class SponsorsAndPartnersPlacementTest extends TestCase
use RefreshDatabase;
#[Test]
- public function the_partners_section_no_longer_lists_beyondcode_or_laradevs()
+ public function the_partners_page_renders_the_partners_section()
{
- $this->blade('')
- ->assertSee('Nexcalia')
- ->assertSee('Web Mavens')
- ->assertDontSee('Laradevs')
- ->assertDontSee('BeyondCode')
- ->assertDontSee('Need a freelancer or engineer?')
- ->assertDontSee('From local full stack development');
+ $this->get(route('partners'))
+ ->assertOk()
+ ->assertSee('Meet Our Partners');
}
#[Test]
- public function the_sponsors_section_lists_beyondcode_and_laradevs_without_descriptions()
+ public function the_sidebar_partners_list_rotates_through_every_entry_it_is_given()
{
- $this->blade('')
- ->assertSee('Artisan Build')
- ->assertSee('BeyondCode')
- ->assertSee('Laradevs')
- ->assertDontSee('Need a freelancer or engineer?')
- ->assertDontSee('From local full stack development');
- }
+ $partners = [
+ ['url' => 'https://partner-one.test', 'name' => 'Partner One', 'tagline' => 'First', 'image' => '/img/one.svg', 'imageDark' => '/img/one-dark.svg', 'class' => ''],
+ ['url' => 'https://partner-two.test', 'name' => 'Partner Two', 'tagline' => 'Second', 'image' => '/img/two.svg', 'imageDark' => '/img/two-dark.svg', 'class' => ''],
+ ];
- #[Test]
- public function the_homepage_drops_the_partner_descriptions_for_beyondcode_and_laradevs()
- {
- $this->get('/')
- ->assertOk()
- ->assertDontSee('Need a freelancer or engineer?')
- ->assertDontSee('From local full stack development');
+ $this->blade('', compact('partners'))
+ ->assertSee('Math.random() * 2', false)
+ ->assertSee('x-show="partner === 0"', false)
+ ->assertSee('x-show="partner === 1"', false)
+ ->assertSee('https://partner-one.test')
+ ->assertSee('https://partner-two.test');
}
#[Test]
- public function the_partners_page_lists_the_current_partners()
+ public function the_sidebar_sponsors_list_rotates_through_every_entry_it_is_given()
{
- $this->get(route('partners'))
- ->assertOk()
- ->assertSee('Meet Our Partners')
- ->assertSee('Nexcalia')
- ->assertSee('Web Mavens')
- ->assertSee('Synergi Tech');
+ $sponsors = [
+ ['url' => 'https://sponsor-one.test', 'name' => 'Sponsor One', 'image' => '/img/one.svg', 'imageDark' => '/img/one-dark.svg', 'class' => ''],
+ ['url' => 'https://sponsor-two.test', 'name' => 'Sponsor Two', 'image' => '/img/two.svg', 'imageDark' => '/img/two-dark.svg', 'class' => ''],
+ ];
+
+ $this->blade('', compact('sponsors'))
+ ->assertSee('Math.random() * 2', false)
+ ->assertSee('x-show="sponsor === 0"', false)
+ ->assertSee('x-show="sponsor === 1"', false)
+ ->assertSee('https://sponsor-one.test')
+ ->assertSee('https://sponsor-two.test');
}
}