Add importers in console and admin for flights/aircraft/subfleets and airport #194

This commit is contained in:
Nabeel Shahzad
2018-03-20 19:17:11 -05:00
parent 782121829a
commit b9beb6c804
41 changed files with 1270 additions and 225 deletions

View File

@@ -5,8 +5,8 @@ use Faker\Generator as Faker;
$factory->define(App\Models\Fare::class, function (Faker $faker) {
return [
'id' => null,
'code' => $faker->text(5),
'name' => $faker->text(20),
'code' => $faker->unique()->text(50),
'name' => $faker->text(50),
'price' => $faker->randomFloat(2, 100, 1000),
'cost' => function (array $fare) {
return round($fare['price'] / 2);

View File

@@ -14,7 +14,7 @@ class CreateFaresTable extends Migration
{
Schema::create('fares', function (Blueprint $table) {
$table->increments('id');
$table->string('code', 50);
$table->string('code', 50)->unique();
$table->string('name', 50);
$table->unsignedDecimal('price')->nullable()->default(0.00);
$table->unsignedDecimal('cost')->nullable()->default(0.00);

View File

@@ -13,8 +13,8 @@ class CreateSubfleetTables extends Migration
Schema::create('subfleets', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('airline_id')->nullable();
$table->string('type', 50)->unique();
$table->string('name', 50);
$table->string('type', 50);
$table->unsignedTinyInteger('fuel_type')->nullable();
$table->unsignedDecimal('ground_handling_multiplier')->nullable()->default(100);
$table->unsignedDecimal('cargo_capacity')->nullable();