Profile-edit-bug-fix-patch

Agent Profile update bug fixed for cheking unique mobile numbers
This commit is contained in:
Manish Verma
2016-11-03 16:46:47 +05:30
parent ca32203d6f
commit bb5b3131e2
2 changed files with 19 additions and 3 deletions

View File

@@ -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';
}
}
} }

View File

@@ -46,16 +46,18 @@ 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">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</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>
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
</div>
@endif @endif
@if($errors->first('mobile'))
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
@endif
</div>
@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' : '' }}">