Files
izyim/database/migrations/2018_09_07_073209_create_user_table.php
T
Omair Saleh 9ddfe429fb large commit
2019-10-07 11:24:31 +08:00

67 lines
2.0 KiB
PHP

<?php
use App\Classes\ValueObjects\Constants\UserRoles;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void {
$faker = \Faker\Factory::create();
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name', 60);
$table->string('last_name', 60);
$table->string('email')->unique();
$table->string('password');
$table->boolean('verified')->default(0);
$table->smallInteger('role_id');
$table->rememberToken();
$table->timestamps();
});
// DB::table('users')->insert([
// [
// 'first_name' => 'Omair',
// 'last_name' => 'Saleh',
// 'email' => 'omair@izyim.com',
// 'password' => Hash::make('123456abcabc'),
// 'verified' => 1,
// 'role_id' => UserRoles::SUPER_ADMIN,
// 'created_at' => \Carbon\Carbon::now(),
// 'updated_at' => \Carbon\Carbon::now()
// ],
// [
// 'first_name' => 'Development',
// 'last_name' => 'User',
// 'email' => env('EMAIL_DEVELOPMENT', 'dev@izyim.com'),
// 'password' => Hash::make('123456abcabc'),
// 'verified' => 1,
// 'role_id' => UserRoles::ADMIN,
// 'created_at' => \Carbon\Carbon::now(),
// 'updated_at' => \Carbon\Carbon::now()
// ]
// ]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user');
}
}