*/ class DumpsiteFactory extends Factory { protected $model = Dumpsite::class; public function definition(): array { $lat = 14.7; $lng = 121.1; $half = 0.003; return [ 'uuid' => (string) Str::uuid(), 'name' => fake()->city().' Dumpsite', 'code' => 'DS-'.strtoupper(Str::random(6)), 'address_line' => fake()->streetAddress(), 'coordinates' => new Point($lat, $lng, 4326), 'boundary_polygon' => new Polygon([new LineString([ new Point($lat - $half, $lng - $half, 4326), new Point($lat - $half, $lng + $half, 4326), new Point($lat + $half, $lng + $half, 4326), new Point($lat + $half, $lng - $half, 4326), new Point($lat - $half, $lng - $half, 4326), ])], 4326), 'capacity_tons' => 1000, 'status' => Dumpsite::STATUS_ACTIVE, ]; } }