Skip to content

Commit

Permalink
Merged info about seeding in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizaco committed Aug 6, 2014
2 parents 20739b7 + 54e70d6 commit 5c16a53
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,29 @@ First, publish the config files:

Then edit the view names in `app/config/packages/zizaco/confide/config.php`.

#### Seeding

To seed your users table you should fill also the `password_confirmation` and `confirmation_code` fields. For example:

class UsersTableSeeder extends Seeder {

public function run()
{
$user = new User;
$user->username = 'johndoe;
$user->email = '[email protected]';
$user->password = 'foo_bar_1234';
$user->password_confirmation = 'foo_bar_1234';
$user->confirmation_code = md5($user->username.time('U'));

if(! $user->save()) {
Log::info('Unable to create user '.$user->username, (array)$user->errors());
} else {
Log::info('Created user "'.$user->username.'" <'.$user->email.'>');
}
}
}

#### Custom user validation

You can implement your own validator by creating a class that implements the `UserValidatorInterface` and registering that class as *"confide.user_validator"*.
Expand Down

0 comments on commit 5c16a53

Please sign in to comment.