Skip to content

Commit

Permalink
Merge pull request #9 from abenerd/feature/add-factory
Browse files Browse the repository at this point in the history
Add factory for HealthCheckResultHistoryItem model
  • Loading branch information
freekmurze authored Dec 7, 2021
2 parents 46811cf + d4cdf88 commit f752148
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions database/factories/HealthCheckResultHistoryItemFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Spatie\Health\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Spatie\Health\Enums\Status;
use Spatie\Health\Models\HealthCheckResultHistoryItem;

class HealthCheckResultHistoryItemFactory extends Factory
{
protected $model = HealthCheckResultHistoryItem::class;

public function definition(): array
{
return [
'check_name' => $this->faker->word(),
'check_label' => $this->faker->word(),
'status' => $this->faker->randomElement(Status::toArray()),
'notification_message' => $this->faker->text(),
'short_summary' => $this->faker->sentences(asText: true),
'meta' => [],
'batch' => (string) Str::uuid(),
'ended_at' => $this->faker->dateTime()
];
}
}

0 comments on commit f752148

Please sign in to comment.