Laravel_api/database/seeds/DatabaseSeeder.php

27 lines
589 B
PHP
Raw Permalink Normal View History

2019-03-01 14:08:34 +08:00
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
2019-03-01 14:50:28 +08:00
for($i=1;$i<=2;$i++){
DB::table('users')->insert([
'name' => 'guaosi'.$i,
'password' => bcrypt('12345678'),
]);
DB::table('admins')->insert([
'name' => 'guaosi'.(122+$i),
'password' => bcrypt('12345678'),
]);
}
2019-03-01 14:08:34 +08:00
}
}