*/ class MissingUrlFactory extends Factory { protected $model = MissingUrl::class; /** * @return array */ public function definition(): array { return [ 'path' => '/'.fake()->unique()->slug(), 'locale' => 'es', 'hits' => fake()->numberBetween(1, 40), 'referrer' => null, 'status' => MissingUrlStatus::Pending, 'first_seen_at' => now()->subDays(3), 'last_seen_at' => now(), ]; } /** * Linked from our own site: a page we publish points at a dead address. */ public function internal(): static { return $this->state(fn () => [ 'referrer' => rtrim((string) config('site.url'), '/').'/'.fake()->slug(), ]); } public function ignored(): static { return $this->state(fn () => ['status' => MissingUrlStatus::Ignored]); } public function resolved(): static { return $this->state(fn () => [ 'status' => MissingUrlStatus::Resolved, 'resolved_at' => now(), ]); } }