tebros/laravel-email-confirmation
Composer 安装命令:
composer require tebros/laravel-email-confirmation
包简介
Email confirmation integration for the Laravel framework.
关键字:
README 文档
README
This package integrates an email confirmation into the default laravel authentification.
It is has been developed and tested for Laravel 5.5 but it should also work with other versions of Laravel.
Installation
Make use of composer to require this package.
The installation appends a function call in the routes/web.php file automatically.
Please do not comment it out!
composer require tebros/laravel-email-confirmation
Run the make:auth command if not already done.
Skip this step if you have already executed the command in the past.
php artisan make:auth
Make a migration to create the needed table users_confirmation.
php artisan migrate
Edit the app/Http/Controllers/Auth/RegisterController.php file.
The editing is quite simple.
To hook into the default Laravel authentification prozess, you need to change the RegistersUsers trait at the top.
//comment out the line like this or just override it //use RegistersUsers; use \Tebros\EmailConfirmation\Traits\RegistersUsers; //use this trait instead of the default
Edit the app/Http/Controllers/Auth/LoginController.php file.
It is required to display correct a message if the account is not confirmed.
//comment out the line like this or just override it //use AuthenticatesUsers; use \Tebros\EmailConfirmation\Traits\AuthenticatesUsers; //use this trait instead of the default
Make sure your config/mail.php file contains these important settings:
- MAIL_DRIVER
- MAIL_HOST
- MAIL_PORT
- MAIL_USERNAME, MAIL_PASSWORD
- MAIL_FROM_ADDRESS, MAIL_FROM_NAME
Moreover, make sure your config/app.php file contains these important settings:
- APP_NAME
- APP_URL
Configuration and Publishing
After the installation you can make use of the confirm route name to link the Resend Confirmation E-Mail site.
Important! You should edit your auth/login.blade.php view and add this link to request a new confirmation email!
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password?
</a>
<a class="btn btn-link" href="{{ route('confirm') }}">
Resend Confirmation Link?
</a>
</div>
</div>
If you want to configure the email confirmation, run the following command.
You can modify the config/emailconfirmation.php file as you wish.
php artisan vendor:publish --tag=emailconfirmation-config
To change a message or text you can modify the files in the lang/vendor/emailconfirmation directory.
Run the following command to do this.
php artisan vendor:publish --tag=emailconfirmation-translation
If you do not want to use the default Laravel views, you can modify the views in the views/vendor/emailconfirmation directory.
Run the following command to do this.
php artisan vendor:publish --tag=emailconfirmation-views
Update
You can update the package by running the following command or update all of your dependencies with composer update.
composer update tebros/laravel-email-confirmation
If you want to update your published files like config/emailconfirmation.php, lang/vendor/emailconfirmation or views/vendor/emailconfirmation,
you can use the following commands.
Attention! These commands will override your published files. So please backup your config, views or lang files if you do not want to lose them!
php artisan vendor:publish --tag=emailconfirmation-config --force php artisan vendor:publish --tag=emailconfirmation-translation --force php artisan vendor:publish --tag=emailconfirmation-views --force
Uninstallation
You should remove the following two lines in your routes/web.php file.
// Register routes for email confirmation. The uri is "/confirm" Tebros\EmailConfirmation\Utils::routes();
Edit the app/Http/Controllers/Auth/RegisterController.php file and
the app/Http/Controllers/Auth/LoginController.php file to remove the Laravel hook.
//remove the comment that the orifinal trait is used use RegistersUsers; //remove the whole line or comment it out //use \Tebros\EmailConfirmation\Traits\RegistersUsers;
//remove the comment that the orifinal trait is used use AuthenticatesUsers; //remove the whole line or comment it out //use \Tebros\EmailConfirmation\Traits\AuthenticatesUsers;
Now just type the following command.
composer remove tebros/laravel-email-confirmation
License
This package is open-sourced software licensed under the MIT license
tebros/laravel-email-confirmation 适用场景与选型建议
tebros/laravel-email-confirmation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 50 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「email」 「laravel」 「confirmation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tebros/laravel-email-confirmation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tebros/laravel-email-confirmation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tebros/laravel-email-confirmation 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ConfirmationField is a form field for Atk14 applications. It's like the BooleanField (checkbox) but the ConfirmationField must be ticked.
Symfony bundle to require the user to confirm her update email address by clicking on a link sent to the new address. This should be part of the FriendsOfSymfony/UserBundle, but was not accepted as new feature by a maintainer.
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.
Action buttons and modals for Accelade - Filament-style actions with Blade templates
Laravel contact us form package to send email and save to database
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-14