tp6隊列消息
composer require topthink/think\-queue
//配置文件位于config/queue.php
\[
'default'\=>'sync' //驅動類型,可選擇 sync(默認):同步執行,database:數據庫驅動,red
is:Redis驅動,topthink:Topthink驅動
\]
驗證碼生成
composer require topthink/think-captcha
//控制器中
public function captcha($id \= '')
{
return captcha($id);
}
//路由定義
\\think\\facade\\Route::get('captcha/\[:id\]', "\\\\think\\\\captcha\\\\CaptchaController@
index");
//驗證
$this\->validate($data,\[
'captcha|驗證碼'\=>'require|captcha'
\]);
//手動驗證
if(!captcha\_check($captcha)){
//驗證失敗
};