<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\User;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('fullname');
            $table->string('login')->unique();
            $table->string('phone')->unique();
            $table->string('email')->unique();
            $table->enum('role', ['user', 'admin'])->default('user');
            $table->timestamp('email_verified_at')->unique();
            $table->string('password')->unique();
            $table->rememberToken();
            $table->timestamps();
        });

        $user = User::create([
            'fullname' => 'админ',
            'login' => 'admin',
            'phone' => '000000000000',
            'email' => "admin@admin",
            'password' => 'admin',
        ]);
    }
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('users');
    }
};
