scaffold-factory

Laravel Factory Scaffold Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "scaffold-factory" with this command: npx skills add iurygdeoliveira/labsis-kit/iurygdeoliveira-labsis-kit-scaffold-factory

Laravel Factory Scaffold Skill

Use this skill when defining test data generators for Models.

Conventions

  1. Sensible Faker Data
  • Use $this->faker methods that match the column type contextually.

  • Email: safeEmail() (never real emails).

  • Text: paragraph() or sentence() depending on length.

  • Enums: fake()->randomElement(Enum::cases()) .

  1. State Methods
  • Create state methods for every boolean flag or status enum in the model.

  • This makes tests readable: User::factory()->active()->admin()->create() .

public function admin(): static { return $this->state(fn (array $attributes) => [ 'role' => UserRole::Admin, ]); }

public function suspended(): static { return $this->state(fn (array $attributes) => [ 'suspended_at' => now(), ]); }

  1. Relationships
  • For "BelongsTo" relationships, create the parent factory by default in the definition.

'user_id' => User::factory(),

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

scaffold-filament-resource

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-controller

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-filament-page

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-middleware

No summary provided by upstream source.

Repository SourceNeeds Review