sha1 unique() call
This commit is contained in:
parent
9ebeecddd0
commit
300ddb8475
@ -8,7 +8,7 @@ $airlinesAvailable = [1];
|
|||||||
|
|
||||||
$factory->define(App\Models\Flight::class, function (Faker $faker) use ($airlinesAvailable) {
|
$factory->define(App\Models\Flight::class, function (Faker $faker) use ($airlinesAvailable) {
|
||||||
return [
|
return [
|
||||||
'id' => substr($faker->sha1, 0, 12),
|
'id' => substr($faker->unique()->sha1, 0, 12),
|
||||||
'airline_id' => $faker->randomElement($airlinesAvailable),
|
'airline_id' => $faker->randomElement($airlinesAvailable),
|
||||||
'flight_number' => $faker->text(10),
|
'flight_number' => $faker->text(10),
|
||||||
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
||||||
|
@ -14,7 +14,7 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) use ($airlines
|
|||||||
static $raw_data;
|
static $raw_data;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => substr($faker->sha1, 0, 12),
|
'id' => substr($faker->unique()->sha1, 0, 12),
|
||||||
'airline_id' => $faker->randomElement($airlinesAvailable),
|
'airline_id' => $faker->randomElement($airlinesAvailable),
|
||||||
'user_id' => function () { # OVERRIDE THIS IF NEEDED
|
'user_id' => function () { # OVERRIDE THIS IF NEEDED
|
||||||
return factory(App\Models\User::class)->create()->id;
|
return factory(App\Models\User::class)->create()->id;
|
||||||
|
Loading…
Reference in New Issue
Block a user