2017-12-14 01:29:14 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Faker\Generator as Faker;
|
|
|
|
|
|
|
|
$factory->define(App\Models\Fare::class, function (Faker $faker) {
|
|
|
|
return [
|
2018-03-20 09:50:40 +08:00
|
|
|
'id' => null,
|
2018-03-21 08:17:11 +08:00
|
|
|
'code' => $faker->unique()->text(50),
|
|
|
|
'name' => $faker->text(50),
|
2018-03-20 09:50:40 +08:00
|
|
|
'price' => $faker->randomFloat(2, 100, 1000),
|
|
|
|
'cost' => function (array $fare) {
|
2018-03-02 06:20:13 +08:00
|
|
|
return round($fare['price'] / 2);
|
|
|
|
},
|
2017-12-14 01:29:14 +08:00
|
|
|
'capacity' => $faker->randomFloat(0, 20, 500),
|
|
|
|
];
|
|
|
|
});
|