Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created November 19, 2021 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/bf8bdb88893c4b5745303c27e350c937 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/bf8bdb88893c4b5745303c27e350c937 to your computer and use it in GitHub Desktop.
<?php
use App\Models\Role;
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(): void {
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->foreignId("role_id")->default(Role::CUSTOMER)->constrained();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->integer('active');
$table->softDeletes();
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void {
Schema::dropIfExists('users');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment