id(); $table->string('name')->unique(); // admin, staff, viewer $table->string('label'); // Admin Sistem, Kakitangan, Pengguna $table->text('description')->nullable(); $table->timestamps(); }); Schema::create('user_roles', function (Blueprint $table) { $table->id(); $table->foreignId('user_id')->constrained()->cascadeOnDelete(); $table->foreignId('role_id')->constrained()->cascadeOnDelete(); $table->timestamps(); $table->unique(['user_id', 'role_id']); }); // Tambah kolum role pada users untuk single-role semudah mungkin Schema::table('users', function (Blueprint $table) { $table->string('role')->default('viewer')->after('password'); // role: admin | staff | viewer }); } public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('role'); }); Schema::dropIfExists('user_roles'); Schema::dropIfExists('roles'); } };