diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index d01a0ef..4ed2b6d 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -14,10 +14,16 @@ class DatabaseSeeder extends Seeder public function run(): void { // User::factory(10)->create(); + if (empty(User::where('email', 'test@example.co')->first())){ + User::factory()->create([ + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + } - User::factory()->create([ - 'name' => 'Test User', - 'email' => 'test@example.com', + $this->call([ + HostSeeder::class, + TaskSeeder::class, ]); } } diff --git a/database/seeders/HostSeeder.php b/database/seeders/HostSeeder.php new file mode 100644 index 0000000..8308b24 --- /dev/null +++ b/database/seeders/HostSeeder.php @@ -0,0 +1,22 @@ + $hostname, + ]); + } + } +} diff --git a/database/seeders/TaskSeeder.php b/database/seeders/TaskSeeder.php new file mode 100644 index 0000000..bca4718 --- /dev/null +++ b/database/seeders/TaskSeeder.php @@ -0,0 +1,23 @@ + $name, + 'description' => $name, + ]); + } + } +} diff --git a/resources/views/maintenance/planned-detail.blade.php b/resources/views/maintenance/planned-detail.blade.php index 53f82e6..f94c659 100644 --- a/resources/views/maintenance/planned-detail.blade.php +++ b/resources/views/maintenance/planned-detail.blade.php @@ -4,20 +4,23 @@
{!! $maintenance_history->maintenance->description !!}
- @foreach ($maintenance_history->historyHosts as $historyHost) -{!! $historyTasks->maintenanceTask->task->description !!}
+ @endforeach +