mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-03-15 04:49:46 +01:00
Merge pull request #516 from cachethq/user-api-seed
Always seed the demo user with the same API key.
This commit is contained in:
commit
1ccbda7f2e
@ -21,6 +21,7 @@ class UsersTableSeeder extends Seeder
|
||||
"password" => "test123",
|
||||
"email" => "test@test.com",
|
||||
"level" => 1,
|
||||
"api_key" => "9yMHsdioQosnyVK4iCVR",
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user