mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
27 lines
514 B
PHP
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);
|
|
}
|
|
}
|
|
}
|
|
}
|