2017 © Pedro Peláez
 

library fatsecret-laravel

A PHP FatSecret API library for Laravel

image

braunson/fatsecret-laravel

A PHP FatSecret API library for Laravel

  • Friday, December 1, 2017
  • by BraunsonYager
  • Repository
  • 2 Watchers
  • 9 Stars
  • 225 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 2 Open issues
  • 6 Versions
  • 26 % Grown

The README.md

FatSecret API for Laravel

StyleCI Build Status codecov, (*1)

The FatSecret API for Laravel gives you access to the FatSecret API., (*2)

FatSecret provides you with access to comprehensive nutrition data for many thousands of foods, not to mention a range exercises and great weight management tools for your applications., (*3)

Requirements

  • Laravel versions: 5.6, 5.7 and 5.8

Looking for 4.x Compatibility?

While it may be unsupported now, you can find 4.x compatible versions in the laravel4 branch or tagged with 4.0, (*4)

How to Install

  1. Install the braunson/fatsecret-laravel package, (*5)

    $ composer require "braunson/fatsecret-laravel"
    
  2. Update config/app.php to activate FatSecret package, (*6)

    # Add `FatSecretServiceProvider` to the `providers` array
    'providers' => [
        ...
        Braunson\FatSecret\ServiceProvider::class,
    ]
    
    # Add the FatSecret Facade to the `aliases` array
    'aliases' => [
        ...
        'FatSecret' => Braunson\FatSecret\Facades\Facade::class,
    ]
    

Configuration

  1. Publish the config file:, (*7)

    php artisan vendor:publish --provider="Braunson\FatSecret\ServiceProvider"
    
  2. Open your .env file and add in, (*8)

    FATSECRET_KEY=YOUR-API-KEY
    FATSECRET_SECRET=YOUR-API-SECRET
    

Usage

When you are using this package in a file, make sure to add this to the top of your file:, (*9)

use Fatsecret;

The FatSecret is available as FatSecret, for example:, (*10)

FatSecret::ProfileCreate($userID, &$token, &$secret);

For more information on using the FatSecret API check out the documentation, (*11)

Methods

FatSecret::searchIngredients($search_phrase, $page, $maxresults)
  • Search ingredients by phrase, page and max results
FatSecret::getIngredient($ingredient_id)
  • Retrieve an ingredient by ID
FatSecret::GetKey()
  • Gets the set consumer key
FatSecret::SetKey()
  • Allows overriding or setting of the consumer key
FatSecret::GetSecret()
  • Gets the set secret key
FatSecret::SetSecret()
  • Allows overriding or setting of the secret key
FatSecret::ProfileCreate($userID, $token, $secret)
  • Allows creation of a profile in FS with a user specific ID.
FatSecret::ProfileGetAuth($userID, $token, $secret)
  • Get the authentication details of a profile
FatSecret::ProfileRequestScriptSessionKey($auth, $expires, $consumeWithin, $permittedReferrerRegex, $cookie, $sessionKey)
  • Create a new session for JavaScript API users

Reporting Bugs or Feature Requests

Please report any bugs or feature requests on the github issues page for this project here:, (*12)

https://github.com/braunson/fatsecret/issues, (*13)

Contributing

License

The FatSecret Laravel API is free software released under the MIT License. See LICENSE for details. This is not an official release and is released separately from FatSecret., (*14)

The Versions

01/12 2017

dev-master

9999999-dev https://github.com/braunson/fatsecret-laravel

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson

14/08 2017

5.0.1

5.0.1.0 https://github.com/braunson/fatsecret

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson

18/08 2016

dev-laravel4

dev-laravel4 https://github.com/braunson/fatsecret

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson

18/08 2016

4.0

4.0.0.0 https://github.com/braunson/fatsecret

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson

14/06 2016

dev-laravel5

dev-laravel5 https://github.com/braunson/fatsecret

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson

14/06 2016

5.0

5.0.0.0 https://github.com/braunson/fatsecret

A PHP FatSecret API library for Laravel

  Sources   Download

MIT

The Requires

 

laravel secret fatsecret fat braunson