sergiomarquez778 1 month ago
parent
commit
09025c2933
  1. 2
      app/Http/Controllers/HomeController.php
  2. 153
      resources/views/auth/login.blade.php
  3. 9
      routes/web.php
  4. 2
      vite.config.js

2
app/Http/Controllers/HomeController.php

@ -23,6 +23,6 @@ class HomeController extends Controller
*/ */
public function index() public function index()
{ {
return view('dashboard'); return view('home');
} }
} }

153
resources/views/auth/login.blade.php

@ -1,106 +1,73 @@
<!DOCTYPE html> @extends('layouts.app')
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - PrestamosTecmm</title>
<!-- Tailwind CSS desde CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
</head>
<body class="bg-gradient-to-br from-blue-600 to-blue-800 min-h-screen flex items-center justify-center p-4">
<div class="max-w-md w-full bg-white rounded-lg shadow-xl overflow-hidden">
<div class="p-6">
<div class="text-center mb-8">
<h2 class="text-3xl font-bold text-gray-800">PrestamosTecmm</h2>
<p class="text-gray-600 mt-2">Inicia sesión en tu cuenta</p>
</div>
@if ($errors->any()) @section('content')
<div class="mb-4 bg-red-50 border-l-4 border-red-500 p-4"> <div class="container">
<div class="text-red-700"> <div class="row justify-content-center">
<ul> <div class="col-md-8">
@foreach ($errors->all() as $error) <div class="card">
<li>{{ $error }}</li> <div class="card-header">{{ __('Login') }}</div>
@endforeach
</ul> <div class="card-body">
</div> <form method="POST" action="{{ route('login') }}">
</div> @csrf
@endif
<form method="POST" action="{{ route('login') }}" class="space-y-6"> <div class="row mb-3">
@csrf <label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
<div> <div class="col-md-6">
<label for="email" class="block text-sm font-medium text-gray-700"> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
Correo Electrónico
</label> @error('email')
<div class="mt-1 relative"> <span class="invalid-feedback" role="alert">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> <strong>{{ $message }}</strong>
<i class="fas fa-envelope text-gray-400"></i> </span>
@enderror
</div>
</div> </div>
<input id="email" name="email" type="email" required
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500"
value="{{ old('email') }}"
placeholder="tu@email.com">
</div>
</div>
<div> <div class="row mb-3">
<label for="password" class="block text-sm font-medium text-gray-700"> <label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
Contraseña
</label> <div class="col-md-6">
<div class="mt-1 relative"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-lock text-gray-400"></i> @error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div> </div>
<input id="password" name="password" type="password" required
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500"
placeholder="••••••••">
</div>
</div>
<div class="flex items-center justify-between"> <div class="row mb-3">
<div class="flex items-center"> <div class="col-md-6 offset-md-4">
<input id="remember_me" name="remember" type="checkbox" <div class="form-check">
class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<label for="remember_me" class="ml-2 block text-sm text-gray-700">
Recordarme
</label>
</div>
@if (Route::has('password.request')) <label class="form-check-label" for="remember">
<a href="{{ route('password.request') }}" class="text-sm text-blue-600 hover:text-blue-500"> {{ __('Remember Me') }}
¿Olvidaste tu contraseña? </label>
</a> </div>
@endif </div>
</div> </div>
<div> <div class="row mb-0">
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"> <div class="col-md-8 offset-md-4">
Iniciar Sesión <button type="submit" class="btn btn-primary">
</button> {{ __('Login') }}
</div> </button>
</form>
@if (Route::has('register')) @if (Route::has('password.request'))
<div class="mt-6 text-center"> <a class="btn btn-link" href="{{ route('password.request') }}">
<p class="text-sm text-gray-600"> {{ __('Forgot Your Password?') }}
¿No tienes una cuenta? </a>
<a href="{{ route('register') }}" class="font-medium text-blue-600 hover:text-blue-500"> @endif
Regístrate aquí </div>
</a> </div>
</p> </form>
</div>
</div> </div>
@endif
</div> </div>
</div> </div>
</div>
<!-- Decoración de fondo --> @endsection
<div class="absolute top-0 left-0 w-full h-full pointer-events-none overflow-hidden">
<div class="absolute -top-1/2 -left-1/4 w-96 h-96 bg-blue-400 rounded-full opacity-10 transform rotate-45"></div>
<div class="absolute -bottom-1/2 -right-1/4 w-96 h-96 bg-blue-400 rounded-full opacity-10 transform -rotate-45"></div>
</div>
</body>
</html>

9
routes/web.php

@ -1,7 +1,6 @@
<?php <?php
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use App\Http\Controllers\usuariosController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -18,12 +17,6 @@ Route::get('/', function () {
return view('welcome'); return view('welcome');
}); });
Auth::routes(['register'=>false,'reset'=>false]); Auth::routes();
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::get('/usuarios', [usuariosController::class,'index'])->name('usuarios');
Route::get('/usuarios/nuevo', [usuariosController::class,'create'])->name('usuarios.create');
Route::post('/usuarios/store', [usuariosController::class,'store'])->name('usuarios.store');

2
vite.config.js

@ -5,7 +5,7 @@ export default defineConfig({
plugins: [ plugins: [
laravel({ laravel({
input: [ input: [
'resources/css/app.css', 'resources/sass/app.scss',
'resources/js/app.js', 'resources/js/app.js',
], ],
refresh: true, refresh: true,

Loading…
Cancel
Save