3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
7return new class extends Migration
12 public function up(): void
14 Schema::create(
'users',
function (Blueprint $table) {
16 $table->string(
'name');
17 $table->string(
'email')->unique();
18 $table->timestamp(
'email_verified_at')->nullable();
19 $table->string(
'password');
20 $table->rememberToken();
24 Schema::create(
'password_reset_tokens',
function (Blueprint $table) {
25 $table->string(
'email')->primary();
26 $table->string(
'token');
27 $table->timestamp(
'created_at')->nullable();
30 Schema::create(
'sessions',
function (Blueprint $table) {
31 $table->string(
'id')->primary();
32 $table->foreignId(
'user_id')->nullable()->index();
33 $table->string(
'ip_address', 45)->nullable();
34 $table->text(
'user_agent')->nullable();
35 $table->longText(
'payload');
36 $table->integer(
'last_activity')->index();
43 public function down(): void
45 Schema::dropIfExists(
'users');
46 Schema::dropIfExists(
'password_reset_tokens');
47 Schema::dropIfExists(
'sessions');
down()
Reverse the migrations.