No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserDummySeeder.php 819B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Database\Seeders;
  3. use Illuminate\Database\Console\Seeds\WithoutModelEvents;
  4. use Illuminate\Database\Seeder;
  5. use App\Models\User;
  6. use Illuminate\Support\Facades\Hash;
  7. class UserDummySeeder extends Seeder
  8. {
  9. /**
  10. * Run the database seeds.
  11. */
  12. public function run(): void
  13. {
  14. $userData = [
  15. [
  16. 'name'=>'RafiAnwar',
  17. 'email' => 'email@gmail.com',
  18. 'role' => 'user',
  19. 'password'=>Hash::make('123456'),
  20. ],[
  21. 'name'=>'Admin',
  22. 'email' => 'admin@gmail.com',
  23. 'role' => 'admin',
  24. 'password'=>Hash::make('123456'),
  25. ]
  26. ];
  27. foreach ($userData as $key => $value) {
  28. User::create($value);
  29. }
  30. }
  31. }