*/ class PortfolioFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'user_id' => User::factory(), 'name' => fake()->word(), 'domain' => fake()->unique()->domainName(), 'path' => 'portfolios/' . fake()->word() . '/index.html', 'deployed' => false, 'active' => true, ]; } /** * Mark portfolio as inactive. */ public function inactive(): static { return $this->state(fn (array $attributes) => [ 'active' => false, ]); } /** * Mark portfolio as deployed. */ public function deployed(): static { return $this->state(fn (array $attributes) => [ 'deployed' => true, ]); } }