phpvms/app/Database/factories/AirlineFactory.php
Nabeel S 3ebf4f2924
Custom user fields #711 (#772)
Custom user fields during registration and profile edit #711
2020-08-11 17:48:51 -04:00

26 lines
651 B
PHP

<?php
use Faker\Generator as Faker;
use Hashids\Hashids;
/*
* 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' => null,
'icao' => function (array $apt) {
$hashids = new Hashids(microtime(), 5);
$mt = str_replace('.', '', microtime(true));
return $hashids->encode($mt);
},
'iata' => function (array $apt) {
return $apt['icao'];
},
'name' => $faker->sentence(3),
'country' => $faker->country,
'active' => 1,
];
});