huangdijia / laravel-youdu
youdu sdk for laravel
Fund package maintenance!
huangdijia
hdj.me/sponsors
Installs: 4 922
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=8.0
- guzzlehttp/guzzle: ^6.4|^7.0
- illuminate/contracts: ^9.0|^10.0
- illuminate/notifications: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
Requires (Dev)
- huangdijia/php-coding-standard: ^1.2
- orchestra/testbench: ^7.0|^8.0
- phpstan/phpstan: ^1.0
- 3.x-dev
- v3.0.1
- v3.0.0
- v3.0.0-beta.3
- v3.0.0-beta.2
- v3.0.0-beta.1
- 2.x-dev
- v2.0.4
- v2.0.3
- v2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta2
- 2.0.0-beta
- 1.x-dev
- v1.7.5
- v1.7.4
- v1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.1.2
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2024-11-27 02:11:48 UTC
README
Please use youduphp/laravel-youdu instead
Installation
Laravel
composer
composer require "huangdijia/laravel-youdu:2.*"
publish
php artisan vendor:publish --provider="Huangdijia\\Youdu\\YouduServiceProvider"
Lumen
add YouduServiceProvider
to bootstrap/app.php
$app->register(Illuminate\Notifications\NotificationServiceProvider::class); // must before YouduServiceProvider $app->register(Huangdijia\Youdu\YouduServiceProvider::class);
copy youdu.php
to config/
cp vendor/huangdijia/laravel-youdu-message/config/youdu.php config
Usage
Send text message
use Huangdijia\Youdu\Facades\Youdu; Youdu::send('user1|user2', 'dept1|dept2', 'test'); // send to user and dept Youdu::sendToUser('user1|user2', 'test'); // send to user Youdu::sendToDept('dept1|dept2', 'test'); // send to dept
Send other type
use Huangdijia\Youdu\Facades\Youdu; Youdu::send('user1|user2', 'dept1|dept2',new Text('test')); Youdu::sendToUser('user1|user2', new Image($mediaId)); // $mediaId 通过 uploadFile 接口获得 Youdu::sendToDept('dept1|dept2', new File($mediaId)); // $mediaId 通过 uploadFile 接口获得 // ...
Message types
Upload file
use Huangdijia\Youdu\Facades\Youdu; Youdu::uploadFile($file, $fileType); // $fileType image代表图片、file代表普通文件、voice代表语音、video代表视频
Download file
use Huangdijia\Youdu\Facades\Youdu; Youdu::downloadFile($mediaId, $savePath);