Description
Faker Controller should be able to detect relations and set the foreign key values accordingly.
Inside this for loop:
Check for model relations (yii2-openapi could add a list of known relations to the Faker class for this) and add relations to existing models selecting the existing foreign keys.
e.g.
$model->user_id = $faker->randomElement(User::find()->select('id')->column());
The perfect implementation would event sort models by relation dependencies before generating fake data.