<?php

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

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('first_name');
            $table->string('last_name');
            $table->string('street')->nullable();
            $table->string('city')->nullable();
            $table->string('zip')->nullable();
            $table->string('country')->nullable();
            $table->integer('email_code')->nullable();
            $table->string('role')->nullable();
            $table->string('phone')->nullable();
            $table->integer('status')->default(1);
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->integer('isVarified')->default(0);
            $table->string('profile_id')->nullable();
            $table->string('plan_id')->nullable();
            $table->string('avatar')->nullable();
            $table->timestamp('subscription_end_date')->nullable();
            $table->enum('subscription_status',['pending','active','inactive','cancel'])->default('pending');
            $table->bigInteger('payment_count')->default(0);
            $table->rememberToken();
            $table->timestamp('last_login_date')->nullable();
            $table->timestamp('plan_buy_date')->nullable();
            $table->timestamps();
        });
    }

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