*/ class PhotoboothConnectCodeFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { $rawCode = str_pad((string) $this->faker->numberBetween(0, 999999), 6, '0', STR_PAD_LEFT); return [ 'event_id' => Event::factory(), 'code_hash' => hash('sha256', $rawCode), 'expires_at' => now()->addMinutes(10), 'redeemed_at' => null, ]; } }