Conditions | 2 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function run(): void |
||
12 | { |
||
13 | //Action when run the seed |
||
14 | |||
15 | $data = [ |
||
16 | 0 => [ |
||
17 | 'id' => 1, |
||
18 | 'name' => 'Toyota Corolla Verso 1.8', |
||
19 | 'description' => NULL, |
||
20 | 'price' => 3467.0, |
||
21 | 'quantity' => 2.0, |
||
22 | 'product_category_id' => 2, |
||
23 | 'created_at' => '2023-12-07 06:21:59', |
||
24 | 'updated_at' => NULL, |
||
25 | ], |
||
26 | 1 => [ |
||
27 | 'id' => 2, |
||
28 | 'name' => 'HP 840', |
||
29 | 'description' => NULL, |
||
30 | 'price' => 890.0, |
||
31 | 'quantity' => 14.0, |
||
32 | 'product_category_id' => 1, |
||
33 | 'created_at' => '2023-12-07 06:26:46', |
||
34 | 'updated_at' => '2023-12-07 14:18:29', |
||
35 | ], |
||
36 | ]; |
||
37 | foreach ($data as $row) { |
||
38 | $this->insert($row)->into('products'); |
||
39 | } |
||
42 | } |