2017-12-13 11:50:55 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Faker\Generator as Faker;
|
|
|
|
|
|
|
|
$factory->define(App\Models\Aircraft::class, function (Faker $faker) {
|
|
|
|
return [
|
2018-03-20 09:50:40 +08:00
|
|
|
'id' => null,
|
|
|
|
'subfleet_id' => function () {
|
2017-12-13 11:50:55 +08:00
|
|
|
return factory(App\Models\Subfleet::class)->create()->id;
|
|
|
|
},
|
2018-03-20 09:50:40 +08:00
|
|
|
'airport_id' => function () {
|
2017-12-13 11:50:55 +08:00
|
|
|
return factory(App\Models\Airport::class)->create()->id;
|
|
|
|
},
|
2018-03-20 09:50:40 +08:00
|
|
|
'icao' => $faker->unique()->text(5),
|
|
|
|
'name' => $faker->unique()->text(50),
|
2017-12-13 11:50:55 +08:00
|
|
|
'registration' => $faker->unique()->text(10),
|
2018-03-20 09:50:40 +08:00
|
|
|
'hex_code' => \App\Support\ICAO::createHexCode(),
|
|
|
|
'status' => \App\Models\Enums\AircraftStatus::ACTIVE,
|
|
|
|
'state' => \App\Models\Enums\AircraftState::PARKED,
|
|
|
|
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
|
|
|
'updated_at' => function (array $pirep) {
|
2017-12-13 11:50:55 +08:00
|
|
|
return $pirep['created_at'];
|
|
|
|
},
|
|
|
|
];
|
|
|
|
});
|