Beispiel #1
0
 public function run()
 {
     $faker = Faker::create();
     $user = User::where('type', 'client')->lists('id');
     foreach (range(1, 10) as $index) {
         Report::create(['title' => $faker->company, 'message' => $faker->text, 'client_id' => $faker->randomElement($user)]);
     }
 }
Beispiel #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'])]);
     }
 }