larva/laravel-baidu-cloud

This is a Laravel expansion for the Baidu Cloud.

1.0.3 2021-03-18 08:49 UTC

This package is auto-updated.

Last update: 2024-12-18 17:02:58 UTC


README

This is a baidu cloud expansion for the laravel

License Latest Stable Version Total Downloads

接口支持

  • CDN
  • 自然语言处理 NLP
  • SMS

环境需求

  • PHP >= 7.1

Installation

composer require larva/laravel-baidu-cloud -vv

for Laravel

This service provider must be registered.

// config/app.php

'providers' => [
    '...',
    Larva\Baidu\Cloud\BaiduCloudServiceProvider::class,
];

Use

try {
	$cdn = \Larva\Baidu\Cloud\BaiduCloud::get('cdn');
	
} catch (\Exception $e) {
	print_r($e->getMessage());
}

try {
	$nlp = \Larva\Baidu\Cloud\BaiduCloud::get('nlp');
	$tags = $nlp->keywords('标题','内容');
    print_r($tags);
} catch (\Exception $e) {
	print_r($e->getMessage());
}