@extends('layouts.app') @section('content-header')
@if(!$user->id) {{ Breadcrumbs::render('users-form', 'Create new', '') }}

Create User

@else {{ Breadcrumbs::render('users-form', $user->username, $user->id) }}

Edit User

@endif
@endsection @section('content') @if(!$user->id) {!! Form::model($user, [ 'method' => 'POST', 'route' => ['admin.users.store'], 'role' => 'form'])!!} @else {!! Form::model($user, [ 'method' => 'PUT', 'route' => ['admin.users.update', $user->id], 'role' => 'form'])!!} @endif
@if (count($errors) > 0)
Whoops! There were some problems with your input.

    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if ($message = Session::get('fail'))
Whoops! There were some problems with your input.

{{ $message }}
@endif
{!! Form::label('lblUsername', 'User ID', ['class' => 'control-label']) !!} {!! Form::text('txtUsername', $user->username, ['class' => 'form-control', 'placeholder' => 'User ID', 'required' => '']) !!} @if($errors->has('txtUsername'))

{{$errors->first('txtUsername')}}

@endif
{!! Form::label('lblName', 'Name', ['class' => 'control-label']) !!} {!! Form::text('txtName', $user->name, ['class' => 'form-control', 'placeholder' => 'Name', 'required' => '']) !!} @if($errors->has('txtName'))

{{$errors->first('txtName')}}

@endif
{!! Form::label('lblEmail', 'Email*', ['class' => 'control-label']) !!} {!! Form::email('txtEmail', $user->email, ['class' => 'form-control', 'placeholder' => 'example@email.com', 'required' => '']) !!} @if($errors->has('txtEmail'))

{{$errors->first('txtEmail')}}

@endif
{!! Form::label('lblPassword', 'Password*', ['class' => 'control-label']) !!} {!! Form::password('txtPassword', ['class' => 'form-control', 'placeholder' => 'Password', 'required' => '']) !!} @if($errors->has('txtPassword'))

{{$errors->first('txtPassword')}}

@endif
{!! Form::label('lblPassword_confirmation', 'Confirm Password', ['class' => 'control-label']) !!} {!! Form::password('txtPassword_confirmation', ['class' => 'form-control', 'placeholder' => 'Confirm Password', 'required' => '']) !!}
{!! Form::label('lblRoles', 'Roles*', ['class' => 'control-label']) !!} {!! Form::select('txtRoles', $roles, $user->roles, ['class' => 'form-control select2', 'required' => '']) !!}

@if($errors->has('txtRoles'))

{{ $errors->first('txtRoles') }}

@endif
{!! Form::submit('Submit', ['class' => 'btn btn-primary'])!!} {!! link_to_route('admin.users.index', 'Cancel', null, ['class' => 'btn btn-danger']) !!}
{!! Form::close() !!} @endsection @include('_components.scripts.form')