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.

82 lines
2.8 KiB

1 month ago
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. use Illuminate\Support\Facades\DB;
  4. class DemoDataSeeders extends Seeder
  5. {
  6. /**
  7. * Seed the application's database.
  8. *
  9. * @return void
  10. */
  11. public function run()
  12. {
  13. $users_path = public_path('sql/users.sql');
  14. $users_sql = file_get_contents($users_path);
  15. DB::statement($users_sql);
  16. $types_path = public_path('sql/types.sql');
  17. $types_sql = file_get_contents($types_path);
  18. DB::statement($types_sql);
  19. // For ChawkBazar
  20. $types_path = public_path('sql/tags.sql');
  21. $types_sql = file_get_contents($types_path);
  22. DB::statement($types_sql);
  23. $categories_path = public_path('sql/categories.sql');
  24. $categories_sql = file_get_contents($categories_path);
  25. DB::statement($categories_sql);
  26. $products_path = public_path('sql/products.sql');
  27. $products_sql = file_get_contents($products_path);
  28. DB::statement($products_sql);
  29. $coupons_path = public_path('sql/coupons.sql');
  30. $coupons_sql = file_get_contents($coupons_path);
  31. DB::statement($coupons_sql);
  32. // TODO : no order status is available anymore
  33. // $orders_status_path = public_path('sql/order_status.sql');
  34. // $orders_status_sql = file_get_contents($orders_status_path);
  35. // DB::statement($orders_status_sql);
  36. // For ChawkBazar
  37. $types_path = public_path('sql/product_tag.sql');
  38. $types_sql = file_get_contents($types_path);
  39. DB::statement($types_sql);
  40. $category_product_path = public_path('sql/category_product.sql');
  41. $category_product_sql = file_get_contents($category_product_path);
  42. DB::statement($category_product_sql);
  43. $orders_path = public_path('sql/orders.sql');
  44. $orders_sql = file_get_contents($orders_path);
  45. DB::statement($orders_sql);
  46. $order_product_path = public_path('sql/order_product.sql');
  47. $order_product_sql = file_get_contents($order_product_path);
  48. DB::statement($order_product_sql);
  49. $settings_path = public_path('sql/settings.sql');
  50. $settings_sql = file_get_contents($settings_path);
  51. DB::statement($settings_sql);
  52. $permissions_path = public_path('sql/permissions.sql');
  53. $permissions_sql = file_get_contents($permissions_path);
  54. DB::statement($permissions_sql);
  55. $shipping_classes_path = public_path('sql/shipping_classes.sql');
  56. $shipping_classes_sql = file_get_contents($shipping_classes_path);
  57. DB::statement($shipping_classes_sql);
  58. $tax_classes_path = public_path('sql/tax_classes.sql');
  59. $tax_classes_sql = file_get_contents($tax_classes_path);
  60. DB::statement($tax_classes_sql);
  61. $this->command->info('Seed completed from sql file!');
  62. }
  63. }