spaanproductions/office365-laravel
最新稳定版本:v0.0.4
Composer 安装命令:
composer require spaanproductions/office365-laravel
包简介
A Office365 package for Laravel 9.0 or higher
README 文档
README
A Office365 package for Laravel 9.0 or higher
Installation
composer require spaanproductions/office365-laravel
This package wil register this ServiceProvider automatically in Laravel.
SpaanProductions\Office365\Office365ServiceProvider::class,
You can optionaly publish the config files.
php artisan vendor:publish --provider="SpaanProductions\Office365\Office365ServiceProvider"
Get your app id and secret from Application Registration Portal
Then put them in the environment file
OFFICE365_TENANT_ID=
OFFICE365_CLIENT_ID=
OFFICE365_CLIENT_SECRET=
OFFICE365_OBJECT_ID=
OFFICE365_REDIRECT_URI=http://localhost:8000/redirect
OFFICE365_SCOPES='openid profile offline_access User.Read Mail.Read'
Example Usage
<?php
namespace App\Http\Controllers;
use SpaanProductions\Office365\Facade\Office365;
class AuthController extends Controller
{
public function signin()
{
$link = Office365::login();
return redirect($link);
}
public function redirect()
{
if (!request()->has('code')) {
abort(500);
}
$code = Office365::getAccessToken(request()->get('code'));
$user = Office365::getUserInfo($code['token']);
$messages = Office365::getEmails($code['token']);
dd($user, $messages);
}
}
Methods supported by this package and their parameters can be found in the API Reference
Issues
If you have any questions or issues, please open an Issue .
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-03