Add Service

This commit is contained in:
Andras Bacsai
2023-03-28 08:28:03 +02:00
parent f7dd65d1e1
commit f4daffaa89
10 changed files with 114 additions and 27 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ class ApplicationSeeder extends Seeder
]);
Application::create([
'id' => 2,
'name' => 'My Second application',
'name' => 'My second application (Swarm)',
'environment_id' => $environment_1->id,
'destination_id' => $swarm_docker_1->id,
'destination_type' => SwarmDocker::class,
-2
View File
@@ -20,7 +20,5 @@ class DBSeeder extends Seeder
'destination_id' => $standalone_docker_1->id,
'destination_type' => StandaloneDocker::class,
]);
}
}
+1
View File
@@ -23,6 +23,7 @@ class DatabaseSeeder extends Seeder
KubernetesSeeder::class,
ApplicationSeeder::class,
DBSeeder::class,
ServiceSeeder::class,
]);
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Database\Seeders;
use App\Models\Environment;
use App\Models\Service;
use App\Models\StandaloneDocker;
use Illuminate\Database\Seeder;
class ServiceSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$environment_1 = Environment::find(1);
$standalone_docker_1 = StandaloneDocker::find(1);
Service::create([
'id' => 1,
'name'=> "My first database",
'environment_id' => $environment_1->id,
'destination_id' => $standalone_docker_1->id,
'destination_type' => StandaloneDocker::class,
]);
}
}