feat: 實作機台日誌核心功能與 IoT 高併發處理架構
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 36s
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 36s
This commit is contained in:
23
database/factories/Machine/MachineFactory.php
Normal file
23
database/factories/Machine/MachineFactory.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories\Machine;
|
||||
|
||||
use App\Models\Machine\Machine;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class MachineFactory extends Factory
|
||||
{
|
||||
protected $model = Machine::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'Machine-' . $this->faker->unique()->numberBetween(100, 999),
|
||||
'location' => $this->faker->address(),
|
||||
'status' => $this->faker->randomElement(['online', 'offline', 'error']),
|
||||
'temperature' => $this->faker->randomFloat(2, 2, 10),
|
||||
'firmware_version' => 'v' . $this->faker->randomElement(['1.0.0', '1.1.2', '2.0.1']),
|
||||
'last_heartbeat_at' => $this->faker->dateTimeBetween('-1 day', 'now'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user