2026_05_14_000001_create_roles_table.php 746 B

123456789101112131415161718192021222324252627
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration
  6. {
  7. public function up(): void
  8. {
  9. Schema::create('roles', function (Blueprint $table) {
  10. $table->id();
  11. $table->string('slug')->unique();
  12. $table->string('name');
  13. $table->text('description')->nullable();
  14. $table->boolean('is_system')->default(false);
  15. $table->boolean('is_active')->default(true);
  16. $table->unsignedInteger('sort')->default(100);
  17. $table->timestamps();
  18. });
  19. }
  20. public function down(): void
  21. {
  22. Schema::dropIfExists('roles');
  23. }
  24. };