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-02-07 03:11:42 +08:00
|
|
|
'id' => null,
|
2017-12-13 11:50:55 +08:00
|
|
|
'subfleet_id' => function() {
|
|
|
|
return factory(App\Models\Subfleet::class)->create()->id;
|
|
|
|
},
|
|
|
|
'airport_id' => function () {
|
|
|
|
return factory(App\Models\Airport::class)->create()->id;
|
|
|
|
},
|
2018-01-06 03:00:45 +08:00
|
|
|
'icao' => $faker->unique()->text(5),
|
2017-12-13 11:50:55 +08:00
|
|
|
'name' => $faker->unique()->text(50),
|
|
|
|
'registration' => $faker->unique()->text(10),
|
2018-02-13 10:58:23 +08:00
|
|
|
'hex_code' => \App\Support\ICAO::createHexCode(),
|
2018-02-24 06:37:10 +08:00
|
|
|
'status' => \App\Models\Enums\AircraftStatus::ACTIVE,
|
|
|
|
'state' => \App\Models\Enums\AircraftState::PARKED,
|
2017-12-13 11:50:55 +08:00
|
|
|
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
|
|
|
'updated_at' => function (array $pirep) {
|
|
|
|
return $pirep['created_at'];
|
|
|
|
},
|
|
|
|
];
|
|
|
|
});
|