Closed naimkhalifa closed 9 years ago
Considering the following code in my factories.php file:
$factory('App\Event', [
'title' => $faker->sentence(8), 'user_id' => rand(1,10), 'description' => $faker->sentence, 'address' => $faker->address, 'date' => $faker->date, 'time' => $faker->time
]);
When I do 'php artisan db:seed' , I get the same integer value for all events table entries on 'user_id'.
Ok, there is an easy workaround with faker:
'user_id' => $faker->randomDigitNotNull
Considering the following code in my factories.php file:
$factory('App\Event', [
]);
When I do 'php artisan db:seed' , I get the same integer value for all events table entries on 'user_id'.