$value, ], [ 'email' => ['required', 'email:rfc', Rule::unique(User::class, 'email')] ]); if ($validator->fails()) { return $validator->messages()->first(); } } ); $uuid = text( label: 'What is your uuid?', placeholder: 'E.g. U05ES1730UE', required: 'Your uuid is required.', validate: function (string $value) { $validator = Validator::make([ 'uuid' => $value, ], [ 'uuid' => ['required', Rule::unique(User::class, 'uuid')] ]); if ($validator->fails()) { return $validator->messages()->first(); } }, hint: 'This is your slack User ID.' ); $profilePic = text( label: 'What is your profile pic?', placeholder: 'E.g. https://secure.gravatar.com/avatar/f2ca68078ae3b3228b0307c20ae84dd2.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-512.png', required: 'Your url is required.', validate: function (string $value) { $validator = Validator::make([ 'url' => $value, ], [ 'url' => ['required', 'url'] ]); if ($validator->fails()) { return $validator->messages()->first(); } }, hint: 'This is your slack profile url.' ); $isAdmin = select( label: 'Is your account an admin?', options: [ true => 'Yes', false =>'No' ], ); $password = password( label: 'What is your password?', placeholder: '**********', hint: 'One will be randomly generated if non is provided', ); if (empty($password)) { $password = Str::password(12); $this->info("Randomly Generated Password: $password"); } User::create([ 'firstname' => $firstName, 'lastname' => $lastName, 'email' => $emailAddress, 'uuid' => $uuid, 'profile' => $profilePic, 'status' => UserStatus::ACTIVE, 'is_admin' => $isAdmin, 'password' => $password, ]); $this->info('Complete!'); } }