Installation
tilttek/questscomposer require tilttek/quests
The library needs PHP 8.5 or later, tilttek/activity — the journal its steps read —, phil/resource and psr/clock.
It has no other dependency, and no gamification package: points, badges or items a quest rewards are given by the
application.
To use it, an application:
- builds a
Catalog—InMemoryCatalog::fromArray()over its configuration, or a catalog of its own over a database; - implements the four stores of Writing a store, or takes those in memory for tests and scripts;
- builds an
Evaluatorover the catalog and the stores, thenQuests,Duelsand aQuestProjection, giving the last two aQuestObserverthat gives the rewards; - registers the projection with the
Projectoroftilttek/activity, live throughLiveProjectionsor by a task that catches it up.
In a Symfony application, tilttek/quests-bundle does all of this.