Package Data | |
---|---|
Maintainer Username: | dweller |
Maintainer Contact: | devon@tokenly.com (Devon Weller) |
Package Create Date: | 2017-01-17 |
Package Last Update: | 2020-05-07 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-20 03:03:34 |
Package Statistics | |
---|---|
Total Downloads: | 1,146 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 0 |
A library to cache Tokenpass app credits locally. Requires Laravel.
composer require tokenly/credits-cache
Tokenly\CreditsCache\CreditBalanceCacheProvider::class
to your list of service providers$credits_cache = app(\Tokenly\CreditsCache\CreditBalanceCache::class);
$credit_balance = $credits_cache->getCredits($credits_group_id, $user_account_uuid);
If no local cache balance is present, the cache will call the Tokenpass API and populate it.
To clear the local cache, fire a CreditBalanceChanged event. This will force a reload from Tokenpass on the next getCredits
call.
use Tokenly\CreditsCache\CreditBalanceChanged;
event(new CreditBalanceChanged($credits_group_id, $user_account_uuid));