PHP code example of larva / laravel-bce

1. Go to this page and download the library: Download larva/laravel-bce library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

larva / laravel-bce example snippets


// config/app.php

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

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

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