DeveloperTestSeeder.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. namespace Database\Seeders;
  3. use App\Models\Product;
  4. use Illuminate\Database\Seeder;
  5. class DeveloperTestSeeder extends Seeder
  6. {
  7. public function run(): void
  8. {
  9. $this->seedProducts();
  10. }
  11. private function seedProducts(): void
  12. {
  13. $products = [
  14. [
  15. 'name' => 'Apostila Nível 1',
  16. 'sku' => 'AP-NV1',
  17. 'barcode' => '7890001000001',
  18. 'price_cost' => 18.00,
  19. 'price_sale' => 35.00,
  20. 'measure_unit' => 'UN',
  21. 'kit' => false,
  22. 'visible_franchisee' => true,
  23. 'weight' => 0.300,
  24. 'length' => 29.7,
  25. 'height' => 21.0,
  26. ],
  27. [
  28. 'name' => 'Apostila Nível 2',
  29. 'sku' => 'AP-NV2',
  30. 'barcode' => '7890001000002',
  31. 'price_cost' => 18.00,
  32. 'price_sale' => 35.00,
  33. 'measure_unit' => 'UN',
  34. 'kit' => false,
  35. 'visible_franchisee' => true,
  36. 'weight' => 0.300,
  37. 'length' => 29.7,
  38. 'height' => 21.0,
  39. ],
  40. [
  41. 'name' => 'Apostila Nível 3',
  42. 'sku' => 'AP-NV3',
  43. 'barcode' => '7890001000003',
  44. 'price_cost' => 18.00,
  45. 'price_sale' => 35.00,
  46. 'measure_unit' => 'UN',
  47. 'kit' => false,
  48. 'visible_franchisee' => true,
  49. 'weight' => 0.300,
  50. 'length' => 29.7,
  51. 'height' => 21.0,
  52. ],
  53. [
  54. 'name' => 'Kit Material Didático Básico',
  55. 'sku' => 'KIT-MAT-BAS',
  56. 'barcode' => '7890001000010',
  57. 'price_cost' => 45.00,
  58. 'price_sale' => 89.90,
  59. 'measure_unit' => 'KIT',
  60. 'kit' => true,
  61. 'visible_franchisee' => true,
  62. 'weight' => 0.800,
  63. 'length' => 30.0,
  64. 'height' => 22.0,
  65. ],
  66. [
  67. 'name' => 'Kit Material Didático Completo',
  68. 'sku' => 'KIT-MAT-COMP',
  69. 'barcode' => '7890001000011',
  70. 'price_cost' => 90.00,
  71. 'price_sale' => 169.90,
  72. 'measure_unit' => 'KIT',
  73. 'kit' => true,
  74. 'visible_franchisee' => true,
  75. 'weight' => 1.500,
  76. 'length' => 30.0,
  77. 'height' => 22.0,
  78. ],
  79. [
  80. 'name' => 'Caderno de Atividades',
  81. 'sku' => 'CAD-ATI',
  82. 'barcode' => '7890001000020',
  83. 'price_cost' => 12.00,
  84. 'price_sale' => 24.90,
  85. 'measure_unit' => 'UN',
  86. 'kit' => false,
  87. 'visible_franchisee' => true,
  88. 'weight' => 0.200,
  89. 'length' => 29.7,
  90. 'height' => 21.0,
  91. ],
  92. [
  93. 'name' => 'Livro do Aluno — Ginástica do Cérebro',
  94. 'sku' => 'LV-ALUNO-GC',
  95. 'barcode' => '7890001000030',
  96. 'price_cost' => 32.00,
  97. 'price_sale' => 59.90,
  98. 'measure_unit' => 'UN',
  99. 'kit' => false,
  100. 'visible_franchisee' => true,
  101. 'weight' => 0.450,
  102. 'length' => 23.0,
  103. 'height' => 16.0,
  104. ],
  105. [
  106. 'name' => 'Camiseta Ginástica do Cérebro',
  107. 'sku' => 'CAM-GC',
  108. 'barcode' => '7890001000040',
  109. 'price_cost' => 20.00,
  110. 'price_sale' => 49.90,
  111. 'measure_unit' => 'UN',
  112. 'kit' => false,
  113. 'visible_franchisee' => true,
  114. 'weight' => 0.200,
  115. 'length' => 30.0,
  116. 'height' => 20.0,
  117. ],
  118. [
  119. 'name' => 'Pasta do Aluno',
  120. 'sku' => 'PAST-ALUNO',
  121. 'barcode' => '7890001000050',
  122. 'price_cost' => 5.00,
  123. 'price_sale' => 12.90,
  124. 'measure_unit' => 'UN',
  125. 'kit' => false,
  126. 'visible_franchisee' => true,
  127. 'weight' => 0.100,
  128. 'length' => 33.0,
  129. 'height' => 23.0,
  130. ],
  131. [
  132. 'name' => 'Certificado de Conclusão',
  133. 'sku' => 'CERT-CONCL',
  134. 'barcode' => '7890001000060',
  135. 'price_cost' => 2.00,
  136. 'price_sale' => 5.00,
  137. 'measure_unit' => 'UN',
  138. 'kit' => false,
  139. 'visible_franchisee' => false,
  140. 'weight' => 0.050,
  141. 'length' => 29.7,
  142. 'height' => 21.0,
  143. ],
  144. ];
  145. foreach ($products as $product) {
  146. Product::firstOrCreate(['sku' => $product['sku']], $product);
  147. }
  148. }
  149. }