Wallogit.com
2017 © Pedro Peláez
Apipack integrates the api from Eden Framework into to Laravel. For more information, see the Eden Documentation., (*1)
php artisan config:publish apipack/eden
To get the latest version of Apipack, simply require it in your composer.json file., (*2)
"apipack/eden": "dev-master"
You'll then need to run composer install or composer update to download it and have the autoloader updated., (*3)
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., (*4)
'providers' => array(
'Apipack\Eden\EdenServiceProvider'
);
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., (*5)
'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:, (*6)
return array(
/*
* App credential
*
*/
'Google' => array(
'clientID' => '',
'clientSeceret' => '',
'redirectUrl' => '',
'ApiKey' => '',
),
'Facebook'=> array(
'appkey' => '',
'appsecret' => '',
'redirecturl' => '',
),
'Instagram'=>array(
'clientid' => '',
'clientsecret' => '',
'redirecturl' => '',
),
);
$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);
exit;
}
//Code is returned back from google
if(isset($_GET['code'])) {
//save it to session
$access = $auth->getAccess($_GET['code']);
$_SESSION['token'] = $access['access_token'];
}
If you have some problem, Contact taqmaninw@gmail.com my site :[www.laraveltut.com], (*7)