From 300ddb84751070c9d3cc349fca96a96bb3d7eb41 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 12 Dec 2017 22:13:11 -0600 Subject: [PATCH] sha1 unique() call --- database/factories/FlightFactory.php | 2 +- database/factories/PirepFactory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/factories/FlightFactory.php b/database/factories/FlightFactory.php index 05e0b298..65ad0412 100644 --- a/database/factories/FlightFactory.php +++ b/database/factories/FlightFactory.php @@ -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)]), diff --git a/database/factories/PirepFactory.php b/database/factories/PirepFactory.php index ee16b108..28d95329 100644 --- a/database/factories/PirepFactory.php +++ b/database/factories/PirepFactory.php @@ -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;