Skip to content

Add Faker optional() by default for nullable fields  #536

Open
@MrYamous

Description

When using make:factory --all-fields Foundry generate default values for all fields according to their type.
WDYT about adding optional() method from Faker by default for those values ?

For example if i have an entity with a nullable field phone currently the default generated is :

'phone' => self::faker()->text(),

My proposal would be to have :

'phone' => self::faker()->optional()->text(),

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions