Package Data | |
---|---|
Maintainer Username: | BraunsonYager |
Maintainer Contact: | braunson@geekybeaver.ca (Braunson Yager) |
Package Create Date: | 2014-06-12 |
Package Last Update: | 2024-07-06 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-22 15:02:30 |
Package Statistics | |
---|---|
Total Downloads: | 7,059 |
Monthly Downloads: | 51 |
Daily Downloads: | 0 |
Total Stars: | 13 |
Total Watchers: | 5 |
Total Forks: | 9 |
Total Open Issues: | 0 |
The FatSecret API for Laravel gives you access to the FatSecret API.
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.
While it may be unsupported now, you can find 4.x compatible versions in the laravel4
branch or tagged with 4.0
Install the braunson/fatsecret-laravel
package
$ composer require "braunson/fatsecret-laravel"
Update config/app.php
to activate FatSecret package
# Add `FatSecretServiceProvider` to the `providers` array
'providers' => array(
...
'Braunson\FatSecret\FatSecretServiceProvider',
)
# Add the FatSecret Facade to the `aliases` array
'aliases' => array(
...
'FatSecret' => 'Braunson\FatSecret\Facade',
)
Go to config/services.php
and add this in with your details in the provided array
// API Key & Secret (http://platform.fatsecret.com)
'fatsecret' => [
'secret' => env('FATSECRET_SECRET'),
'key' => env('FATSECRET_KEY'),
],
Open your .env
file and add in
FATSECRET_SECRET=YOUR-API-SECRET
FATSECRET_KEY=YOUR-API-KEY
When you are using this package in a file, make sure to add this to the top of your file:
use Fatsecret;
The FatSecret is available as FatSecret
, for example:
FatSecret::ProfileCreate($userID, &$token, &$secret);
For more information on using the FatSecret API check out the documentation
FatSecret::searchIngredients($search_phrase, $page, $maxresults)
FatSecret::getIngredient($ingredient_id)
FatSecret::GetKey()
FatSecret::SetKey()
FatSecret::GetSecret()
FatSecret::SetSecret()
FatSecret::ProfileCreate($userID, $token, $secret)
FatSecret::ProfileGetAuth($userID, $token, $secret)
FatSecret::ProfileRequestScriptSessionKey($auth, $expires, $consumeWithin, $permittedReferrerRegex, $cookie, $sessionKey)
Please report any bugs or feature requests on the github issues page for this project here:
https://github.com/braunson/fatsecret/issues
composer install && ./vendor/bin/phpunit
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.