*/ class PressReleaseIndexCheckFactory extends Factory { /** * @return array */ public function definition(): array { return [ 'press_release_id' => PressRelease::factory(), 'portal' => Portal::Presseecho, 'url' => 'https://presseecho.test/de/press-release/'.fake()->slug(), 'state' => IndexState::Indexed, 'verdict' => 'PASS', 'coverage_state' => 'Submitted and indexed', 'indexing_state' => 'INDEXING_ALLOWED', 'robots_txt_state' => 'ALLOWED', 'page_fetch_state' => 'SUCCESSFUL', 'last_crawl_time' => now()->subDay(), 'google_canonical' => null, 'raw' => null, 'checked_at' => now(), ]; } public function withState(IndexState $state): static { return $this->state([ 'state' => $state, 'verdict' => $state === IndexState::Indexed ? 'PASS' : 'NEUTRAL', 'last_crawl_time' => $state === IndexState::NotCrawled ? null : now()->subDay(), ]); } }