<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('users', function (Blueprint $table) {
      $table->id();
      $table->string('username');
      $table->string('firstname')->nullable();
      $table->string('lastname')->nullable();
      $table->string('email')->unique();
      $table->timestamp('email_verified_at')->nullable();
      $table->string('password');
      $table->string('address')->nullable();
      $table->string('city')->nullable();
      $table->string('country')->nullable();
      $table->string('postal')->nullable();
      $table->integer('status')->default(1);
      // role default to guest
      $table->integer('groups')->default();
      $table->integer('roles')->default(5);
      $table->text('about')->nullable();
      $table->rememberToken();
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('users');
  }
};
