@extends('admin.layouts.layout')
@section('content')
    <section>
        <div class="row match-height">
            <div class="col-md-12 col-12">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title text-primary">Editando Usuário</h4>
                        <small>Editando Usuário no Sistema</small>
                        <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button"
                            href="{{ route('usuarios.index') }}" role="button">Ver todos</a>
                    </div>
                    <div class="card-content">
                        <div class="card-body">
                            <form action="{{ route('usuarios.update', $usuario->id) }}" method="POST"
                                class="form-horizontal">
                                @csrf
                                @method('PUT')
                                <div class="box box-info">
                                    <div class="form-group">
                                        <label class="col-form-label">Nome completo</label>
                                        <input type="text" name="name" value="{{ $usuario->name }}"
                                            class="form-control @error('name') is-invalid @enderror">
                                    </div>
                                    <div class="form-group row">

                                        <div class="form-group col-md-4">
                                            <label class="col-form-label">E-mail</label>
                                            <input type="email" name="email" value="{{ $usuario->email }}"
                                                class="form-control @error('email') is-invalid @enderror">
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label class="col-form-label">Senha</label>
                                            <input type="password" name="password" class="form-control">
                                        </div>
                                        <div class="form-group col-md-3">
                                            <label class="col-form-label">Confirme a senha</label>
                                            <input type="password" name="password_confirmation" class="form-control">
                                        </div>
                                        <div class="form-group col-md-2">
                                            <label class="col-form-label">Código Posto</label>
                                            <input type="text" name="posto" value="{{ $usuario->posto }}"
                                                class="form-control">
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <input type="submit" value="Gravar" class="btn btn-block btn-outline-success">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @endsection
