UserTableSeeders.php 642 B

123456789101112131415161718192021222324252627
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. class UserTableSeeder extends Seeder {
  4. public function run()
  5. {
  6. DB::table('users')->delete();
  7. for($i = 0; $i < 10; ++$i)
  8. {
  9. DB::table('users')->insert([
  10. 'name' => 'Nom' . $i,
  11. 'email' => 'email' . $i . '@blop.fr',
  12. 'password' => bcrypt('password'),
  13. 'admin' => rand(0, 1)
  14. ]);
  15. }
  16. DB::table('users')->insert([
  17. 'name' => 'alice' . $i,
  18. 'email' => 'alice.millour' . $i . '@abtela.eu',
  19. 'password' => bcrypt('password'),
  20. 'admin' => '1'
  21. ]);
  22. }
  23. }