Skip to content

Commit

Permalink
Merge pull request #2212 from codeeu/2210-2024-badges
Browse files Browse the repository at this point in the history
2024 Badges
  • Loading branch information
alainvd authored Jan 24, 2024
2 parents 3335072 + 95c497e commit 6d7c620
Show file tree
Hide file tree
Showing 22 changed files with 244 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/Achievements/AchievementsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@ class AchievementsServiceProvider extends ServiceProvider
Types\InfluencerActive2023::class,
Types\InfluencerExpert2023::class,
Types\InfluencerChampion2023::class,
Types\InfluencerLegendary2023::class
Types\InfluencerLegendary2023::class,
Types\OrganiserActive2024::class,
Types\OrganiserExpert2024::class,
Types\OrganiserChampion2024::class,
Types\OrganiserLegendary2024::class,
Types\OrganiserMaster2024::class,
Types\Influencer2024::class,
Types\InfluencerActive2024::class,
Types\InfluencerExpert2024::class,
Types\InfluencerChampion2024::class,
Types\InfluencerLegendary2024::class

];

Expand Down
24 changes: 24 additions & 0 deletions app/Achievements/Types/Influencer2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class Influencer2024 extends AchievementType
{
public $icon = 'influencer/influencer_normal_2024.png';
public $edition = 2024;
public $name = 'Influencer 2024';

public function description()
{
return 'Spread your influence more to get 10 bits';
}

public function qualifier($user)
{
return $user->influence($this->edition) >= 10;
}


}
24 changes: 24 additions & 0 deletions app/Achievements/Types/InfluencerActive2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class InfluencerActive2024 extends AchievementType
{
public $icon = 'influencer/influencer_active_2024.png';
public $edition = 2024;
public $name = 'Active Influencer 2024';

public function description()
{
return 'Spread your influence more to get 20 bits';
}

public function qualifier($user)
{
return $user->influence($this->edition) >= 20;
}


}
24 changes: 24 additions & 0 deletions app/Achievements/Types/InfluencerChampion2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class InfluencerChampion2024 extends AchievementType
{
public $icon = 'influencer/influencer_champion_2024.png';
public $edition = 2024;
public $name = 'Champion Influencer 2024';

public function description()
{
return 'Spread your influence more to get 40 bits';
}

public function qualifier($user)
{
return $user->influence($this->edition) >= 40;
}


}
24 changes: 24 additions & 0 deletions app/Achievements/Types/InfluencerExpert2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class InfluencerExpert2024 extends AchievementType
{
public $icon = 'influencer/influencer_expert_2024.png';
public $edition = 2024;
public $name = 'Expert Influencer 2024';

public function description()
{
return 'Spread your influence more to get 30 bits';
}

public function qualifier($user)
{
return $user->influence($this->edition) >= 30;
}


}
24 changes: 24 additions & 0 deletions app/Achievements/Types/InfluencerLegendary2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class InfluencerLegendary2024 extends AchievementType
{
public $icon = 'influencer/influencer_legendary_2024.png';
public $edition = 2024;
public $name = 'Legendary Influencer 2024';

public function description()
{
return 'Spread your influence more to get 60 bits';
}

public function qualifier($user)
{
return $user->influence($this->edition) >= 60;
}


}
24 changes: 24 additions & 0 deletions app/Achievements/Types/OrganiserActive2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Achievements\Types;

use Illuminate\Support\Facades\Log;

class OrganiserActive2024 extends AchievementType
{
public $icon = 'organiser/organiser_active_2024.png';
public $edition = 2024;
public $name = 'Active Organiser 2024';

public function description()
{
return 'Report 5 activities to unlock';
}

public function qualifier($user)
{
return $user->reported($this->edition) >= 5;
}


}
22 changes: 22 additions & 0 deletions app/Achievements/Types/OrganiserChampion2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Achievements\Types;

class OrganiserChampion2024 extends AchievementType
{
public $icon = 'organiser/organiser_champion_2024.png';
public $edition = 2024;
public $name = 'Champion Organiser 2024';

public function description()
{
return 'Report 15 activities to unlock';
}

public function qualifier($user)
{
return $user->reported($this->edition) >= 15;
}


}
22 changes: 22 additions & 0 deletions app/Achievements/Types/OrganiserExpert2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Achievements\Types;

class OrganiserExpert2024 extends AchievementType
{
public $icon = 'organiser/organiser_expert_2024.png';
public $edition = 2024;
public $name = 'Expert Organiser 2024';

public function description()
{
return 'Report 10 activities to unlock';
}

public function qualifier($user)
{
return $user->reported($this->edition) >= 10;
}


}
22 changes: 22 additions & 0 deletions app/Achievements/Types/OrganiserLegendary2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Achievements\Types;

class OrganiserLegendary2024 extends AchievementType
{
public $icon = 'organiser/organiser_legendary_2024.png';
public $edition = 2024;
public $name = 'Legendary Organiser 2024';

public function description()
{
return 'Report 20 activities to unlock';
}

public function qualifier($user)
{
return $user->reported($this->edition) >= 20;
}


}
22 changes: 22 additions & 0 deletions app/Achievements/Types/OrganiserMaster2024.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Achievements\Types;

class OrganiserMaster2024 extends AchievementType
{
public $icon = 'organiser/organiser_master_2024.png';
public $edition = 2024;
public $name = 'Master Organiser 2024';

public function description()
{
return 'Report 30 activities to unlock';
}

public function qualifier($user)
{
return $user->reported($this->edition) >= 30;
}


}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/badges/organiser/organiser_active_2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/badges/organiser/organiser_expert_2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/badges/organiser/organiser_master_2024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/Feature/UserProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function it_should_display_user_name()
public function it_should_display_achievements()
{

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

Expand Down

0 comments on commit 6d7c620

Please sign in to comment.