Skip to content

Commit

Permalink
update password documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 9, 2020
1 parent a116ef5 commit 3bbc0a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
2 changes: 2 additions & 0 deletions installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Once installed, the `laravel new` command will create a fresh Laravel installati

laravel new blog

> {tip} Want to create a Laravel project with login, registration, and more features already built for you? Check out [Laravel Jetstream](https://jetstream.laravel.com).
#### Via Composer Create-Project

Alternatively, you may also install Laravel by issuing the Composer `create-project` command in your terminal:
Expand Down
34 changes: 7 additions & 27 deletions passwords.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,39 @@
- [Database Considerations](#resetting-database)
- [Routing](#resetting-routing)
- [Views](#resetting-views)
- [After Resetting Passwords](#after-resetting-passwords)
- [Customization](#password-customization)

<a name="introduction"></a>
## Introduction

> {tip} **Want to get started fast?** Install the `laravel/jetstream` Composer package and run `php artisan jetstream:install livewire/inertia` in a fresh Laravel application. After migrating your database, navigate your browser to `http://your-app.test/register` or any other URL that is assigned to your application. This single command will take care of scaffolding your entire authentication system, including resetting passwords!
Most web applications provide a way for users to reset their forgotten passwords. Rather than forcing you to re-implement this on each application, Laravel provides convenient methods for sending password reminders and performing password resets.

> {note} Before using the password reset features of Laravel, your user must use the `Illuminate\Notifications\Notifiable` trait.
#### Getting Started Fast

Want to get started fast? Install [Laravel Jetstream](https://jetstream.laravel.com) in a fresh Laravel application. After migrating your database, navigate your browser to `/register` or any other URL that is assigned to your application. Jetstream will take care of scaffolding your entire authentication system, including resetting passwords!

<a name="resetting-database"></a>
## Database Considerations

To get started, verify that your `App\Models\User` model implements the `Illuminate\Contracts\Auth\CanResetPassword` contract. The `App\Models\User` model included with the framework already implements this interface, and uses the `Illuminate\Auth\Passwords\CanResetPassword` trait to include the methods needed to implement the interface.

#### Generating The Reset Token Table Migration

Next, a table must be created to store the password reset tokens. The migration for this table is included in the `laravel/jetstream` Composer package. After installing the `laravel/jetstream` package, you may use the `migrate` command to create the password reset token database table:

composer require laravel/jetstream

php artisan jetstream:install livewire/inertia
Next, a table must be created to store the password reset tokens. The migration for this table is included in the default Laravel installation, so you only need to migrate your database to create this table:

php artisan migrate

<a name="resetting-routing"></a>
## Routing

All of the routes needed to perform password resets may be generated using the `laravel/jetstream` Composer package:

composer require laravel/jetstream

php artisan jetstream:install livewire/inertia
All of the routes needed to perform password resets are automatically included in [Laravel Jetstream](https://jetstream.laravel.com). To learn how to install Jetstream, please consult the official [Jetstream documentation](https://jetstream.laravel.com).

<a name="resetting-views"></a>
## Views

To generate all of the necessary view for resetting passwords, you may use the `laravel/jetstream` Composer package:

composer require laravel/jetstream

php artisan jetstream:install livewire/inertia

These views are placed in the `resources/views/auth` directory. You are free to customize them as needed for your application.

<a name="after-resetting-passwords"></a>
## After Resetting Passwords

Once you have defined the routes and views to reset your user's passwords, you may access the route in your browser at `/password/reset`. The controllers included in the Laravel Jetstream package already includes the logic to send the password reset link emails as well as the logic to reset user passwords.

> {note} By default, password reset tokens expire after one hour. You may change this via the password reset `expire` option in your `config/auth.php` file.
All of the views needed to perform password resets are automatically included in [Laravel Jetstream](https://jetstream.laravel.com). To learn how to install Jetstream, please consult the official [Jetstream documentation](https://jetstream.laravel.com).

<a name="password-customization"></a>
## Customization
Expand Down

0 comments on commit 3bbc0a5

Please sign in to comment.