Browse Source

Crear Modelos, Migraciones y Controladores

Crear Modelos, Migraciones y Controladores HistorialPrestamos
main
Eduardo24052 2 months ago
parent
commit
f58786b4f4
  1. 65
      app/Http/Controllers/HistorialPrestamosController.php
  2. 12
      app/Models/HistorialPrestamos.php
  3. 23
      database/factories/HistorialPrestamosFactory.php
  4. 27
      database/migrations/2025_02_28_003024_create_historial_prestamos_table.php
  5. 17
      database/seeders/HistorialPrestamosSeeder.php
  6. 282
      resources/views/welcome.blade.php
  7. 3
      routes/web.php

65
app/Http/Controllers/HistorialPrestamosController.php

@ -0,0 +1,65 @@
<?php
namespace App\Http\Controllers;
use App\Models\HistorialPrestamos;
use Illuminate\Http\Request;
class HistorialPrestamosController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(HistorialPrestamos $historialPrestamos)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(HistorialPrestamos $historialPrestamos)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, HistorialPrestamos $historialPrestamos)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(HistorialPrestamos $historialPrestamos)
{
//
}
}

12
app/Models/HistorialPrestamos.php

@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class HistorialPrestamos extends Model
{
/** @use HasFactory<\Database\Factories\HistorialPrestamosFactory> */
use HasFactory;
}

23
database/factories/HistorialPrestamosFactory.php

@ -0,0 +1,23 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\HistorialPrestamos>
*/
class HistorialPrestamosFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
//
];
}
}

27
database/migrations/2025_02_28_003024_create_historial_prestamos_table.php

@ -0,0 +1,27 @@
<?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::create('historial_prestamos', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('historial_prestamos');
}
};

17
database/seeders/HistorialPrestamosSeeder.php

@ -0,0 +1,17 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class HistorialPrestamosSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
}
}

282
resources/views/welcome.blade.php

File diff suppressed because one or more lines are too long

3
routes/web.php

@ -2,6 +2,9 @@
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
});

Loading…
Cancel
Save