As you can see in the code below, the created_at
field is the same at all, the only thing that changes is nome
. Would you have any way to write created_at
only once, but insert it on all lines?
DB::table('generos')->insert([
[
'nome' => 'Ação',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
],
[
'nome' => 'Comédia',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
],
[
'nome' => 'Terror',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
],
[
'nome' => 'Policial',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
],
[
'nome' => 'Fantasia',
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
]
]);