lk.zachem.info/database/migrations/2025_03_12_023918_create_roles_table.php
2025-03-20 10:32:29 +08:00

37 lines
844 B
PHP

<?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('roles', function (Blueprint $table)
{
$table->id();
$table->string('name');
$table->timestamps();
});
DB::table('roles')->insert([
['id' => 1, 'name' => 'Super admin'],
['id' => 2, 'name' => 'Company admin'],
['id' => 3, 'name' => 'Agent'],
['id' => 4, 'name' => 'Client'],
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('roles');
}
};