Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
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
Administrator
laravel-adminpanel
Commits
f50d94e8
Commit
f50d94e8
authored
Nov 27, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary fields from User Registration
parent
3e54253e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
112 deletions
+1
-112
RegisterRequest.php
app/Http/Requests/Frontend/Auth/RegisterRequest.php
+0
-6
UserRepository.php
app/Repositories/Frontend/Access/User/UserRepository.php
+0
-6
register.blade.php
resources/views/frontend/auth/register.blade.php
+1
-100
No files found.
app/Http/Requests/Frontend/Auth/RegisterRequest.php
View file @
f50d94e8
...
...
@@ -32,10 +32,6 @@ class RegisterRequest extends Request
'last_name'
=>
'required|max:255'
,
'email'
=>
[
'required'
,
'email'
,
'max:255'
,
Rule
::
unique
(
'users'
)],
'password'
=>
'required|min:8|confirmed|regex:"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$"'
,
'state_id'
=>
'required'
,
'city_id'
=>
'required'
,
'zip_code'
=>
'required'
,
'ssn'
=>
'required'
,
'is_term_accept'
=>
'required'
,
'g-recaptcha-response'
=>
'required_if:captcha_status,true|captcha'
,
];
...
...
@@ -48,8 +44,6 @@ class RegisterRequest extends Request
{
return
[
'g-recaptcha-response.required_if'
=>
trans
(
'validation.required'
,
[
'attribute'
=>
'captcha'
]),
'state_id.required'
=>
'The state field is required.'
,
'city_id.required'
=>
'The city field is required.'
,
'password.regex'
=>
'Password must contain at least 1 uppercase letter and 1 number.'
,
];
}
...
...
app/Repositories/Frontend/Access/User/UserRepository.php
View file @
f50d94e8
...
...
@@ -89,12 +89,6 @@ class UserRepository extends BaseRepository
$user
=
new
$user
();
$user
->
first_name
=
$data
[
'first_name'
];
$user
->
last_name
=
$data
[
'last_name'
];
$user
->
address
=
$data
[
'address'
];
$user
->
state_id
=
$data
[
'state_id'
];
$user
->
country_id
=
config
(
'access.constants.default_country'
);
$user
->
city_id
=
$data
[
'city_id'
];
$user
->
zip_code
=
$data
[
'zip_code'
];
$user
->
ssn
=
$data
[
'ssn'
];
$user
->
email
=
$data
[
'email'
];
$user
->
confirmation_code
=
md5
(
uniqid
(
mt_rand
(),
true
));
$user
->
status
=
1
;
...
...
resources/views/frontend/auth/register.blade.php
View file @
f50d94e8
...
...
@@ -47,52 +47,8 @@
</div><!--col-md-6-->
</div><!--form-group-->
{{-- address --}}
<div class="
form
-
group
">
{{ Form::label('address', trans('validation.attributes.frontend.register-user.address'), ['class' => 'col-md-4 control-label']) }}
<div class="
col
-
md
-
6
">
{{ Form::input('textarea', 'address', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.address'), 'rows' => '3']) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- state --}}
<div class="
form
-
group
">
{{ Form::label('state_id', trans('validation.attributes.frontend.register-user.state').'*', ['class' => 'col-md-4 control-label']) }}
<div class="
col
-
md
-
6
">
{{ Form::select('state_id', [] , null, ['class' => 'form-control select2', 'placeholder' => trans('validation.attributes.frontend.register-user.state'), 'id' => 'state']) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- city --}}
<div class="
form
-
group
">
{{ Form::label('city_id', trans('validation.attributes.frontend.register-user.city').'*', ['class' => 'col-md-4 control-label']) }}
<div class="
col
-
md
-
6
">
{{ Form::select('city_id', [], null, ['class' => 'form-control select2', 'placeholder' => trans('validation.attributes.frontend.register-user.city'), 'id' => 'city']) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- zipcode --}}
<div class="
form
-
group
">
{{ Form::label('zip_code', trans('validation.attributes.frontend.register-user.zipcode').'*', ['class' => 'col-md-4 control-label']) }}
<div class="
col
-
md
-
6
">
{{ Form::input('name', 'zip_code', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.zipcode')]) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- SSN --}}
<div class="
form
-
group
">
{{ Form::label('ssn', trans('validation.attributes.frontend.register-user.ssn').'*', ['class' => 'col-md-4 control-label']) }}
<div class="
col
-
md
-
6
">
{{ Form::input('name', 'ssn', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.ssn')]) }}
</div><!--col-md-6-->
</div><!--form-group-->
<div class="
form
-
group
">
<div class="
col
-
xs
-
7
">
<label class="
col
-
md
-
12
control
-
label
">
{!! Form::checkbox('is_term_accept',1,false) !!}
I accept {!! link_to_route('frontend.cmspages.show', trans('validation.attributes.frontend.register-user.terms_and_conditions').'*', ['page_slug'=>'terms-and-conditions']) !!} </label>
...
...
@@ -136,61 +92,6 @@
$(document).ready(function() {
// To Use Select2
Backend.Select2.init();
//Getting States of default contry
ajaxCall("
{{
route
(
'frontend.get.states'
)}}
");
var old_state = "
{{
old
(
'state_id'
)
}}
";
var old_city = "
{{
old
(
'city_id'
)
}}
";
if(old_state != '')
{
ajaxCall("
{{
route
(
'frontend.get.states'
)}}
");
}
//Getting Cities of select State
$("
#state").on("change", function() {
var
stateId
=
$
(
this
)
.
val
();
var
url
=
"
{
{route('frontend.get.cities')}
}
"
;
ajaxCall
(
url
,
stateId
);
});
function
ajaxCall
(
url
,
data
=
null
)
{
$
.
ajax
({
url
:
url
,
type
:
"POST"
,
data
:
{
stateId
:
data
},
success
:
function
(
result
)
{
if
(
result
!=
null
)
{
var
options
;
$
.
each
(
result
.
data
,
function
(
key
,
value
)
{
options
+=
"<option value='"
+
key
+
"'>"
+
value
+
"</option>"
;
});
if
(
result
.
status
==
"city"
)
{
$
(
"#city"
)
.
html
(
''
);
$
(
"#city"
)
.
append
(
options
);
if
(
old_city
!=
''
)
{
$
(
"#city"
)
.
val
(
old_city
)
.
trigger
(
'change'
);
}
}
else
{
$
(
"#state"
)
.
append
(
options
);
if
(
old_state
!=
''
)
{
$
(
"#state"
)
.
val
(
old_state
)
.
trigger
(
'change'
);
}
}
}
}
});
}
});
</script>
@
endsection
\ No newline at end of file
@endsection
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