magiclabs/magic-laravel
最新稳定版本:v0.1.6
Composer 安装命令:
composer require magiclabs/magic-laravel
包简介
Magic Admin Laravel Library
README 文档
README
This package provides direct Laravel integration for Magic Admin PHP SDK.
Requirements
Laravel 5.3 or newer.
Installation
Run this command to install via composer.
composer require magiclabs/magic-laravel
Older Laravel Installations
If you are using Laravel 5.5 or newer then skip this part. Otherwise you will need to manually register the service provider and facade alias by going to config/app.php.
Add to the providers array:
MagicLaravel\ServiceProvider::class
Add to the aliases array:
'Magic' => MagicLaravel\Facade::class,
Setup
Publish config file.
php artisan vendor:publish --provider="MagicLaravel\ServiceProvider"
Add MAGIC_SECRET_API_KEY to your .env file by going to the Magic Dashboard.
MAGIC_SECRET_API_KEY=sk_XXXX_XXXXXXXXXXXXXXXX
Usage
For complete documentation see Magic Admin PHP SDK and the Magic docs.
Get instance using the app helper:
$magic = app('MagicLaravel\Magic');
$magic->token->validate('<DID_Token>');
$magic->user->get_metadata_by_token('<DID_Token>');
Or get instance using the facade:
use Magic;
Magic::token()->validate('<DID_Token>');
Magic::user()->get_metadata_by_token('<DID_Token>');
统计信息
- 总下载量: 7.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-24