Initial commit - Car Rental Management System
This commit is contained in:
commit
f72173377a
100 files changed
+15201
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('rentals', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('car_id')->constrained()->onDelete('cascade');
|
||||
$table->foreignId('customer_id')->constrained()->onDelete('cascade');
|
||||
$table->date('start_date');
|
||||
$table->date('end_date');
|
||||
$table->decimal('total_amount', 10, 2);
|
||||
$table->decimal('advance_payment', 10, 2)->default(0);
|
||||
$table->enum('status', ['pending', 'active', 'completed', 'cancelled'])->default('pending');
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rentals');
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user