feat: anggota dapat menulis artikel dengan workflow approval sebelum diterbitkan

This commit is contained in:
2026-04-03 06:48:06 +07:00
parent 5d14b55173
commit a7e10600d4
12 changed files with 339 additions and 10 deletions
@@ -0,0 +1,25 @@
<?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::table('posts', function (Blueprint $table) {
$table->enum('status', ['draft', 'pending', 'published', 'rejected'])
->default('draft')->after('author_id');
$table->foreignId('reviewed_by')->nullable()->constrained('users')->after('status');
$table->text('rejection_reason')->nullable()->after('reviewed_by');
});
}
public function down(): void
{
Schema::table('posts', function (Blueprint $table) {
$table->dropColumn(['status', 'reviewed_by', 'rejection_reason']);
});
}
};