laravel factory with foreign key code example
Example: laravel factory get foreign key
'region_id' => Region::pluck('id')->random()
######### OR #########
$regions = Region::pluck('id');
'region_id' => $this->faker->randomElement($regions);
'region_id' => Region::pluck('id')->random()
######### OR #########
$regions = Region::pluck('id');
'region_id' => $this->faker->randomElement($regions);