added new migrations and models

This commit is contained in:
Jagad R R
2024-12-11 12:29:37 +07:00
parent 0168f5b32f
commit fc5372a181
21 changed files with 436 additions and 7 deletions
@@ -0,0 +1,32 @@
<?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('cabang', function (Blueprint $table) {
$table->id();
$table->foreignId('region_id')->constrained('region')->onDelete('cascade');
$table->foreignId('cost_id')->constrained('cost_centre')->onDelete('cascade');
$table->string('code');
$table->string('name');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cabang');
}
};