Merge pull request #516 from cachethq/user-api-seed

Always seed the demo user with the same API key.
This commit is contained in:
James Brooks 2015-03-16 08:48:18 +00:00
commit 1ccbda7f2e
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ class UsersTableSeeder extends Seeder
"password" => "test123",
"email" => "test@test.com",
"level" => 1,
"api_key" => "9yMHsdioQosnyVK4iCVR",
],
];

View File

@ -65,7 +65,9 @@ class User extends Model implements UserInterface, RemindableInterface
parent::boot();
self::creating(function ($user) {
if (! $user->api_key) {
$user->api_key = self::generateApiKey();
}
});
}