29 lines
552 B
PHP
29 lines
552 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Enums\Page;
|
|
use App\Models\Text;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class TextsSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$tabEncarts = [
|
|
Page::newsQuestions(),
|
|
];
|
|
$i = 0;
|
|
|
|
Text::factory(3)->make()
|
|
->each(function (Text $encart) use ($tabEncarts, &$i) {
|
|
$encart->page = $tabEncarts[$i]->value;
|
|
$encart->save();
|
|
});
|
|
}
|
|
}
|