Download the PHP package genealabs/laravel-registrar without Composer
On this page you can find all versions of the php package genealabs/laravel-registrar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download genealabs/laravel-registrar
More information about genealabs/laravel-registrar
Files in genealabs/laravel-registrar
Package laravel-registrar
Short Description User account activation via email confirmation for Laravel.
License MIT
Informations about the package laravel-registrar
This package is retired as of Laravel 5.7. Please use Laravel's Email Verification functionality: https://laravel.com/docs/5.7/verification
Registrar for Laravel
User account activation via email confirmation for Laravel.
Features
- Account activation through email verification.
- Blocks logins until account is activated.
- Uses Laravel Notifications to send out emails.
Reasoning
After having set up email activations on a few projects now, it became clear that this is something that is going to be used more often, warranting extraction to a package for easy reuse with minimal coding.
Requirements
- PHP 7.0.0+
- Laravel 5.3
Installation
Install the package using the following command:
Add the service provider to you app config file /config/app.php
:
Add the following trait to your login controller
/app/Http/Controllers/Auth/LoginController.php
:
And finally, add this trait to your User model:
Usage
Each time a new user is created, an activation token will be added to their record and an email activation notification sent out with a link that will activate their user account by removing the activation token and setting the activation timestamp. The user will then be able to log into their account.
Conditional Activation Notices
To send out the notification email only when a certain condition is met,
override the getCanBeActivatedAttribute()
method in your User
class. By
default this method returns true, unless you override it.
Customization
You can customize the notification email by implementing your own Notification class, then overriding the following method in your User class:
To alter the notification template itself, follow the steps outlined in the Laravel documentation: https://laravel.com/docs/5.3/notifications#customizing-the-templates.
All versions of laravel-registrar with dependencies
illuminate/routing Version 5.3 - 5.6
illuminate/view Version 5.3 - 5.6
genealabs/laravel-messenger Version *