Last active
July 14, 2021 08:41
-
-
Save cursosdesarrolloweb/3a157c7e0937227cfbc997cdec77d7f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Enums\UserType; | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
use App\Models\User; | |
class CreateUsersTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::create('users', function (Blueprint $table) { | |
$table->id(); | |
$table->enum("role", UserType::getValues())->default(UserType::Moderator()); | |
$table->string('name'); | |
$table->string('phone')->nullable(); | |
$table->string('email')->unique()->nullable(); | |
$table->timestamp('email_verified_at')->nullable(); | |
$table->string('password')->nullable(); | |
$table->rememberToken(); | |
$table->timestamps(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::dropIfExists('users'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment