lots of progress

This commit is contained in:
Doar Mihai
2026-01-17 13:46:20 +02:00
parent ab5d3cae98
commit 030a105992
77 changed files with 8507 additions and 20 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace Database\Seeders;
use App\Models\Site;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class MonitoringDemoSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// Create a demo user
$user = User::factory()->create([
'name' => 'Demo User',
'email' => 'demo@example.com',
]);
// Create 10 demo sites for the user
Site::factory(10)
->for($user)
->create()
->each(function (Site $site) {
// Create 5-15 uptime checks per site
$site->uptimeChecks()->createMany(
\App\Models\UptimeCheck::factory(rand(5, 15))->make()->toArray()
);
// Create 1-3 SSL certificates per site
$site->sslCertificates()->createMany(
\App\Models\SslCertificate::factory(rand(1, 3))->make()->toArray()
);
// Create 0-5 broken links per site (some sites may have none)
$brokenLinksCount = rand(0, 5);
if ($brokenLinksCount > 0) {
$site->brokenLinks()->createMany(
\App\Models\BrokenLink::factory($brokenLinksCount)->make()->toArray()
);
}
});
$this->command->info('Created 10 demo sites with monitoring data!');
$this->command->info("Login with: {$user->email}");
}
}