Commit f50d94e8 authored by Viral Solani's avatar Viral Solani

Remove unnecessary fields from User Registration

parent 3e54253e
......@@ -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.',
];
}
......
......@@ -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;
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment