2017 © Pedro Peláez
 

library credits-cache

A library to cache app credits locally. Requires Laravel.

image

tokenly/credits-cache

A library to cache app credits locally. Requires Laravel.

  • Tuesday, January 17, 2017
  • by dweller
  • Repository
  • 3 Watchers
  • 1 Stars
  • 1,136 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

App Credits Cache

A library to cache Tokenpass app credits locally. Requires Laravel., (*2)

Installation

  • composer require tokenly/credits-cache
  • Add Tokenly\CreditsCache\CreditBalanceCacheProvider::class to your list of service providers

Usage

Fetching a balance

$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., (*3)

Clearing the cache

To clear the local cache, fire a CreditBalanceChanged event. This will force a reload from Tokenpass on the next getCredits call., (*4)

use Tokenly\CreditsCache\CreditBalanceChanged;

event(new CreditBalanceChanged($credits_group_id, $user_account_uuid));

The Versions

17/01 2017

dev-master

9999999-dev

A library to cache app credits locally. Requires Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires