This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Services\Posts;
use App\Models\Achievement;
use App\Models\Post;
use App\Models\PostTarget;
use App\Models\User;
@@ -67,6 +68,16 @@ class PostAchievementService
], $artworkId);
}
public function achievementUnlocked(User $user, Achievement $achievement): void
{
$this->createAchievementPost($user, 'unlock_' . $achievement->slug, [
'achievement_id' => $achievement->id,
'achievement_name' => $achievement->name,
'message' => '🎉 Unlocked achievement: ' . $achievement->name,
'xp_reward' => (int) $achievement->xp_reward,
]);
}
// ─────────────────────────────────────────────────────────────────────────
private function createAchievementPost(