*/ final class KeywordableFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Keywordable::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'keyword_id' => fake()->randomElement(Keyword::pluck('id')), 'keywordable_id' => fake()->randomNumber() ]; } }