Fixes for emails; send user registered/pending depending on state

This commit is contained in:
Nabeel Shahzad
2017-12-22 12:46:46 -06:00
parent 74316218bc
commit 161623c85e
42 changed files with 215 additions and 153 deletions

View File

@@ -0,0 +1,17 @@
<?php
use Faker\Generator as Faker;
/**
* Add any number of airports. Don't really care if they're real or not
*/
$factory->define(App\Models\Airline::class, function (Faker $faker) {
return [
'id' => $faker->unique()->numberBetween(10, 10000),
'icao' => function(array $apt) { return substr($apt['id'],0, 4); },
'iata' => function (array $apt) { return $apt['id']; },
'name' => $faker->sentence(3),
'country' => $faker->country,
'active' => 1
];
});

View File

@@ -12,7 +12,9 @@ $factory->define(App\Models\User::class, function (Faker $faker)
'email' => $faker->safeEmail,
'password' => $password ?: $password = Hash::make('secret'),
'api_key' => $faker->sha1,
'airline_id' => 1,
'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id;
},
'rank_id' => 1,
'flights' => $faker->numberBetween(0, 1000),
'flight_time' => $faker->numberBetween(0, 10000),