Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 868cdbd

Browse files
committed
📝 updated users controller
1 parent 0a6888e commit 868cdbd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/controllers/UsersController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ public function login()
5353
public function register()
5454
{
5555
// $username = request()->get('username');
56+
// $fullname = request()->get('fullname');
5657
// $email = request()->get('email');
5758
// $password = request()->get('password');
5859

5960
// You can also directly pick vars from the request object
60-
$credentials = request()->get(['username', 'email', 'password']);
61+
$credentials = request()->get(['fullname', 'username', 'email', 'password']);
6162

6263
// You can validate your data with Leaf Form Validation
6364
$validation = Form::validate([
6465
'username' => 'validUsername',
66+
'fullname' => 'required',
6567
'email' => 'email',
6668
'password' => 'required'
6769
]);
@@ -120,7 +122,7 @@ public function reset_password()
120122
// the user encoded into the token. If there's a problem with the token,
121123
// we can throw whatever error occurs. This means the user must be logged in.
122124
$userId = auth()->id() ?? response()->throwErr(auth()->errors());
123-
$password = request('password');
125+
$password = request()->get('password');
124126

125127
// Get the current id
126128
$user = User::find($userId);

0 commit comments

Comments
 (0)