ask('What is the name?'); $email = $this->ask('What is the email?'); $pwd = $this->secret('What is the password?'); if ($this->confirm('Is the user an admin?')) { $admin = true; } else { $projectId = $this->ask("What's the id of the project (s)he's working on?"); } $user = new User(); $user->name = $name; $user->email = $email; if ($admin) { $user->role = 1; } else { $user->project_id = $projectId; } $user->password = Hash::make($pwd); $user->save(); $this->info('User created.'); } }