dotenv / instagram
一个受 socialite 库启发的 Laravel 库,用于验证用户并从 Instagram API 获取数据。
v0.0.1
2017-06-02 19:23 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0|~6.0
- illuminate/contracts: ~5.0
- illuminate/http: ~5.0
- illuminate/support: ~5.0
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-09-29 03:25:52 UTC
README
一个受 socialite 库启发的 Laravel 库,用于验证用户并从 Instagram API 获取数据。
安装
可以使用以下命令通过 composer 安装此包
composer require dotenv/instagram
用法
1 - 在 app/config.php 文件中添加 ServiceProvider。
Dotenv\Instagram\Providers\InstagramServiceProvider::class,
2 - 在 app/config.php 文件中注册别名。
'Instagram' => Dotenv\Instagram\Facades\Instagram::class,
3 - 在 app/config.php 文件中注册 facade 别名。
'Instagram' => Dotenv\Instagram\Facades\Instagram::class,
4 - 发布配置文件。
php artisan vendor:publish --provider="dotenv\instagram"
5 - 如何使用它?
Route::get('auth/', function() { return \Instagram::authenticate(); }); Route::get('auth/callback', function() { $user = \Instagram::retrieveUser(); $userFromToken = \Instagram::userFromToken($user->token); });
6 - 前往 wiki 查看完整文档。
许可证
Instagram 库采用 [MIT 许可证 (MIT)] (https://github.com/dotenv/instagram/blob/master/LICENSE) (LICENSE) 许可。