diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..680037c --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,18 @@ + 'hashed']; +} diff --git a/database/migrations/2026_06_02_121004_create_users_table.php b/database/migrations/2026_06_02_121004_create_users_table.php new file mode 100644 index 0000000..6260ea3 --- /dev/null +++ b/database/migrations/2026_06_02_121004_create_users_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->string('password'); + $table->rememberToken(); + $table->timestamps(); + }); + + Schema::create('password_reset_tokens', function (Blueprint $table) { + $table->string('email')->primary(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + } + + public function down(): void + { + Schema::dropIfExists('password_reset_tokens'); + Schema::dropIfExists('users'); + } +}; diff --git a/tests/Feature/AuthTest.php b/tests/Feature/AuthTest.php new file mode 100644 index 0000000..e75e43a --- /dev/null +++ b/tests/Feature/AuthTest.php @@ -0,0 +1,29 @@ +app->make(\Spatie\Permission\PermissionRegistrar::class)->forgetCachedPermissions(); + } + + public function test_users_table_exists_and_user_can_be_created(): void + { + $user = User::create([ + 'name' => 'Test Admin', + 'email' => 'admin@test.com', + 'password' => bcrypt('password'), + ]); + + $this->assertDatabaseHas('users', ['email' => 'admin@test.com']); + } +}