Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Factory Model and Add Slug Trait #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Najmul-Hasan-Sobuj
Copy link

Description:

  • Factory Model Update: Updated the factory for the model to ensure user_id is properly assigned by directly creating a user instance and associating its ID. This resolves the issue where user_id was not being inserted as expected.

  • Slug Trait: Created a reusable Slug trait for generating unique slugs, enhancing consistency across models that require slugs. This trait can be applied to any model where a slug is needed, helping to keep the codebase clean and DRY.

Changes:

  • Modified Factory to use User::factory()->create()->id for user_id assignment.
  • Added Slug trait for consistent slug generation.

This message highlights the changes, benefits, and testing steps, making it clear to reviewers.

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.

1 participant