Files
T_Kawa af171ef107
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Initial commit: CakePHP project
2025-12-01 19:40:46 +01:00

34 lines
827 B
PHP

<?php
declare(strict_types=1);
use Migrations\BaseSeed;
use Authentication\PasswordHasher\DefaultPasswordHasher;
/**
* Users seed.
*/
class UsersSeed extends BaseSeed
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeds is available here:
* https://book.cakephp.org/migrations/4/en/seeding.html
*
* @return void
*/
public function run(): void
{
$hasher = new DefaultPasswordHasher();
$data = [
[
'name' => 'Administrator','email'=>'admin@example.com','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();
}
}