Skip to content

Commit

Permalink
Refactoring + Updated for Laravel 5 (composer)
Browse files Browse the repository at this point in the history
  • Loading branch information
Braunson committed Jun 14, 2016
1 parent e68fce3 commit cf04f09
Show file tree
Hide file tree
Showing 13 changed files with 478 additions and 432 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
composer.phar
composer.lock
.DS_Store
vendor/
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

before_script:
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Braunson Yager <braunson@geekybeaver.ca>
Copyright (c) 2016 Braunson Yager <braunson@geekybeaver.ca>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
68 changes: 33 additions & 35 deletions README.md
@@ -1,63 +1,61 @@
FatSecret API for Laravel
============================

The FatSecret API for Laravel gives you access through laravel to the FatSecret API.
The FatSecret API for Laravel gives you access to the FatSecret API.

[FatSecret](http://platform.fatsecret.com/api) 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.

How to Install
--------------

1. Install the `braunson/fatsecret-laravel` package
1. Install the `braunson/fatsecret` package

```shell
$ composer require "braunson/fatsecret-laravel:dev-master"
```
```shell
$ composer require "braunson/fatsecret:dev-master"
```

2. Update `app/config/app.php` to activate FatSecretAPI package

```php
# Add `FatsecretLaravelServiceProvider` to the `providers` array
'providers' => array(
...
'Braunson\FatsecretLaravel\FatsecretLaravelServiceProvider',
)
```php
# Add `FatSecretServiceProvider` to the `providers` array
'providers' => array(
...
'Braunson\FatSecret\FatSecretServiceProvider',
)

# Add the `FatsecretFacade` to the `aliases` array
'aliases' => array(
...
'Fatsecret' => 'Braunson\FatsecretLaravel\FatsecretFacade',
)
```
'aliases' => array(
...
)
```


Configuration
-------------

1. Generate a template Fatsecret config file
1. Generate a template FatSecret configuration file

```shell
$ php artisan config:publish braunson/fatsecret-laravel
```
```shell
$ php artisan config:publish braunson/fatsecret
```

2. Update `app/config/packages/braunson/fatsecret-laravel/config.php` with your
Fatsecret API key and API secret:
2. Update `app/config/packages/braunson/fatsecret/config.php` with your
FatSecret API key and API secret:

```php
return array(
'api_key' => 'YOUR-API-KEY-HERE',
'api_secret' => 'YOUR-API-SECRET-HERE',
);
```
```php
return array(
'api_key' => 'YOUR-API-KEY-HERE',
'api_secret' => 'YOUR-API-SECRET-HERE',
);
```


Usage
------------------------

The FatSecretAPI is available as `Fatsecret`, for example:
The FatSecretAPI is available as `FatSecret`, for example:

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

For more information on using the FatSecret API check out the [documentation](http://platform.fatsecret.com/api/)
Expand All @@ -68,13 +66,13 @@ Reporting Bugs or Feature Requests

Please report any bugs or feature requests on the github issues page for this project here:

<https://github.com/braunson/fatsecret-laravel/issues>
<https://github.com/braunson/fatsecret/issues>


Contributing
------------

- [Fork](https://help.github.com/articles/fork-a-repo) the [FatsecretLaravel on github](https://github.com/braunson/fatsecret-laravel)
- [Fork](https://help.github.com/articles/fork-a-repo) the [FatSecret on github](https://github.com/braunson/fatsecret)
- Commit and push until you are happy with your contribution
- Run the tests to make sure they all pass: `composer install && ./vendor/bin/phpunit`
- [Make a pull request](https://help.github.com/articles/using-pull-requests)
Expand All @@ -84,5 +82,5 @@ Contributing
License
-------

The Fatsecret Laravel API is free software released under the MIT License.
See [LICENSE](https://github.com/braunson/fatsecret-laravel/blob/master/LICENSE) for details. This is not an offical release and is released seperately from FatSecret.
The FatSecret Laravel API is free software released under the MIT License.
See [LICENSE](https://github.com/braunson/fatsecret/blob/master/LICENSE) for details. This is not an official release and is released separately from FatSecret.
42 changes: 23 additions & 19 deletions composer.json
@@ -1,21 +1,25 @@
{
"name": "braunson/fatsecret-laravel",
"description": "Unofficial FatSecret API library for Laravel",
"license": "MIT",
"authors": [
{
"name": "Braunson Yager",
"email": "braunson@geekybeaver.ca"
}
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "5.*"
},
"autoload": {
"psr-0": {
"Braunson\\FatsecretLaravel\\": "src/"
}
},
"minimum-stability": "dev"
"name": "braunson/fat-secret",
"description": "A PHP FatSecret API library for Laravel",
"keywords": ["fatsecret", "laravel", "fat", "secret", "braunson"],
"homepage": "https://github.com/braunson/fatsecret",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Braunson Yager",
"email": "braunson@geekybeaver.ca",
"homepage": "http://geekybeaver.ca"
}
],
"require": {
"php": ">=5.4.0",
"illuminate/support": ">=4.2"
},
"autoload": {
"psr-0": {
"Braunson": "src/"
}
},
"minimum-stability": "stable"
}
16 changes: 16 additions & 0 deletions src/Braunson/FatSecret/Facade.php
@@ -0,0 +1,16 @@
<?php namespace Braunson\FatSecret;

use Illuminate\Support\Facades\Facade as IlluminateFacade;

class Facade extends IlluminateFacade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'fatsecret';
}
}

0 comments on commit cf04f09

Please sign in to comment.