I have the following structure:
Class Cuopon in the database/migration i have 4 Migration defined === 4 tables.
Users, Cuopons, Restaurants, Scans In the database/Seeds i have the DatabaseSeeder + the 4 seeder for each table.
The DatabaseSeeder contains the following:
$this->call('CuoponTableSeeder');.
and the CuponTableSeeder.php contains the following:
$cuopons = factory(Cuopon::class, 10)->create();
And the ModelFactory contains the following:
$factory->define(App\Cuopon::class, function (Faker\Generator $faker) {
return [
'restaurant_id' => rand(0, 300),
'product_id' => rand(0, 300),
'expires' => $faker->dateTimeBetween('now', '+1 years')
];
});
After running php artisan migrate and then php artisan db:seed will create all the tables, and fills up with 10 rows of dummy data the cuopons table. The question is how can i add more factories in the ModelFactory to be able to fill up the rest of the tables also? I am through the documentation but this does not seems to make sense for me at first.
Thank you in advance!