From d0f75780ff9321a05023f7c6bffe444ca3d1897f Mon Sep 17 00:00:00 2001 From: EnesSacid-Buker <73346401+EnesSacid-Buker@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:59:00 +0300 Subject: [PATCH] Disable email input on reset page --- app/Models/Auth/User.php | 2 +- app/Notifications/Auth/Reset.php | 5 +++-- resources/views/auth/reset/create.blade.php | 3 ++- resources/views/components/form/group/email.blade.php | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index 8905b35a9..819e7f5b7 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -176,7 +176,7 @@ class User extends Authenticatable implements HasLocalePreference */ public function sendPasswordResetNotification($token) { - $this->notify(new Reset($token)); + $this->notify(new Reset($token, $this->email)); } /** diff --git a/app/Notifications/Auth/Reset.php b/app/Notifications/Auth/Reset.php index 1cc18d33d..b7c454d21 100644 --- a/app/Notifications/Auth/Reset.php +++ b/app/Notifications/Auth/Reset.php @@ -19,9 +19,10 @@ class Reset extends Notification * * @param string $token */ - public function __construct($token) + public function __construct($token, $email) { $this->token = $token; + $this->email = $email; } /** @@ -45,7 +46,7 @@ class Reset extends Notification { return (new MailMessage) ->line(trans('auth.notification.message_1')) - ->action(trans('auth.notification.button'), route('reset', $this->token)) + ->action(trans('auth.notification.button'), route('reset', ['token' => $this->token, 'email' => $this->email])) ->line(trans('auth.notification.message_2')); } } diff --git a/resources/views/auth/reset/create.blade.php b/resources/views/auth/reset/create.blade.php index c48fefa93..ded044ad2 100644 --- a/resources/views/auth/reset/create.blade.php +++ b/resources/views/auth/reset/create.blade.php @@ -30,8 +30,9 @@ diff --git a/resources/views/components/form/group/email.blade.php b/resources/views/components/form/group/email.blade.php index 4028786cc..d84b0a167 100644 --- a/resources/views/components/form/group/email.blade.php +++ b/resources/views/components/form/group/email.blade.php @@ -43,6 +43,7 @@ name="{{ $name }}" id="{{ $id }}" value="{{ $value }}" + disabled="{{ $disabled }}" placeholder="{{ $placeholder }}" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}" {{ $attributes->merge($custom_attributes) }}