本文整理汇总了PHP中Sentry::findGroupbyName方法的典型用法代码示例。如果您正苦于以下问题:PHP Sentry::findGroupbyName方法的具体用法?PHP Sentry::findGroupbyName怎么用?PHP Sentry::findGroupbyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentry
的用法示例。
在下文中一共展示了Sentry::findGroupbyName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendUserActivationEmail
/**
* Send User Actication Email
* @param string, string
* @return bool
*/
public static function sendUserActivationEmail($email, $role)
{
$tempPassword = Str::random(9);
try {
$user = Sentry::register(array('email' => $email, 'password' => $tempPassword));
$activationCode = $user->getActivationCode();
$group = Sentry::findGroupbyName($role);
$user->addGroup($group);
$link = (string) url() . '/auth/activateuser?activation_token=' . $activationCode . '&email=' . $email;
$data = array('link' => $link);
Mail::queue('emails.auth.activateuser', $data, function ($message) use($email) {
$message->to($email)->subject('Invitation to Join 92five app');
});
return true;
} catch (Exception $e) {
Log::error('Something went Wrong in Email Class - sendUserActivationEmail():' . $e->getMessage());
return false;
}
}