get the generated IDs from the middle of the sha1 hash
This commit is contained in:
parent
080e8842ac
commit
93786835af
@ -4,7 +4,7 @@ use Faker\Generator as Faker;
|
|||||||
|
|
||||||
$factory->define(App\Models\Acars::class, function (Faker $faker) {
|
$factory->define(App\Models\Acars::class, function (Faker $faker) {
|
||||||
return [
|
return [
|
||||||
'id' => substr($faker->unique()->sha1, 0, 12),
|
'id' => substr($faker->unique()->sha1, 28, 12),
|
||||||
'pirep_id' => '', # fill this out by
|
'pirep_id' => '', # fill this out by
|
||||||
'log' => $faker->text(200),
|
'log' => $faker->text(200),
|
||||||
'lat' => $faker->latitude,
|
'lat' => $faker->latitude,
|
||||||
|
@ -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->unique()->sha1, 0, 12),
|
'id' => substr($faker->unique()->sha1, 28, 12),
|
||||||
'airline_id' => $faker->randomElement($airlinesAvailable),
|
'airline_id' => $faker->randomElement($airlinesAvailable),
|
||||||
'flight_number' => $faker->unique()->text(10),
|
'flight_number' => $faker->unique()->text(10),
|
||||||
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
||||||
|
@ -10,7 +10,7 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) {
|
|||||||
static $raw_data;
|
static $raw_data;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => substr($faker->unique()->sha1, 0, 12),
|
'id' => substr($faker->unique()->sha1, 28, 12),
|
||||||
'airline_id' => function () { # OVERRIDE THIS IF NEEDED
|
'airline_id' => function () { # OVERRIDE THIS IF NEEDED
|
||||||
return factory(App\Models\Airline::class)->create()->id;
|
return factory(App\Models\Airline::class)->create()->id;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user