Seeds
This commit is contained in:
23
app/tests/extension/Seeds/Bancos.php
Normal file
23
app/tests/extension/Seeds/Bancos.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Tests\Extension\Seeds;
|
||||
|
||||
use Tests\Extension\AbstractSeed;
|
||||
|
||||
class Bancos extends AbstractSeed
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$count = 10;
|
||||
|
||||
$data = [];
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$data[] = [
|
||||
'nombre' => $this->faker->company,
|
||||
];
|
||||
}
|
||||
|
||||
$this->table('banco')
|
||||
->insertValues($data)
|
||||
->save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user