<commit_before># Laravel 5.4 auth-email

[![Latest Stable Version](https://poser.pugx.org/ntavelis/auth-email/v/stable)](https://packagist.org/packages/ntavelis/auth-email)
[![License](https://poser.pugx.org/ntavelis/auth-email/license)](https://packagist.org/packages/ntavelis/auth-email)


Auth-email provides out of the box email authentication for your Laravel 5.4 application. It leverages the Laravel's functionality provided by the `make:auth` command, which runs for you and then proceeds to configure email authentication.
Which means that every user that registers to your application, will receive an email with an activate account button. He will have to click the activate account, in order to prove that he is the owner of the email and therefore activate his account.


## Installation

Via Composer

``` bash
$ composer require ntavelis/auth-email
```
Then add the service provider in `config/app.php`:

```php
Ntavelis\AuthEmail\AuthEmailServiceProvider::class,
```

Run your new command:

``` bash
$ php artisan auth:email
```
Finally run your migrations. Now you have email Authentication. Visit `/register` to register a new user via email.

Note: Make sure you configured your email settings properly.

## Options/Parameters

Auth-email provides the following options:

If you have already bootstrapped your application with `make:auth` before you discovered this package, then you can pass the `-o`, `--only` flag, to make auth-email skip running `make:auth` command.

``` bash
$ php artisan auth:email -o
```

Auth-email can run your migrations after setup, to keep installation process as minimum as possible. Pass it the `-m`, `--migrate` flag.

``` bash
$ php artisan auth:email -m
```
Note: Make sure you configured your database settings properly before running the command.

Auth-email can make your generated `app/mail/ActivateAccount.php` implement the ShouldQueue interface. Pass it the `-s`, `--queue` flag.

``` bash
$ php artisan auth:email -s
```
Note: Make sure you configured your queue driver properly.

You can also run the command with any number of flags.

``` bash
$ php artisan auth:email -o -m -s
```
## Migrations
After the initial installation, you need to run your migrations, auth-email added 2 migration files on your `database/migrations/` path.
Which provide 1 new table to store activation tokens and 1 new column in the user table, create_users_table migration is provided by default in laravel, we just add 1 column with the new migration to track the authenticated(Via email) users.

Alternatively as mentioned above pass it the `-m` flag to instantly run the migrations for you after setup.
``` bash
$ php artisan auth:email -m
```

## Email markup
To change the look of the activation email you send to the user, you have to modify the `resources/views/emails/auth.blade.php` blade file.

This file uses Laravel's 5.4 new feature markdown mailables, please refer to the Laravel documentation for details.
https://laravel.com/docs/5.4/mail#markdown-mailables<commit_msg>Typo fix<commit_after># Laravel 5.4 auth-email

[![Latest Stable Version](https://poser.pugx.org/ntavelis/auth-email/v/stable)](https://packagist.org/packages/ntavelis/auth-email)
[![License](https://poser.pugx.org/ntavelis/auth-email/license)](https://packagist.org/packages/ntavelis/auth-email)


Auth-email provides out of the box email authentication for your Laravel 5.4 application. It leverages the Laravel's functionality provided by the `make:auth` command, which runs for you and then proceeds to configure email authentication.
Which means that every user that registers to your application, will receive an email with an activate account button. He will have to click the activate account, in order to prove that he is the owner of the email and therefore activate his account.


## Installation

Via Composer

``` bash
$ composer require ntavelis/auth-email
```
Then add the service provider in `config/app.php`:

```php
Ntavelis\AuthEmail\AuthEmailServiceProvider::class,
```

Run your new command:

``` bash
$ php artisan auth:email
```
Finally run your migrations. Now you have email Authentication. Visit `/register` to register a new user via email.

Note: Make sure you configured your email settings properly.

## Options/Parameters

Auth-email provides the following options:

If you have already bootstrapped your application with `make:auth` before you discovered this package, then you can pass the `-o`, `--only` flag, to make auth-email skip running `make:auth` command.

``` bash
$ php artisan auth:email -o
```

Auth-email can run your migrations after setup, to keep installation process as minimum as possible. Pass it the `-m`, `--migrate` flag.

``` bash
$ php artisan auth:email -m
```
Note: Make sure you configured your database settings properly before running the command.

Auth-email can make your generated `app/mail/ActivateAccount.php` implement the ShouldQueue interface. Pass it the `-s`, `--queue` flag.

``` bash
$ php artisan auth:email -s
```
Note: Make sure you configured your queue driver properly.

You can also run the command with any number of flags.

``` bash
$ php artisan auth:email -o -m -s
```
## Migrations
Aafter the initial installation, you need to run your migrations, auth-email added 2 migration files on your `database/migrations/` path.
Which provide 1 new table to store activation tokens and 1 new column in the user table, create_users_table migration is provided by default in laravel, we just add 1 column with the new migration to track the authenticated(Via email) users.

Alternatively as mentioned above pass it the `-m` flag to instantly run the migrations for you after setup.
``` bash
$ php artisan auth:email -m
```

## Email markup
To change the look of the activation email you send to the user, you have to modify the `resources/views/emails/auth.blade.php` blade file.

This file uses Laravel's 5.4 new feature markdown mailables, please refer to the Laravel documentation for details.
https://laravel.com/docs/5.4/mail#markdown-mailables
{'fraction_non_alphanumeric': 0.08694214876033057, 'fraction_numerical': 0.003966942148760331, 'mean_word_length': 4.571823204419889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3883585', 'n_tokens_mistral': 1720, 'n_tokens_neox': 1627, 'n_words': 776}