DatabaseSeeder.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Database\Seeders;
  3. use App\Models\User;
  4. // use Illuminate\Database\Console\Seeds\WithoutModelEvents;
  5. use Illuminate\Database\Seeder;
  6. class DatabaseSeeder extends Seeder
  7. {
  8. /**
  9. * Seed the application's database.
  10. */
  11. public function run(): void
  12. {
  13. User::create([
  14. 'login' => 'Admin',
  15. 'email' => 'admin@example.com',
  16. 'full_name' => 'Администратор',
  17. 'phone' => '8(999)111-11-11',
  18. 'password' => Hash::make('KorokNET'),
  19. ]);
  20. User::create([
  21. 'login' => 'Admin',
  22. 'email' => 'admin@example.com',
  23. 'full_name' => 'Администратор',
  24. 'phone' => '8(999)111-11-11',
  25. 'password' => Hash::make('KorokNET'),
  26. ]);
  27. $courses = [
  28. [
  29. "name" => 'Алгоритмизация',
  30. "description" => 'Алгоритмизация',
  31. "price" => 15000,
  32. ],
  33. [
  34. "name" => 'Базы данных',
  35. "description" => 'Базы данных',
  36. "price" => 15000,
  37. ],
  38. [
  39. "name" => 'дизайн',
  40. "description" => 'дизайн',
  41. "price" => 15000,
  42. ],
  43. ];
  44. foreach ($courses as $course) {
  45. Course::create($course);
  46. }
  47. }
  48. }