PHP code example of miyayeh / trans

1. Go to this page and download the library: Download miyayeh/trans 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/ */

    

miyayeh / trans example snippets


  'stripe' => [
        'model' => App\User::class,
        'key' => env('STRIPE_KEY'),
        'secret' => env('STRIPE_SECRET'),
    ],
   // 下面是你添加的内容
   'youdao' => [
           'appKey' => env('YOUDAO_APP_KEY'),
           'appSecret' => env('YOUDAO_APP_SECRET'),
       ],
       
'baidutrans' => [
        'appKey' => env('BAIDU_APPID'),
        'appSecret' => env('BAIDU_APP_SECRET')
    ]   

BAIDU_APPID=app_key
BAIDU_APP_SECRET=app_secret

 //providers
 \MiyaYeh\Trans\BdTransServiceProvider::class

// aliases
"BdTrans" => \MiyaYeh\Trans\Facades\BdTransFacade::class

app('BdTrans')->translate('如何安装 Laravel'); 
//How to install the Laravel

// or 
use BdTrans;
BdTrans::translate('如何安装 Laravel');
//How to install the Laravel

app('BdTrans')->slug('如何安装 Laravel'); 
//how-to-install-the-laravel

// or 
use Translug;
BdTrans::slug('如何安装 Laravel');
//how-to-install-the-laravel