public function run() { $faker = Faker::create(); $post = Post::all()->lists('id'); foreach (range(1, 20) as $index) { $file = $faker->uuid . '.' . $faker->fileExtension; File::create(['post_id' => $faker->randomElement($post), 'path' => $file]); } }