Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
P
Project_Laravel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Nguyen Huu Huan
Project_Laravel
Commits
cd30daf9
Commit
cd30daf9
authored
Sep 10, 2022
by
20194288-huannh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update login function
parent
1273a447
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
UserController.php
app/Http/Controllers/UserController.php
+7
-5
No files found.
app/Http/Controllers/UserController.php
View file @
cd30daf9
...
...
@@ -26,11 +26,13 @@ public function register(RegisterRequest $request){
public
function
login
(
LoginRequest
$request
){
$user
=
User
::
where
(
'phone'
,
$request
->
phone
)
->
get
();
for
(
$i
=
0
;
$i
<
count
(
$user
);
$i
++
){
if
(
$user
[
$i
]
->
password
==
md5
(
$request
->
password
))
return
'Login success'
;
else
return
'Login fail'
;
}
if
(
$user
->
count
()){
for
(
$i
=
0
;
$i
<
count
(
$user
);
$i
++
){
if
(
$user
[
$i
]
->
password
==
md5
(
$request
->
password
))
return
'Login success'
;
else
return
'Login fail'
;
}
}
else
return
'Tai khoan khong ton tai'
;
}
}
...
...
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