예제 #1
0
 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]);
     }
 }
예제 #2
0
 public function run()
 {
     $faker = Faker::create();
     $report = Report::all()->lists('id');
     $user = User::all()->lists('id');
     foreach (range(1, 100) as $index) {
         Post::create(['report_id' => $faker->randomElement($report), 'user_id' => $faker->randomElement($user), 'message' => $faker->text, 'type' => $faker->randomElement(['private', 'public'])]);
     }
 }