zloadmin / laravel-keep2share
该软件包最新版本(dev-master)没有可用的许可证信息。
laravel 的 Keep2share API 客户端
dev-master
2022-04-13 17:39 UTC
Requires
- php: >=7.0.0
- ext-curl: *
This package is auto-updated.
Last update: 2024-09-13 22:38:36 UTC
README
composer require zloadmin/laravel-keep2share:dev-master
设置配置
发布配置文件
php artisan vendor:publish --provider="LaravelKeep2Share\Providers\Keep2ShareServiceProvider"
在您的 .env 文件中添加访问令牌
KEEP2SHARE_ACCESS_TOKEN=your_token_here
或者用户名和密码
KEEP2SHARE_USERNAME=your_username
KEEP2SHARE_PASSWORD=your_password
使用方法 getBalance()
<?php use LaravelKeep2Share\Facades\Keep2Share; Keep2Share::getBalance();
使用其他方法
此软件包仅为原始 API 客户端的 laravel 门面(https://github.com/keep2share/api),您可以像使用静态方法一样使用任何公共方法
<?php /** login **/ Keep2Share::login(); /** getFiles **/ Keep2Share::getFilesList('/', 10, 0, ['date_created'=>-1], 'files'); /** upload **/ Keep2Share::uploadFile('PATH-TO-LOCAL-FILE'); /** getUrl **/ Keep2Share::GetUrl('ID-FILE'); /** createFolder **/ Keep2Share::createFolder('Any name'); /** getBalance **/ Keep2Share::getBalance();