Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
96a97683
Commit
96a97683
authored
Jan 06, 2023
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validasi regex password registrasi
parent
91acc65d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
app/Http/Controllers/Auth/RegisterController.php
+1
-3
app/Http/Controllers/Webprofile/UserController.php
+8
-0
No files found.
app/Http/Controllers/Auth/RegisterController.php
View file @
96a97683
...
...
@@ -48,12 +48,10 @@ class RegisterController extends Controller
*/
protected
function
validator
(
array
$data
)
{
$regex
=
"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-_]).
{
8,
}
$"
;
return
Validator
::
make
(
$data
,
[
'name'
=>
[
'required'
,
'string'
,
'max:255'
],
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
// 'password' => ['required', 'string', 'min:8', 'confirmed', regex($regex)],
'password'
=>
"required|regex:/^(?=.?[A-Z])(?=.?[a-z])(?=.?[0-9])(?=.?[#?!@$%^&*-_]).
{
8,
}
$/|min:8|confirmed"
,
'password'
=>
[
'required'
,
'string'
,
'min:8'
,
'confirmed'
],
]);
}
...
...
app/Http/Controllers/Webprofile/UserController.php
View file @
96a97683
...
...
@@ -60,6 +60,14 @@ class UserController extends Controller
*/
public
function
store
(
UserRequest
$request
)
{
// dd($request);
$request
->
validate
([
'password'
=>
'required|regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/|min:8|confirmed'
,
],
[
'password.required'
=>
'Password wajib diisi'
,
'password.regex'
=>
'Password tidak aman! Harus kombinasi angka, huruf kapital, huruf kecil, dan karakter'
,
'password.min'
=>
'Password minimal 8 karakter'
,
]);
$user
=
auth
()
->
user
();
$data
=
$request
->
except
(
'_token'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment