我正在创建laravel注册电子邮件验证,但我的链接未发送到邮件。我正在从本地主机执行此操作,请帮助我并向我提出答案。
用户模型
<?PHP
namespace App;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable, HasApiTokens, HasRoles;
/**
* The attributes that are mass assignable.
*
* @var arra
*/
protected $fillable = [
'name', 'email', 'password', 'phone', 'purpose', 'country', 'state'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
public function videorecordings()
{
return $this->hasMany(Videorecordings::class);
}
public function rearcameras()
{
return $this->hasMany(Rearcameras::class);
}
public function calllog()
{
return $this->hasMany(Calllog::class);
}
public function callrecordings()
{
return $this->hashMany(Callrecordings::class);
}
public function messages()
{
return $this->hashMany(Messages::class);
}
public function fbcallrecordings()
{
return $this->hasMany(Fbcallrecordings::class);
}
}
.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=*********
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=tls
死记硬背
Auth::routes(['verify' => true]);
仪表板控制器
public function __construct()
{
$this->middleware(['auth', 'verified']);
}
,并且我正在使用ajax保存用户数据,该数据可以正常工作,但链接未发送到用户电子邮件进行验证。 请检查我的代码并帮助我解决此问题。
预先感谢