submtd/email-confirmation

Add email confirmation to Laravel users

1.0.7 2018-01-16 18:57 UTC

This package is auto-updated.

Last update: 2024-12-13 13:18:35 UTC


README

This package enables email confirmation for users in your Laravel app. This email confirmation package requires no changes to core laravel files or your user model.

Installation

Begin by pulling in the package through Composer.

composer require submtd/email-confirmation

Next, if you are using Laravel 5.4, you will need to include the service providers in your config/app.php file. If you are using Laravel 5.5, these will be discovered automatically.

'providers' => [
    Submtd\EmailConfirmation\Providers\EmailConfirmationServiceProvider::class,
    Submtd\EmailConfirmation\Providers\EmailConfirmationListeners::class,
];

Next, you will need to run the migrations in order to add the confirmed and confirmation_token columns to your users table.

php artisan migrate

Finally, in order to see the status messages generated by this package, you will need to add the following code to your applications main blade template file.

@if(session('status'))
    <div class="alert">
        {{ session('status') }}
    </div>
@endif

Configuration

If you would like to edit the configuration, you must run the following artisan command to copy the config file and the views to your app directory.

php artisan vendor:publish --provider="Submtd\EmailConfirmation\Providers\EmailConfirmationServiceProvider"

After running this command, the status messages can be found in config/email-confirmation.php and the email template can be found in resources/views/vendor/email-confirmation/ConfirmEmail.blade.php.

If you would like to only publish the config or the views or the migrations, use the --tag option on the artisan command.

php artisan vendor:publish --provider="Submtd\EmailConfirmation\Providers\EmailConfirmationServiceProvider" --tag=config
php artisan vendor:publish --provider="Submtd\EmailConfirmation\Providers\EmailConfirmationServiceProvider" --tag=migrations
php artisan vendor:publish --provider="Submtd\EmailConfirmation\Providers\EmailConfirmationServiceProvider" --tag=views

Donation

If this project helped you save some development time, feel free to buy me a beer ;)

paypal