backstage seeds upload
This commit is contained in:
25
database/seeds/Users.php
Normal file
25
database/seeds/Users.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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),
|
||||
];
|
||||
|
||||
$this->table('users')->insert([$data])->save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user