Migration

 php artisan make:migration create_users_table --create=users

php artisan migrate


<?php


use Illuminate\Support\Facades\Schema;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Database\Migrations\Migration;


class CreateUsersTable extends Migration

{

    /**

     * Run the migrations.

     *

     * @return void

     */

    public function up()

    {

        Schema::create('users', function (Blueprint $table) {

            $table->bigIncrements('id');

            $table->enum('userType', array('Admin', 'User'))->default(null);

            $table->string('name')->nullable();

            $table->string('email', 63);

            $table->string('mobileNumber', 10)->nullable();

            $table->string('password', 255);

            $table->string('showPassword', 255);


            $table->string('otp', 4)->nullable();

            $table->string('profilePic')->nullable();

            $table->string('deviceToken')->nullable();

            $table->string('fcmToken', 255)->nullable();

            

            $table->string('deviceType', 255)->nullable();

            $table->boolean('isEmailVerified')->default(0);

            $table->boolean('isMobileVerified')->default(0);

            $table->boolean('isActive')->default(0);


            $table->timestamp('deleted_at')->nullable();

            $table->timestamps();

        });

    }


    /**

     * Reverse the migrations.

     *

     * @return void

     */

    public function down()

    {

        Schema::dropIfExists('users');

    }

}


Comments

Popular posts from this blog

API

Encryption and Decryption By PHP

Seeder