1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
invoiceninja/database/seeds/DbServerSeeder.php
2017-05-02 12:09:14 +03:00

28 lines
552 B
PHP

<?php
use App\Models\DbServer;
class DbServerSeeder extends Seeder
{
public function run()
{
Eloquent::unguard();
$servers = [
['name' => 'db-ninja-1'],
['name' => 'db-ninja-2'],
['name' => 'db-ninja-3'],
];
foreach ($servers as $server) {
$record = DbServer::where('name', '=', $server['name'])->first();
if ($record) {
// do nothing
} else {
DbServer::create($server);
}
}
}
}