SilenceBringer's avatar

SilenceBringer liked a comment+100 XP

6d ago

@imranbru That is not a solution 😬

SilenceBringer's avatar

SilenceBringer wrote a reply+100 XP

2mos ago

If you need to create just 1 instance - mergeFillable method will help you, but you'll need to make the model first, and thet save it.

Vulnerability::factory()
	->make()
	->mergeFillable(['asset_id'])
	->save()

or you can move mergeFillable method to the factory callback https://laravel.com/docs/12.x/eloquent-factories#factory-callbacks

Not sure how good it will be with mass factory creation, just as the first idea