atnic/laravel-email-verification
Composer 安装命令:
composer require atnic/laravel-email-verification
包简介
Laravel Email Verification Scaffolding
README 文档
README
Implementation
Laravel Email Verification is a package for generate scaffolding code for email verification within just few step.
But before that make sure you already config you .env especially for MAIL_* keys. I prefer you to set up using mailtrap.io, its super easy!
Okay, then this is the step to install Laravel Email Verification:
- Install this package
composer require atnic/laravel-email-verification
- Make sure you're already run
php artisan make:authbefore, then run
php artisan make:email-verification
- Run migration to add
email_verifiedcolumn to users table
php artisan migrate
- Add
Atnic\EmailVerification\Traits\EmailVerifiabletrait toUsermodel.
<?php ... use Atnic\EmailVerification\Traits\EmailVerifiable; class User extends Authenticatable { use EmailVerifiable; ...
- In
app/Http/Kernel.php, modify$routeMiddlewareproperty, changeauthmiddleware
<?php ... class Kernel extends HttpKernel { ... protected $routeMiddleware = [ // 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth' => \Atnic\EmailVerification\Http\Middleware\Authenticate::class, ...
- Override
registered()method onRegisterController
<?php ... use Atnic\EmailVerification\Notifications\EmailVerification; class RegisterController extends Controller { ... /** * The user has been registered. * * @param \Illuminate\Http\Request $request * @param mixed $user * @return mixed */ protected function registered($request, $user) { $user->notify(new EmailVerification($user->generateEmailVerificationUrl())); if ($user->isEmailVerificationTimeoutExpired()) { auth()->logout(); return response()->redirectToRoute('verify_email.resend', [ 'email' => $user->email ])->with('status', __('email-verification::verify_email.link_sent')); } } ...
- Done!
Advance Usage
In User model you can add $emailVerificationTimeout using integer value that define how much time in minutes user can logged in even when their email is unverified yet. You can notify them that their email is not verified and can click this link to resend email verfication. route('verify_email.resend', [ 'email' => 'some_email' ]). The default is 0, so user can't be login if email is not verified.
Security Vulnerabilities
If you discover a security vulnerability within Laravel Email Verification, please send an e-mail to Farid Inawan via frdteknikelektro@gmail.com. All security vulnerabilities will be promptly addressed.
License
Laravel Email Verification is open-sourced package licensed under the MIT license.
atnic/laravel-email-verification 适用场景与选型建议
atnic/laravel-email-verification 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 186 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「email」 「laravel」 「packages」 「verification」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 atnic/laravel-email-verification 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 atnic/laravel-email-verification 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 atnic/laravel-email-verification 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Laravel contact us form package to send email and save to database
Alfabank REST API integration
A plugin for saving emails to a list
统计信息
- 总下载量: 186
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-29