Skip to content

Commit 95c497e

Browse files
committed
2024 Badges
1 parent 3335072 commit 95c497e

22 files changed

+244
-1
lines changed

app/Achievements/AchievementsServiceProvider.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ class AchievementsServiceProvider extends ServiceProvider
4747
Types\InfluencerActive2023::class,
4848
Types\InfluencerExpert2023::class,
4949
Types\InfluencerChampion2023::class,
50-
Types\InfluencerLegendary2023::class
50+
Types\InfluencerLegendary2023::class,
51+
Types\OrganiserActive2024::class,
52+
Types\OrganiserExpert2024::class,
53+
Types\OrganiserChampion2024::class,
54+
Types\OrganiserLegendary2024::class,
55+
Types\OrganiserMaster2024::class,
56+
Types\Influencer2024::class,
57+
Types\InfluencerActive2024::class,
58+
Types\InfluencerExpert2024::class,
59+
Types\InfluencerChampion2024::class,
60+
Types\InfluencerLegendary2024::class
5161

5262
];
5363

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class Influencer2024 extends AchievementType
8+
{
9+
public $icon = 'influencer/influencer_normal_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Influencer 2024';
12+
13+
public function description()
14+
{
15+
return 'Spread your influence more to get 10 bits';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->influence($this->edition) >= 10;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class InfluencerActive2024 extends AchievementType
8+
{
9+
public $icon = 'influencer/influencer_active_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Active Influencer 2024';
12+
13+
public function description()
14+
{
15+
return 'Spread your influence more to get 20 bits';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->influence($this->edition) >= 20;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class InfluencerChampion2024 extends AchievementType
8+
{
9+
public $icon = 'influencer/influencer_champion_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Champion Influencer 2024';
12+
13+
public function description()
14+
{
15+
return 'Spread your influence more to get 40 bits';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->influence($this->edition) >= 40;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class InfluencerExpert2024 extends AchievementType
8+
{
9+
public $icon = 'influencer/influencer_expert_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Expert Influencer 2024';
12+
13+
public function description()
14+
{
15+
return 'Spread your influence more to get 30 bits';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->influence($this->edition) >= 30;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class InfluencerLegendary2024 extends AchievementType
8+
{
9+
public $icon = 'influencer/influencer_legendary_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Legendary Influencer 2024';
12+
13+
public function description()
14+
{
15+
return 'Spread your influence more to get 60 bits';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->influence($this->edition) >= 60;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
use Illuminate\Support\Facades\Log;
6+
7+
class OrganiserActive2024 extends AchievementType
8+
{
9+
public $icon = 'organiser/organiser_active_2024.png';
10+
public $edition = 2024;
11+
public $name = 'Active Organiser 2024';
12+
13+
public function description()
14+
{
15+
return 'Report 5 activities to unlock';
16+
}
17+
18+
public function qualifier($user)
19+
{
20+
return $user->reported($this->edition) >= 5;
21+
}
22+
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
class OrganiserChampion2024 extends AchievementType
6+
{
7+
public $icon = 'organiser/organiser_champion_2024.png';
8+
public $edition = 2024;
9+
public $name = 'Champion Organiser 2024';
10+
11+
public function description()
12+
{
13+
return 'Report 15 activities to unlock';
14+
}
15+
16+
public function qualifier($user)
17+
{
18+
return $user->reported($this->edition) >= 15;
19+
}
20+
21+
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
class OrganiserExpert2024 extends AchievementType
6+
{
7+
public $icon = 'organiser/organiser_expert_2024.png';
8+
public $edition = 2024;
9+
public $name = 'Expert Organiser 2024';
10+
11+
public function description()
12+
{
13+
return 'Report 10 activities to unlock';
14+
}
15+
16+
public function qualifier($user)
17+
{
18+
return $user->reported($this->edition) >= 10;
19+
}
20+
21+
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
class OrganiserLegendary2024 extends AchievementType
6+
{
7+
public $icon = 'organiser/organiser_legendary_2024.png';
8+
public $edition = 2024;
9+
public $name = 'Legendary Organiser 2024';
10+
11+
public function description()
12+
{
13+
return 'Report 20 activities to unlock';
14+
}
15+
16+
public function qualifier($user)
17+
{
18+
return $user->reported($this->edition) >= 20;
19+
}
20+
21+
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Achievements\Types;
4+
5+
class OrganiserMaster2024 extends AchievementType
6+
{
7+
public $icon = 'organiser/organiser_master_2024.png';
8+
public $edition = 2024;
9+
public $name = 'Master Organiser 2024';
10+
11+
public function description()
12+
{
13+
return 'Report 30 activities to unlock';
14+
}
15+
16+
public function qualifier($user)
17+
{
18+
return $user->reported($this->edition) >= 30;
19+
}
20+
21+
22+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

tests/Feature/UserProfileTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function it_should_display_user_name()
4242
public function it_should_display_achievements()
4343
{
4444

45+
$this->withoutExceptionHandling();
4546
$response = $this->get('/badges/user/222');
4647
$response->assertSee('Active Organiser ' . Carbon::now()->year);
4748

0 commit comments

Comments
 (0)