register with kyc

This commit is contained in:
faiqahzaman
2022-01-12 09:54:02 +08:00
parent 74e5d0eed8
commit b89c14a0c2
5 changed files with 22 additions and 3 deletions
+17 -3
View File
@@ -25,8 +25,19 @@ class AuthController extends Controller
'online' => 'integer',
'register_agree' => 'required|integer',
'email' => 'required|string|unique:users,email',
'password' => 'required|string|confirmed'
'password' => 'required|string|confirmed',
'front_img_path' => 'required|mimes:jpg,png,jpeg|max:5048',
'back_img_path' => 'required|mimes:jpg,png,jpeg|max:5048'
]);
$newFrontImageName = time() . '-' . $request->name . '.' . $request->front_img_path->extension();
$newBackImageName = time() . '-' . $request->username . '.' . $request->back_img_path->extension();
$request->front_img_path->move(public_path('ic'), $newFrontImageName);
$request->back_img_path->move(public_path('ic'), $newBackImageName);
$user = User::create([
'name' => $fields['name'],
@@ -43,7 +54,10 @@ class AuthController extends Controller
'register_agree' => $fields['register_agree'],
'email' => $fields['email'],
'email' => $fields['email'],
'password' => bcrypt($fields['password'])
'password' => bcrypt($fields['password']),
'front_img_path' => $newFrontImageName,
'back_img_path' => $newBackImageName
]);
$token = $user->createToken('myapptoken')->plainTextToken;
@@ -61,7 +75,7 @@ class AuthController extends Controller
'password' => 'required|string'
]);
//Check Email
//Check username
$user = User::where('username', $fields['username'])->first();
//Check Password
+3
View File
@@ -35,6 +35,9 @@ class User extends Authenticatable
't_daftar',
'online',
'register_agree',
'front_img_path',
'back_img_path',
];
/**
@@ -32,6 +32,8 @@ class CreateUsersTable extends Migration
$table->string('email')->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('front_img_path');
$table->string('back_img_path');
$table->rememberToken();
$table->timestamps();
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB