@extends('layout.master') @section('content') @if(auth()->user()->id_group == 1 )

Back to users

@endif @include('layout.errorform') @include('layout.info') {!! Form::model($user, [ 'route' => [ 'user.update', $user->slug ], 'method' => 'PATCH', 'class' => 'form-horizontal', 'id' => 'form']) !!}
Edit User
{!! Form::label('nam', 'Name :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::input('text', 'name', $user->name, ['class' => 'form-control put', 'placeholder' => 'Name', 'id' => 'nam']) !!}
{!! Form::label('usernam', 'Username :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::text('username', @$value, ['class' => 'form-control put', 'placeholder' => 'Username', 'id' => 'usernam']) !!}
{!! Form::label('email', 'Email :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::input('text', 'email', $user->email, ['class' => 'form-control', 'placeholder' => 'Email', 'id' => 'email']) !!}
{!! Form::label('pass', 'Password :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::input('password', 'password', null, ['class' => 'form-control', 'placeholder' => 'Password', 'id' => 'pass']) !!}
{!! Form::label('pass1', 'Password :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::input('password', 'password_confirmation', null, ['class' => 'form-control', 'placeholder' => 'Password Confirmation', 'id' => 'pass1']) !!}
@if(auth()->user()->id_group == 1 )
{!! Form::label('ug', 'User Group :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::select('id_group', $lm, $user->id_group,['class' => 'form-control', 'id' => 'ug', 'placeholder' => 'Choose User Group']) !!}
@else {!! Form::hidden('id_group', $user->id_group) !!} @endif
{!! Form::label('rgba', 'Choose Your Color :', ['class' => 'col-sm-2 control-label']) !!}
{!! Form::input('text', 'color', @$value, ['class' => 'form-control ', 'id' => 'rgba' ]) !!}
{!! Form::submit('Update', ['class' => 'btn btn-primary btn-lg btn-block']) !!}
{!! Form::close() !!}
@endsection @section('jquery') $("#nam").keyup(function() { tch(this); }); $("#usernam, #email").keyup(function() { lch(this); }); $('#rgba').minicolors({ format: 'rgb', opacity: true, theme: 'bootstrap', }); $('#ug').select2({ placeholder: 'Please Choose' }); //////////////////////////////////////////////////////////////////////////////////// // bootstrap validator $("#form").bootstrapValidator({ feedbackIcons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { name: { validators: { notEmpty: { message: 'Please insert your name. ' } } }, email: { validators: { notEmpty: { message: 'Please insert your email. ' }, regexp: { regexp: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, message: 'Please insert your valid email address. ' }, } }, username: { message: 'The username is not valid', validators: { notEmpty: { message: 'The username is required and cannot be empty' }, stringLength: { min: 6, max: 10, message: 'The username must be more than 6 and less than 10 characters long' }, regexp: { regexp: /^[a-zA-Z0-9_]+$/, message: 'The username can only consist of alphabetical, number and underscore' }, } }, password: { validators: { notEmpty: { message: 'Please insert your password. ' }, regexp: { regexp: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,16}$/, message: 'Passwords are 8-16 characters with uppercase letters, lowercase letters and at least one number. ' }, } }, password_confirmation: { validators: { notEmpty: { message: 'Please insert your confirmation password. ' }, identical: { field: 'password', message: 'The password and its confirmation are not the same. ' } } }, id_group: { validators: { notEmpty: { message: 'Please choose an option. ' } } }, color: { validators: { notEmpty: { message: 'Please choose a color. ' } } }, } }) //////////////////////////////////////////////////////////////////////////////////// @endsection