diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 8031433..2f986cc 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -31,6 +31,7 @@ class OrderController extends Controller if ($cost > $user->credits) { abort(520, 'Insufficient Credits'); } + $user->save(); $order->save(); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 37ca856..bb7c379 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -116,7 +116,8 @@ class UserController extends Controller $link = URL::temporarySignedRoute('reset-email', now()->addDays(30), ['user' => Auth::user()->id, 'email' => $request->email]); - Auth::user()->notify(new ChangeEmail($link)); + Auth::user()->notify(new ChangeEmail($link, + $request->email)); } diff --git a/app/Models/User.php b/app/Models/User.php index 3ccbc67..f9fbcc6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -51,4 +51,5 @@ class User extends Authenticatable implements MustVerifyEmail public function transactions() { return $this->hasMany(Transaction::class); } + } diff --git a/app/Notifications/ChangeEmail.php b/app/Notifications/ChangeEmail.php index 66aa69a..13146de 100644 --- a/app/Notifications/ChangeEmail.php +++ b/app/Notifications/ChangeEmail.php @@ -12,14 +12,16 @@ class ChangeEmail extends Notification use Queueable; private $link; + private $email; /** * Create a new notification instance. * * @return void */ - public function __construct($link) + public function __construct($link, $email) { $this->link = $link; + $this->email = $email; } /** @@ -44,6 +46,7 @@ class ChangeEmail extends Notification return (new MailMessage) ->line('An email change has been requested. Please confirm your new address by clicking the link below.') ->action('Confirm', $this->link) + ->to($this->email) ->line('If you do not recognize this activity, please disregard this email.'); } @@ -59,4 +62,5 @@ class ChangeEmail extends Notification // ]; } + } diff --git a/resources/js/panel/services.vue b/resources/js/panel/services.vue index 3e141ae..594cfe2 100644 --- a/resources/js/panel/services.vue +++ b/resources/js/panel/services.vue @@ -101,6 +101,7 @@ function select(service) { this.amount = service.maximum; } this.selected = service + document.getElementById('overlay-error').textContent = '' } function cost() { diff --git a/resources/js/panel/settings.vue b/resources/js/panel/settings.vue index b47539e..9f7e376 100644 --- a/resources/js/panel/settings.vue +++ b/resources/js/panel/settings.vue @@ -95,7 +95,11 @@ function changePassword() { headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-XSRF-TOKEN': this.token}, - body: JSON.stringify({'current_password': document.getElementById('current_password').value, 'password': document.getElementById('new_password').value, 'password_confirmation': document.getElementById('confirm_password').value}), + body: JSON.stringify({'current_password': + document.getElementById('current_password').value, + 'password': document.getElementById('new_password').value, + 'password_confirmation': + document.getElementById('confirm_password').value}), }).then(response => { response.json().then(data => {console.log(data)}) if (response.ok) {