sha1 unique() call

This commit is contained in:
Nabeel Shahzad 2017-12-12 22:13:11 -06:00
parent 9ebeecddd0
commit 300ddb8475
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ $airlinesAvailable = [1];
$factory->define(App\Models\Flight::class, function (Faker $faker) use ($airlinesAvailable) {
return [
'id' => substr($faker->sha1, 0, 12),
'id' => substr($faker->unique()->sha1, 0, 12),
'airline_id' => $faker->randomElement($airlinesAvailable),
'flight_number' => $faker->text(10),
'route_code' => $faker->randomElement(['', $faker->text(5)]),

View File

@ -14,7 +14,7 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) use ($airlines
static $raw_data;
return [
'id' => substr($faker->sha1, 0, 12),
'id' => substr($faker->unique()->sha1, 0, 12),
'airline_id' => $faker->randomElement($airlinesAvailable),
'user_id' => function () { # OVERRIDE THIS IF NEEDED
return factory(App\Models\User::class)->create()->id;