All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 45s
27 lines
684 B
PHP
27 lines
684 B
PHP
<?php
|
|
|
|
namespace Database\Factories\Machine;
|
|
|
|
use App\Models\Machine\Machine;
|
|
use App\Models\Machine\MachineLog;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class MachineLogFactory extends Factory
|
|
{
|
|
protected $model = MachineLog::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'machine_id' => Machine::factory(),
|
|
'level' => fake()->randomElement(['info', 'warning', 'error']),
|
|
'message' => fake()->sentence(),
|
|
'context' => [
|
|
'ip' => fake()->ipv4(),
|
|
'uptime' => fake()->numberBetween(1000, 100000),
|
|
],
|
|
'created_at' => now(),
|
|
];
|
|
}
|
|
}
|