Profile-edit-bug-fix-patch
Agent Profile update bug fixed for cheking unique mobile numbers
This commit is contained in:
@@ -31,7 +31,21 @@ class ProfileRequest extends Request
|
|||||||
return [
|
return [
|
||||||
'first_name' => 'required',
|
'first_name' => 'required',
|
||||||
'profile_pic' => 'mimes:png,jpeg',
|
'profile_pic' => 'mimes:png,jpeg',
|
||||||
// 'mobile' => 'unique:users,mobile',
|
'mobile' => $this->checkMobile(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*Check the mobile number is unique or not
|
||||||
|
*@return string
|
||||||
|
*/
|
||||||
|
public function checkMobile()
|
||||||
|
{
|
||||||
|
if (\Auth::user()->mobile === Request::get('mobile')) {
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
return 'unique:users';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,17 +46,19 @@ class="active"
|
|||||||
@endif
|
@endif
|
||||||
@if(Session::has('errors'))
|
@if(Session::has('errors'))
|
||||||
<?php //dd($errors); ?>
|
<?php //dd($errors); ?>
|
||||||
@if($errors->first('first_name'))
|
|
||||||
<div class="alert alert-danger alert-dismissable">
|
<div class="alert alert-danger alert-dismissable">
|
||||||
<i class="fa fa-ban"></i>
|
<i class="fa fa-ban"></i>
|
||||||
<b>{!! Lang::get('lang.alert') !!}!</b>
|
<b>{!! Lang::get('lang.alert') !!}!</b>
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<br/>
|
<br/>
|
||||||
|
@if($errors->first('first_name'))
|
||||||
<li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li>
|
<li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li>
|
||||||
|
@endif
|
||||||
|
@if($errors->first('mobile'))
|
||||||
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
|
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
|
||||||
<!-- first name -->
|
<!-- first name -->
|
||||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||||
{!! Form::label('first_name',Lang::get('lang.first_name')) !!} <span class="text-red"> *</span>
|
{!! Form::label('first_name',Lang::get('lang.first_name')) !!} <span class="text-red"> *</span>
|
||||||
|
Reference in New Issue
Block a user