示例代码:
$validator = Validator::make($request->all(), [
'email' => 'required|email',
]);
if ($validator->fails()) {
return redirect('register')
->withErrors($validator)
->withInput();
}
示例代码:
.env 文件中设置邮件配置信息:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=youremail@gmail.com
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=ssl
config/mail.php 文件中设置邮件配置信息:
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 465),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
];
php -m | grep openssl
如果 openssl 扩展未启用,可以在 php.ini 文件中将以下行取消注释:
extension=php_openssl.dll # Windows extension=openssl.so # Linux / Unix
上一篇:AddressingMoveSelectionandHeuristicCalculationChallengesinHybridA*AlgorithmwithObstacles。
下一篇:Address模块未解析。