add User persistence: model, migration, eloquent + fake repo
UserModel maps users table (id, email unique, password_hash, is_admin bool default false). EloquentUserRepository implements UserRepository: create from CreateUserDto, find by id, findByEmail. toDomain() materializes a User entity wrapping email in EmailAddress vo. FakeUserRepository: in-memory map keyed by auto-incrementing id, returns defensive copies on read (per youngstartup pattern). composer stan script now passes --no-progress for cleaner ci output.
This commit is contained in:
parent
533320fcac
commit
eca73213f5
5 changed files with 171 additions and 1 deletions
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('email')->unique();
|
||||
$table->string('password_hash');
|
||||
$table->boolean('is_admin')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue