Files
DocumentsPlayground/database/migrations/2026_02_08_135341_create_contracts_table.php

33 lines
734 B
PHP

<?php
use App\Models\User;
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('contracts', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('type');
$table->foreignIdFor(User::class, 'responsible');
$table->morphs('contractable');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('contracts');
}
};