You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
5.1 KiB
87 lines
5.1 KiB
@extends('layouts.dashboard')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto px-4 py-6">
|
|
<div class="max-w-lg mx-auto">
|
|
<div class="bg-white rounded-lg shadow-lg overflow-hidden">
|
|
<div class="p-6">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800">
|
|
{{ isset($usuario) ? 'Editar Usuario' : 'Nuevo Usuario' }}
|
|
</h2>
|
|
</div>
|
|
|
|
@if($errors->any())
|
|
<div class="mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded-r-lg">
|
|
<div class="flex items-center">
|
|
<div class="text-red-700">
|
|
<ul>
|
|
@foreach($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<form action="{{ isset($usuario) ? route('usuarios.update', $usuario->id) : route('usuarios.store') }}" method="POST">
|
|
@csrf
|
|
@if(isset($usuario))
|
|
@method('PUT')
|
|
@endif
|
|
|
|
<div class="space-y-6">
|
|
<div>
|
|
<label for="name" class="block text-sm font-medium text-gray-700 mb-2">Nombre</label>
|
|
<input type="text" name="name" id="name" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->name : old('name') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="email" class="block text-sm font-medium text-gray-700 mb-2">Correo Electrónico</label>
|
|
<input type="email" name="email" id="email" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->email : old('email') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="apellido" class="block text-sm font-medium text-gray-700 mb-2">Apellido</label>
|
|
<input type="text" name="apellido" id="apellido" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->apellido : old('apellido') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="puesto" class="block text-sm font-medium text-gray-700 mb-2">Puesto</label>
|
|
<input type="text" name="puesto" id="puesto" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->puesto : old('puesto') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="carrera" class="block text-sm font-medium text-gray-700 mb-2">Carrera</label>
|
|
<input type="text" name="carrera" id="carrera" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->carrera : old('carrera') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="telefono" class="block text-sm font-medium text-gray-700 mb-2">Teléfono</label>
|
|
<input type="text" name="telefono" id="telefono" class="block w-full px-3 py-2 border border-gray-300 rounded-md" required value="{{ isset($usuario) ? $usuario->telefono : old('telefono') }}">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="password" class="block text-sm font-medium text-gray-700 mb-2">Contraseña</label>
|
|
<input type="password" name="password" id="password" class="block w-full px-3 py-2 border border-gray-300 rounded-md" {{ isset($usuario) ? '' : 'required' }}>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="password_confirmation" class="block text-sm font-medium text-gray-700 mb-2">Confirmar Contraseña</label>
|
|
<input type="password" name="password_confirmation" id="password_confirmation" class="block w-full px-3 py-2 border border-gray-300 rounded-md" {{ isset($usuario) ? '' : 'required' }}>
|
|
</div>
|
|
|
|
<div class="flex justify-end space-x-2 pt-4 border-t border-gray-200">
|
|
<a href="{{ route('usuarios') }}" class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50">Cancelar</a>
|
|
<button type="submit" class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700">
|
|
{{ isset($usuario) ? 'Actualizar' : 'Guardar' }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|