Add Field Authorization,

This commit is contained in:
Daeng Deni Mardaeni 2023-11-06 10:35:19 +07:00
parent 3ed6b844f5
commit 3d14dc2c2b
6 changed files with 60 additions and 38 deletions

View File

@ -1,38 +1,42 @@
<?php <?php
use Illuminate\Support\Facades\Schema; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. *
* * @return void
* @return void */
*/ public function up()
public function up() {
{ Schema::create('branches', function (Blueprint $table) {
Schema::create('branches', function (Blueprint $table) { $table->id();
$table->id(); $table->string('kode', 9)->unique();
$table->string('kode',9)->unique(); $table->string('name');
$table->string('name'); $table->char('status', 1)->default('A');
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable();
}); $table->unsignedBigInteger('authorized_by')->nullable();
}
/** });
* Reverse the migrations. }
*
* @return void /**
*/ * Reverse the migrations.
public function down() *
{ * @return void
Schema::dropIfExists('branches'); */
} public function down()
}; {
Schema::dropIfExists('branches');
}
};

View File

@ -17,12 +17,16 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('kode',3)->unique(); $table->string('kode',3)->unique();
$table->string('name'); $table->string('name');
$table->char('status', 1)->default('A');
$table->timestamps(); $table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes(); $table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
}); });
} }

View File

@ -17,13 +17,16 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('kode',3)->unique(); $table->string('kode',3)->unique();
$table->string('name'); $table->string('name');
$table->string('status', 1)->default('A'); $table->char('status', 1)->default('A');
$table->timestamps(); $table->timestamps();
$table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable();
$table->softDeletes(); $table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
}); });
} }

View File

@ -9,7 +9,11 @@
{ {
protected $fillable = [ protected $fillable = [
'kode', 'kode',
'name' 'name',
'status',
'authorized_at',
'authorized_status',
'authorized_by',
]; ];
} }

View File

@ -9,7 +9,11 @@
{ {
protected $fillable = [ protected $fillable = [
'kode', 'kode',
'name' 'name',
'status',
'authorized_at',
'authorized_status',
'authorized_by',
]; ];
} }

View File

@ -7,10 +7,13 @@
class GuaranteeType extends BaseModel class GuaranteeType extends BaseModel
{ {
protected $table = 'guarantee_types';
protected $fillable = [ protected $fillable = [
'kode', 'kode',
'name' 'name',
'status',
'authorized_at',
'authorized_status',
'authorized_by',
]; ];
} }