PHP code example of hardywen / yimei

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

    

hardywen / yimei example snippets


	'providers' => array(
	    '...',
	    'Hardywen\Yimei\YimeiServiceProvider',
	)
	
	
	'aliases' => array(
	    '...',
	    'Yimei'            => 'Hardywen\Yimei\Facades\YimeiFacade',
	)
 artisan config:publish hardywen/yimei

$content = Yimei::getContent(); //可以传入 code 参数。将通过config里面的内容模板渲染出来。不传code参数则会自动生成6位随机数字
$msg = Yimei::sendSMS(['138xxxxxxxx','138xxxxxxxx'], $content);

	$config = [];//配置项,没有配置的会使用config.php中的配置。
	$yimei = Yimei::newInstance($config);
	$content = $yimei->getContent();
	$yimei->sendSMS([],$content);
app/config/app.php