integrate api part in Eden Framework to Laravel 4


Laravel 4 Apipack

Apipack integrates the api from Eden Framework into to Laravel. For more information, see the Eden Documentation.

php artisan config:publish apipack/eden


To get the latest version of Apipack, simply require it in your composer.json file.

"apipack/eden": "dev-master"

You'll then need to run composer install or composer update to download it and have the autoloader updated.

Once Apipack is installed, you need to register the service provider with the application. Open up app/config/app.php and find the providers key.

'providers' => array(



Apipack also ships with a facade which provides the static syntax for creating collections. You can register the facade in the aliases key of your app/config/app.php file.

'aliases' => array(

    'Google'    => 'Apipack\Eden\Facade\Google',
    'Facebook'  => 'Apipack\Eden\Facade\Facebook',
    'Instagram' => 'Apipack\Eden\Facade\Instagram',



In the main configuration for Apipack, you can add app credential in this:

return array(
     * App credential 

    'Google' => array(
        'clientID' => '',
        'clientSeceret' => '',
        'redirectUrl' => '',
        'ApiKey' => '',
    'Facebook'=> array(
        'appkey' => '',
        'appsecret' => '',
        'redirecturl' => '',
        'clientid' => '',
        'clientsecret' => '',
        'redirecturl' => '',


Simple Usage

$auth = Google::auth();

//if no code and no session
if(!isset($_GET['code']) && !isset($_SESSION['token'])) {
    //redirect to login
    $login = $auth->getLoginUrl('calendar');
    header('Location: '.$login);

//Code is returned back from google
if(isset($_GET['code'])) {
    //save it to session
    $access = $auth->getAccess($_GET['code']);
    $_SESSION['token'] = $access['access_token'];


  • Amazon
  • Twitter
  • Payapl
  • Foursquare
  • Tumble

Support or Contact

If you have some problem, Contact taqmaninw@gmail.com my site :[www.laraveltut.com]