initial round of changes from Claude
This commit is contained in:
42
database/factories/WeatherReportFactory.php
Normal file
42
database/factories/WeatherReportFactory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WeatherReport>
|
||||
*/
|
||||
class WeatherReportFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'type' => fake()->randomElement(['hourly', 'weekly']),
|
||||
'reported_at' => fake()->dateTimeBetween('-7 days', 'now'),
|
||||
'generated_at' => fake()->dateTimeBetween('-7 days', 'now'),
|
||||
'latitude' => fake()->latitude(39, 42),
|
||||
'longitude' => fake()->longitude(-112, -110),
|
||||
'elevation_meters' => fake()->randomFloat(4, 1000, 2000),
|
||||
];
|
||||
}
|
||||
|
||||
public function hourly(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'type' => 'hourly',
|
||||
]);
|
||||
}
|
||||
|
||||
public function weekly(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'type' => 'weekly',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user