# Factories

# Generate

php artisan make:factory PostFactory

# Examples

# Post

public function definition()
{
	return [
		'title'         => $this->faker->unique()->sentence(),
		'slug'          => $this->faker->unique()->slug(),
		'body'          => $this->faker->paragraph(),
		'publish_at'    => now(),
		'user_id'       => User::factory()->create()
	];
}
Last Updated: 2/4/2022, 12:00:30