27 lines
598 B
PHP
Raw Normal View History

2018-11-21 11:10:25 +08:00
<?php
use think\migration\Seeder;
class Users extends Seeder
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
{
$data = [
'name' => 'admin',
'email' => 'admin@gmail.com',
'password' => password_hash('admin', PASSWORD_DEFAULT),
2018-12-09 09:26:58 +08:00
'created_at' => date('Y-m-d H:i:s'),
'login_at' => date('Y-m-d H:i:s'),
2018-11-21 11:10:25 +08:00
];
$this->table('users')->insert([$data])->save();
}
}