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 [
|
||||
'first_name' => 'required',
|
||||
'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
|
||||
@if(Session::has('errors'))
|
||||
<?php //dd($errors); ?>
|
||||
@if($errors->first('first_name'))
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<i class="fa fa-ban"></i>
|
||||
<b>{!! Lang::get('lang.alert') !!}!</b>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<br/>
|
||||
@if($errors->first('first_name'))
|
||||
<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>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
<!-- first name -->
|
||||
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
|
||||
{!! Form::label('first_name',Lang::get('lang.first_name')) !!} <span class="text-red"> *</span>
|
||||
|
Reference in New Issue
Block a user