PHP code example of larva / laravel-baidu

1. Go to this page and download the library: Download larva/laravel-baidu 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-baidu example snippets


'providers' => [
    // ...
    Larva\LaravelBaidu\ServiceProvider::class,
],
'aliases' => [
    // ...
    'EasyBaidu' => Larva\LaravelBaidu\Facade::class,
],

$app->register(Larva\LaravelBaidu\ServiceProvider::class);


  $miniProgram = \EasyBaidu::miniProgram(); // 小程序
  
  // 均支持传入配置账号名称
  \EasyBaidu::miniProgram('foo'); // `foo` 为配置文件中的名称,默认为 `default`
  //...
shell
php artisan vendor:publish --provider="Larva\LaravelBaidu\ServiceProvider"