Can't seed created_by column while seeding table
lckamal - 1 year ago
What should we do to seed created_by column? My seeder looks like this:
$this->teams->create( [ 'created_by' => UserModel::find(3), 'name' => $faker->company, 'no_players' => $faker->numberBetween(1,12), 'image' => FolderModel::where('slug', 'team')->first()->files()->inRandomOrder()->first()->id ] );
I have also tried
'created_by' => 3Both option didn't work.