base-laravel/resources/views/users/edit.blade.php

60 lines
1.9 KiB
PHP

@extends('layouts.default')
@section('title', '| Edit User')
@section('content')
<div class='col-lg-8 col-lg-offset-2'>
<div class="panel panel-default">
<div class="panel-heading"><h1>Edit {{$user->name}}</h1></div>
<div class="panel-body">
{{ Form::model($user, array('route' => array('users.update', $user->id), 'method' => 'PUT')) }}{{-- Form model binding to automatically populate our fields with user data --}}
<div class="form-group">
{{ Form::label('name', 'Name') }}
{{ Form::text('name', null, array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('email', 'Email') }}
{{ Form::email('email', null, array('class' => 'form-control')) }}
</div>
@if(in_array('ResetPassword',$allperms) || Auth::user()->id == $user->id)
<br/><h4>Leave blank to keep existing password</h4>
<div class="form-group">
{{ Form::label('password', 'Password') }}<br>
{{ Form::password('password', array('class' => 'form-control')) }}
</div>
<div class="form-group">
{{ Form::label('password', 'Confirm Password') }}<br>
{{ Form::password('password_confirmation', array('class' => 'form-control')) }}
</div>
@endif
@if(in_array('AssignRole',$allperms))
<h1>Roles</h1>
@foreach ($roles as $role)
<div class='col-md-6'>
<div class='form-group'>
@if(in_array($role->id,$active_roles))
{{ Form::checkbox('r_'.$role->id,$role->id,1)}}
@else
{{ Form::checkbox('r_'.$role->id,$role->id)}}
@endif
{{ Form::label('name', $role->name) }}
</div>
</div>
@endforeach
@endif
{{ Form::submit('Save', array('class' => 'btn btn-primary')) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection