Browse Source

arreglo de migraciones

si
TheSilva7 3 months ago
parent
commit
7e7e85f591
  1. 0
      -i
  2. 28
      database/migrations/2025_03_27_183714_add_columneliminado_toprestamos.php
  3. 28
      database/migrations/2025_03_28_175646_add_estado_to_prestamos_table.php
  4. 28
      database/migrations/2025_03_28_182126_add_estado_to_prestamos_table.php
  5. 28
      database/migrations/2025_03_28_183038_add_estado_to_prestamos_table.php
  6. 28
      database/migrations/2025_04_01_191325_add_estado_to_prestamos_table.php
  7. 28
      database/migrations/2025_04_01_192918_add_fecha_aceptacion_to_prestamos_table.php
  8. 5
      database/migrations/2025_05_08_174026_create_prestamos_table.php
  9. 20
      database/migrations/[timestamp]_add_fecha_aceptacion_to_prestamos_table.php
  10. 43
      resources/views/layouts/dashboard.blade.php
  11. 1
      routes/web.php

28
database/migrations/2025_03_27_183714_add_columneliminado_toprestamos.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->boolean('eliminado')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->dropColumn('eliminado');
});
}
};

28
database/migrations/2025_03_28_175646_add_estado_to_prestamos_table.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
};

28
database/migrations/2025_03_28_182126_add_estado_to_prestamos_table.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
};

28
database/migrations/2025_03_28_183038_add_estado_to_prestamos_table.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->string('estado')->default('pendiente'); // pendiente, aceptado, rechazado
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->dropColumn('estado');
});
}
};

28
database/migrations/2025_04_01_191325_add_estado_to_prestamos_table.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->enum('estado', ['pendiente', 'aceptado', 'rechazado'])->default('pendiente')->after('chofer');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
$table->dropColumn('estado');
});
}
};

28
database/migrations/2025_04_01_192918_add_fecha_aceptacion_to_prestamos_table.php

@ -1,28 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('prestamos', function (Blueprint $table) {
//
});
}
};

5
database/migrations/2025_03_27_174121_create_prestamos_table.php → database/migrations/2025_05_08_174026_create_prestamos_table.php

@ -20,7 +20,10 @@ return new class extends Migration
$table->text('motivo'); $table->text('motivo');
$table->string('domicilio'); $table->string('domicilio');
$table->integer('numero_personas'); $table->integer('numero_personas');
$table->boolean('chofer')->default(false); // Opción de sí (true) o no (false) $table->boolean('chofer')->default(false);
$table->enum('estado', ['pendiente', 'aceptado', 'rechazado'])->default('pendiente');
$table->timestamp('fecha_aceptacion')->nullable();
$table->boolean('eliminado')->default(false);
$table->timestamps(); $table->timestamps();
}); });
} }

20
database/migrations/[timestamp]_add_fecha_aceptacion_to_prestamos_table.php

@ -1,20 +0,0 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFechaAceptacionToPrestamosTable extends Migration
{
public function up()
{
Schema::table('prestamos', function (Blueprint $table) {
$table->timestamp('fecha_aceptacion')->nullable()->after('estado');
});
}
public function down()
{
Schema::table('prestamos', function (Blueprint $table) {
$table->dropColumn('fecha_aceptacion');
});
}
}

43
resources/views/layouts/dashboard.blade.php

@ -234,41 +234,18 @@
<!-- Navbar modernizado --> <!-- Navbar modernizado -->
<header class="bg-white/80 backdrop-blur-md shadow-sm"> <header class="bg-white/80 backdrop-blur-md shadow-sm">
<div class="flex items-center justify-between px-8 py-4"> <div class="flex items-center justify-between px-8 py-4">
<button class="md:hidden text-gray-500 hover:text-gray-700 transition-colors duration-200"> <div class="flex items-center gap-2 bg-gray-100 rounded-full px-2 py-1">
<i class="fas fa-bars text-xl"></i> <div class="w-10 h-10 flex items-center justify-center rounded-full bg-gray-200 text-gray-700 font-semibold text-lg">
</button> {{ strtoupper(substr(Auth::user()->name ?? 'U', 0, 1)) }}{{ strtoupper(substr(Auth::user()->name ?? 'U', 1, 1)) }}
<div class="flex items-center space-x-4">
<div class="relative" x-data="{ open: false }">
<button @click="open = !open"
class="flex items-center space-x-3 text-gray-700 hover:text-gray-900 px-4 py-2 rounded-full hover:bg-gray-100 transition-all duration-200">
<img src="https://ui-avatars.com/api/?name={{ Auth::check() ? Auth::user()->name : 'Usuario' }}"
alt="Profile"
class="w-8 h-8 rounded-full ring-2 ring-blue-500/20">
<span class="font-medium">{{ Auth::check() ? Auth::user()->name : 'Usuario' }}</span>
<i class="fas fa-chevron-down text-sm transition-transform duration-200"
:class="{ 'transform rotate-180': open }"></i>
</button>
<!-- Menú desplegable modernizado -->
<div x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 transform scale-95"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-150"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-95"
@click.away="open = false"
class="absolute right-0 mt-2 w-48 bg-white rounded-xl shadow-lg py-2 ring-1 ring-black ring-opacity-5">
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors duration-150">
<i class="fas fa-sign-out-alt mr-2"></i> Cerrar Sesión
</button>
</form>
</div>
</div> </div>
<span class="font-medium text-gray-800">{{ Auth::user()->name ?? 'Usuario' }}</span>
</div> </div>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button type="submit" class="flex items-center gap-1 text-red-600 hover:text-red-800 font-semibold transition-colors">
<i class="fas fa-sign-out-alt"></i> Cerrar Sesión
</button>
</form>
</div> </div>
</header> </header>

1
routes/web.php

@ -73,6 +73,7 @@ use App\Http\Controllers\DespartamentoController;
// Rutas protegidas que requieren autenticación // Rutas protegidas que requieren autenticación
// Rutas protegidas que requieren autenticación // Rutas protegidas que requieren autenticación
Route::middleware(['auth'])->group(function () { Route::middleware(['auth'])->group(function () {

Loading…
Cancel
Save