dev-master
9999999-dev https://github.com/AgelxNash/l4-confirm-actionLaravel 4 confirm user action
MIT
The Requires
- php >=5.3.0
- illuminate/support ~4
laravel user illuminate action confirm
Wallogit.com
2017 © Pedro Peláez
Laravel 4 confirm user action
Add l4-confirm-action to you composer.json file:, (*1)
"require": {
"agelxnash/l4-confirm-action": "dev-master"
}
Now, run a composer update on the command line from the root of your project:, (*2)
composer update
Add the L4ConfirmAction Service Provider to your config in app/config/app.php:, (*3)
'providers' => array(
'AgelxNash\L4ConfirmAction\ConfirmServiceProvider'
),
If you use a Package Installer, you can run php artisan package:install agelxnash/l4-confirm-action, (*4)
Run this on the command line from the root of your project: php artisan config:publish agelxnash/l4-confirm-action This will publish L4ConfirmAction's config to app/config/packages/agelxnash/l4-confim-action/, (*5)
You may also want to change the 'classname' value if you want change action logic., (*6)
Now migrate the database tables for L4ConfirmAction. Run these on the command line from the root of your project: php artisan migrate --package="agelxnash/l4-confirm-action", (*7)
You must be have InnoDB table users with unsigned id field, (*8)
Sending confirmation email action to replace:, (*9)
$userObj = Auth::user();
$newMail = 'test@example.com';
$newHash = ConfirmUserAction::createHash($userObj->id, 'newMail', $newMail);
\Mail::send('emails.newMail', array(
'hash' => $newHash
'userObj' => $userObj->id
), function($message) use ($obj, $newMail){
$message->from(Config::get('mail.from.address'))
->to($newMail)
->subject('Confirmation email change');
});
\Mail::send('emails.oldMail', array(
'hash' => CChop\Helpers\User::confirum($userObj->id, 'oldMail', $userObj->email),
'userObj' => $userObj,
'newMail' => $newMail
), function($message) use ($userObj){
$message->from(Config::get('mail.from.address'))
->to($userObj->email)
->subject('Notice of the request for a change of your email');
}
);
emails.newMail blade, (*10)
Change e-mail: {{ URL::route('confirum', compact('hash')) }}
emails.oldMail blade, (*11)
Cancels the request to change email: {{ URL::route('confirum', compact('hash')) }}
To confirm the change, open a link from a letter sent by mail: {{ $newMail }}
Laravel 4 confirm user action
MIT
laravel user illuminate action confirm