Skip to content

feat(users): split name into first and last fields#33

Merged
ibourgeois merged 1 commit into
mainfrom
codex/7-user-name-split
Apr 10, 2026
Merged

feat(users): split name into first and last fields#33
ibourgeois merged 1 commit into
mainfrom
codex/7-user-name-split

Conversation

@ibourgeois
Copy link
Copy Markdown
Contributor

Closes #7\n\nSummary:\n- Replaces the initial users table column with and \n- Adds computed and attributes on the User model\n- Updates the factory and seed data to use the new name shape\n- Adds Pest coverage for name composition, reverse assignment, and initials\n\nValidation:\n- vendor/bin/pint --dirty --format agent\n- php artisan test --compact\n- npm run build

Copilot AI review requested due to automatic review settings April 10, 2026 10:12
@ibourgeois ibourgeois merged commit 7b87be8 into main Apr 10, 2026
3 checks passed
@ibourgeois ibourgeois deleted the codex/7-user-name-split branch April 10, 2026 10:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a split-name data model for users by replacing the single name field with first_name and last_name, while providing computed name and initials accessors on the User model.

Changes:

  • Updates the users schema and seed data to use first_name / last_name.
  • Adds name and initials computed attributes (and name reverse assignment) on App\Models\User.
  • Adds Pest feature tests covering name composition, splitting, and initials derivation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
database/migrations/0001_01_01_000000_create_users_table.php Replaces name column with first_name/last_name in the users table schema.
app/Models/User.php Updates fillable fields and adds computed name + initials attributes via accessors.
database/factories/UserFactory.php Generates first_name/last_name from Faker output instead of a single name.
database/seeders/DatabaseSeeder.php Seeds the test user using the new name fields.
tests/Feature/UserNameAttributesTest.php Adds feature coverage for the new computed/derived user name behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +16 to +17
$table->string('first_name');
$table->string('last_name');
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR updates the initial users migration in-place (replacing the existing name column with first_name/last_name). If anyone has already run the original migration, php artisan migrate will not apply this change, leaving their DB schema out of sync and causing runtime/test failures. Prefer adding a new migration that adds first_name/last_name, backfills from name, then drops name (or clearly document that contributors must migrate:fresh).

Suggested change
$table->string('first_name');
$table->string('last_name');
$table->string('name');

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
it('combines the user name fields into a name attribute', function (): void {
$user = User::factory()->create([
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says it closes #7, but the linked Issue #7 is about installing/wiring Laravel Fortify authentication flows, while this PR changes user name fields and related model accessors/tests. Please update the issue reference (or PR title/description) so the PR is linked to the correct work item.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(auth): install Fortify and wire backend authentication flows

2 participants