Add project
This commit is contained in:
23
config/Seeds/UsersSeed.php
Normal file
23
config/Seeds/UsersSeed.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
use Migrations\BaseSeed;
|
||||
use Authentication\PasswordHasher\DefaultPasswordHasher;
|
||||
class UsersSeed extends BaseSeed
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$hasher = new DefaultPasswordHasher();
|
||||
$data = [
|
||||
[
|
||||
'name' => 'Administrator',
|
||||
'email' => 'admin@example.com',
|
||||
// UWAGA: haslo haszujemy tutaj:
|
||||
'password' => $hasher->hash('Admin123!'),
|
||||
'created' => date('Y-m-d H:i:s'),
|
||||
'modified' => date('Y-m-d H:i:s'),
|
||||
],
|
||||
];
|
||||
$table = $this->table('users');
|
||||
$table->insert($data)->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user