<?php

use App\TrainingWorkout;
use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        factory(App\User::class, 75)->create()->each(function($u) {
            $u->favorite_workouts()->sync(
                TrainingWorkout::all()->random(rand(1,3))->pluck("id")->toArray()
            );
        });
    }
}
