lasthourcloud/database/seeders/ServerSeeder.php

40 lines
1.0 KiB
PHP
Raw Normal View History

<?php
namespace Database\Seeders;
2023-03-27 12:31:42 +00:00
use App\Models\PrivateKey;
use App\Models\Server;
use App\Models\Team;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
2023-03-27 12:31:42 +00:00
use Illuminate\Support\Facades\DB;
class ServerSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$root_team = Team::find(1);
2023-03-27 12:31:42 +00:00
$private_key_1 = PrivateKey::find(1);
$server_1 = Server::create([
'id' => 1,
'name' => "testing-host",
'description' => "This is a test docker container",
'ip' => "coolify-testing-host",
'team_id' => $root_team->id,
2023-03-27 12:31:42 +00:00
'private_key_id' => $private_key_1->id,
]);
Server::create([
'id' => 2,
'name' => "testing-host2",
'description' => "This is a test docker container",
'ip' => "coolify-testing-host-2",
'team_id' => $root_team->id,
2023-03-27 12:31:42 +00:00
'private_key_id' => $private_key_1->id,
]);
2023-03-27 12:31:42 +00:00
}
}