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

27 lines
514 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'],
];
foreach ($servers as $server) {
$record = DbServer::where('name', '=', $server['name'])->first();
if ($record) {
// do nothing
} else {
DbServer::create($server);
}
}
}
}