2017 © Pedro Peláez
 

library lafitbit

Laravel 4 Wrapper for fitbitphp package

image

jsamos/lafitbit

Laravel 4 Wrapper for fitbitphp package

  • Monday, December 16, 2013
  • by jsamos
  • Repository
  • 2 Watchers
  • 1 Stars
  • 73 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

lafitbit

Laravel 4 Wrapper for fitbitphp package, (*1)

Setup

composer.json, (*2)

{
    "require": {
        "slender/auth": "dev-master"
    }
}

add service provider and facade to app/config/app.php, (*3)

'providers' => array(
    ...
    'Jsamos\Lafitbit\LafitbitServiceProvider',
    ...
);

...

'aliases' => array(
    ...
    'Fitbit'          => 'Jsamos\Lafitbit\Facades\Fitbit',
    ...
);

Usage

Each of the ApiGateways in the parent project are available through static methods, (*4)

e.g. $factory->getUserGateway becomes Fitbit::user(), (*5)

Example

class FitbitController extends Controller {

    public function oauth()
    {

        $auth = Fitbit::authentication();
        $auth->initiateLogin();

    }

    public function authenticate()
    {
        $auth = Fitbit::authentication();
        $oauth_token = Input::get('oauth_token');
        $oauth_verifier = Input::get('oauth_verifier');
        $auth->authenticateUser($oauth_token, $oauth_verifier);

        if ($auth->isAuthorized()) {
            $profile = Fitbit::user()->getProfile();
            var_dump($profile);
        } else {
            echo 'Not connected.';
        }
    }

}

The Versions

16/12 2013

dev-master

9999999-dev

Laravel 4 Wrapper for fitbitphp package

  Sources   Download

Apache-2.0

The Requires

 

laravel fitbit

16/12 2013

dev-dev

dev-dev

Laravel 4 Wrapper for fitbitphp package

  Sources   Download

Apache-2.0

The Requires

 

laravel fitbit