miguel_costa / office365api
此包已被弃用且不再维护。未建议替代包。
Microsoft Graph API 1.0连接的第一个测试
1.0
2016-09-05 17:33 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
- league/oauth2-client: ^1.4
Requires (Dev)
- phpunit/phpunit: ~4.0||~5.0
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is auto-updated.
Last update: 2021-05-07 15:30:48 UTC
README
这是对Laravel 5的第一个包测试,实际上已经工作,正确获取了Microsoft Graph api的连接,一旦我有时间,我会更好地记录这个文件,这个项目的目的是扩大并扩展类,包括API的所有选项(发送电子邮件、读取电子邮件、控制日历、创建事件、创建用户等)。
安装
通过Composer
$ composer require miguel_costa/office365api
在config文件夹的app.php文件中添加提供者
Miguel_Costa\Office365API\Office365APIServiceProvider::class,
在您的文件夹中发布配置文件config/Office365API.php
$ php artisan vendor:publish
最后,在配置文件夹中配置文件Office365API.php,使用您在Microsoft Dev Portal的API凭据
应用程序注册门户
'CLIENT_ID' => 'your id string goes here...', 'CLIENT_SECRET' => 'your secret key goes here...', 'REDIRECT_URI' => 'your redirect url, Should be the route of laravel where will redirect once the connection is finished',
用法
//use the namespace corretly on your controller use Miguel_Costa\Office365API\ConnectAPI; //example of function to make the connection public function redirect_connect() { ConnectAPI::connect_officeAPI(); } //get the connection and redirect the user to the intended page public function get_connection() { ConnectAPI::get_connection(); return view('home'); }
在blade视图中获取连接:连接保存了一个用户名和电子邮件的Session变量,因此连接后可以像这样访问变量
@if(Session::has('office365_name')) <p>Welcome, <b>{{Session::get('office365_name')}}</b></p> <p>You are logged in with the Office365 Account:<b>{{Session::get('office365_email')}}</b></p> @endif
变更日志
请参阅CHANGELOG以获取有关最近更改的更多信息。
贡献
请参阅CONTRIBUTING和CONDUCT以获取详细信息。
安全
如果您发现任何与安全相关的问题,请通过电子邮件"tga_miguel_tga@hotmail.com"联系,而不是使用问题跟踪器。
鸣谢
- [Miguel Costa][https://github.com/killmi]
- 所有贡献者
许可
MIT许可(MIT)。请参阅许可文件以获取更多信息。