Skip to content

crisenchou/laravel-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-sms

安装配置简单的laravel手机短信集成库

安装

composer require "crisen/laravel-sms":"dev-master"

配置

在config的app.php文件中添加

'providers' => [
  ...
  Crisen\LaravelSms\SmsServiceProvider::class
];
'aliases' => [
...
  'Sms' => Crisen\LaravelSms\Facades\Sms::class
];

然后使用artisan vendor:publish发布配置文件

阿里云短信服务

use Sms;
...

public function foo(){
	$phone = "13800138000";
	$code = "1234";
	$template = "SMS_0000001";
  	$res = Sms::make()->to($phone)
		->message(json_encode(['code' => $code]))
		->template($template)
		->send();
	if($res){
        //do successful
	}
}

License

MIT

About

手机号发送短信解决方案

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages