foreach ($ipPool as $ip) {
$date = new \DateTime($csv[5]);
Resource::updateOrCreate([
'ip' => trim($ip),
'domain' => $csv[1],
'url' => $csv[2],
'organization' => $csv[3],
'number' => $csv[4],
'date' => $date,
], [
'ip' => trim($ip),
'domain' => $csv[1],
'url' => $csv[2],
'organization' => $csv[3],
'number' => $csv[4],
'date' => $date,
'version_date' => $updatedDate
]);
}
foreach ($ipPool as $ip) {
$date = new \DateTime($csv[5]);
Resource::updateOrCreate([
'ip' => trim($ip),
'domain' => $csv[1],
'url' => $csv[2],
'organization' => $csv[3],
'number' => $csv[4],
'date' => $date,
], [
'ip' => trim($ip),
'domain' => $csv[1],
'url' => $csv[2],
'organization' => $csv[3],
'number' => $csv[4],
'date' => $date,
'version_date' => $updatedDate
]);
}
public function up()
{
Schema::create('labels', function (Blueprint $table) {
$table->increments('id');
$table->integer('key');
$table->string('value');
$table->string('sources');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('labels');
}
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "taggables"
Тогда я получаю