Download the PHP package kaoken/laravel-confirmation-email without Composer
On this page you can find all versions of the php package kaoken/laravel-confirmation-email. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaoken/laravel-confirmation-email
More information about kaoken/laravel-confirmation-email
Files in kaoken/laravel-confirmation-email
Package laravel-confirmation-email
Short Description Laravel sends confirmation mail after Auth user first registration, complete registration is done after accessing designated address.
License MIT
Homepage https://github.com/kaoken/veritransjp-airweb-php-laravel
Informations about the package laravel-confirmation-email
laravel-confirmation-email
Laravel sends confirmation mail after Auth user first registration, complete registration is done after accessing designated address.
Table of content
- Install
- Setting
- Event
- License
Install
composer:
Setting
Add to config\app.php
as follows:
Example of adding to config\auth.php
add 'confirmation' => 'users',
.
When the Auth user is users
(Make sure Auth user name is table name!)
model
is a user model classprovider
is the user table nameemail_confirmation
should modify the class derived fromMailable as necessary. Used to send confirmation mail.email_registration
should modify the class derived fromMailable as necessary. Mail sent when complete registering.table
is the name of the table used for this service- If
expire
does not manipulate X hours after registration, the 1st registered user is deleted.
Command
After execution, the following directories and files are added.
database
migrations
2017_09_14_000001_create_confirmation_users_table.php
resources
lang
en
confirmation.php
ja
confirmation.php
views
vendor
confirmation
mail
confirmation.blade.php
registration.blade.php
registration.blade.php
Migration
Migration file 2017_09_14_000001_create_confirmation_users_table.php
should be modified as necessary.
Add to kernel
Add it to the schedule
method of app\Console\Kernel.php
.
This is used to delete users who passed 24 hours after 1st registration.
In the configuration config\auth.php
with the above setting,
Kaoken\LaravelConfirmation\Mail\ConfirmationMailToUser
of email_confirmation
is used as a confirmation mail at the time of 1st registration.
The template uses views\vendor\confirmation\confirmation.blade.php
.
Kaoken\LaravelConfirmation\Mail\RegistrationMailToUser
of email_registration
is used as a mail informing that the complete registration was done.
The template uses views\vendor\confirmation\registration.blade.php
.
Change according to the specifications of the application.
controller
Example of 1st registration, complete registration, login
Be sure to add $broker
.
Route
From the above controller!
Auth Model
Auth user model example
Added of Kaoken\LaravelConfirmation\HasConfirmation;
By using the confirmed()
method, we decide whether it is a registered user.
When using social login, it is good to incorporate confirmed()
so that it can be determined.
Events
See inside the vendor\kaoken\laravel-confirmation-email\src\Events
directory!
BeforeCreateUserEvent
Called before the user is created.
Warning: When this event is invoked, a DB transaction related to Auth user creation is in progress.
If you create an exception in the listener, the Auth user creation of the target is immediately rolled back.
BeforeDeleteUsersEvent
Called before deleting expired users.
This is only called if you deleteUserAndToken(true)
the method argument to true
in Confirmation::broker('hoge')->deleteUserAndToken();
.
Warning: When this event is called, the DB transaction associated with expired Auth user deletion is in progress.
If you create an exception with the listener, the target Auth user deletion is immediately rolled back.
CreatedUserEvent
Called after Auth user is created.
ConfirmationEvent
After sending the confirmation mail, An Auth user is created and called.
RegistrationEvent
Called after Auth user complete registration.