Skip to content

Commit

Permalink
Better default detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mscherer committed Jul 18, 2023
1 parent 75a41a7 commit cb6e85b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Shell/UserShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ public function create($displayFieldValue = null, $password = null) {
}

if ($schema->getColumn('email') && $displayField !== 'email') {
$provideEmail = $this->in('Provide Email?', ['y', 'n'], 'n');
$emailSchema = $schema->getColumn('email');
$nullAllowed = $emailSchema['null'] ?? null;
$provideEmail = $nullAllowed === false ? 'y' : $this->in('Provide Email?', ['y', 'n'], 'n');
if ($provideEmail === 'y') {
$email = $this->in('Please insert an email');
$data['email'] = $email;
Expand Down

0 comments on commit cb6e85b

Please sign in to comment.