diff --git a/app/Http/Controllers/Auth/RemindersController.php b/app/Http/Controllers/Auth/PasswordController.php similarity index 75% rename from app/Http/Controllers/Auth/RemindersController.php rename to app/Http/Controllers/Auth/PasswordController.php index 56df4706..b9507969 100644 --- a/app/Http/Controllers/Auth/RemindersController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -8,17 +8,17 @@ * @Middleware("csrf") * @Middleware("guest") */ -class RemindersController { +class PasswordController { /** - * The password reminder implementation. + * The password broker implementation. * * @var PasswordBroker */ protected $passwords; /** - * Create a new password reminder controller instance. + * Create a new password controller instance. * * @param PasswordBroker $passwords * @return void @@ -29,33 +29,33 @@ public function __construct(PasswordBroker $passwords) } /** - * Display the password reminder view. + * Display the form to request a password reset link. * - * @Get("password/remind") + * @Get("password/email") * * @return Response */ - public function showReminderForm() + public function showResetRequestForm() { - return view('password.remind'); + return view('password.email'); } /** - * Handle a POST request to remind a user of their password. + * Send a reset link to the given user. * - * @Post("password/remind") + * @Post("password/email") * * @param Request $request * @return Response */ - public function sendPasswordResetEmail(Request $request) + public function sendPasswordResetLink(Request $request) { - switch ($response = $this->passwords->remind($request->only('email'))) + switch ($response = $this->passwords->sendResetLink($request->only('email'))) { case PasswordBroker::INVALID_USER: return redirect()->back()->with('error', trans($response)); - case PasswordBroker::REMINDER_SENT: + case PasswordBroker::RESET_LINK_SENT: return redirect()->back()->with('status', trans($response)); } } @@ -79,7 +79,7 @@ public function showPasswordResetForm($token = null) } /** - * Handle a POST request to reset a user's password. + * Reset the given user's password. * * @Post("password/reset") * diff --git a/app/User.php b/app/User.php index 888696e2..fe1216fb 100644 --- a/app/User.php +++ b/app/User.php @@ -2,13 +2,13 @@ use Illuminate\Auth\UserTrait; use Illuminate\Database\Eloquent\Model; -use Illuminate\Auth\Reminders\RemindableTrait; use Illuminate\Contracts\Auth\User as UserContract; -use Illuminate\Contracts\Auth\Remindable as RemindableContract; +use Illuminate\Auth\Reminders\CanResetPasswordTrait; +use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; -class User extends Model implements UserContract, RemindableContract { +class User extends Model implements UserContract, CanResetPasswordContract { - use UserTrait, RemindableTrait; + use UserTrait, CanResetPasswordTrait; /** * The database table used by the model. diff --git a/config/app.php b/config/app.php index 258dd4f2..8d82c4d1 100644 --- a/config/app.php +++ b/config/app.php @@ -123,7 +123,7 @@ 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', - 'Illuminate\Auth\Reminders\ReminderServiceProvider', + 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', diff --git a/config/auth.php b/config/auth.php index b43e1c87..64d6196a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -45,22 +45,22 @@ /* |-------------------------------------------------------------------------- - | Password Reminder Settings + | Password Reset Settings |-------------------------------------------------------------------------- | - | Here you may set the settings for password reminders, including a view - | that should be used as your password reminder e-mail. You will also - | be able to set the name of the table that holds the reset tokens. + | Here you may set the options for resetting passwords including the view + | that is your password reset e-mail. You can also set the name of the + | table that maintains all of the reset tokens for your application. | - | The "expire" time is the number of minutes that the reminder should be + | The expire time is the number of minutes that the reset token should be | considered valid. This security feature keeps tokens short-lived so | they have less time to be guessed. You may change this as needed. | */ - 'reminder' => [ - 'email' => 'emails.auth.reminder', - 'table' => 'password_reminders', + 'password' => [ + 'email' => 'emails.auth.password', + 'table' => 'password_resets', 'expire' => 60, ], diff --git a/resources/views/emails/auth/reminder.blade.php b/resources/views/emails/auth/password.blade.php similarity index 100% rename from resources/views/emails/auth/reminder.blade.php rename to resources/views/emails/auth/password.blade.php