From 6498ba1d16c9c9bfde904b30a417e8327d8b2b2c Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 30 Jan 2018 10:04:50 -0600 Subject: [PATCH] add zfw field to aircraft --- .../2017_06_09_010621_create_aircrafts_table.php | 1 + app/Models/Aircraft.php | 4 +++- resources/views/admin/aircraft/fields.blade.php | 11 ++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Database/migrations/2017_06_09_010621_create_aircrafts_table.php b/app/Database/migrations/2017_06_09_010621_create_aircrafts_table.php index a802959a..39f8c471 100644 --- a/app/Database/migrations/2017_06_09_010621_create_aircrafts_table.php +++ b/app/Database/migrations/2017_06_09_010621_create_aircrafts_table.php @@ -19,6 +19,7 @@ class CreateAircraftsTable extends Migration $table->string('name', 50); $table->string('registration', 10)->nullable(); $table->string('tail_number', 10)->nullable(); + $table->unsignedDecimal('zfw', 12)->nullable()->default(0); $table->unsignedBigInteger('flight_time')->nullable()->default(0); $table->boolean('active')->default(true); $table->unsignedTinyInteger('state')->default(AircraftState::PARKED); diff --git a/app/Models/Aircraft.php b/app/Models/Aircraft.php index 2b2a1b0c..c5fc999d 100644 --- a/app/Models/Aircraft.php +++ b/app/Models/Aircraft.php @@ -13,6 +13,7 @@ class Aircraft extends BaseModel 'icao', 'registration', 'tail_number', + 'zfw', 'active', ]; @@ -22,7 +23,8 @@ class Aircraft extends BaseModel * @var array */ protected $casts = [ - 'active' => 'boolean', + 'zfw' => 'float', + 'active' => 'boolean', ]; /** diff --git a/resources/views/admin/aircraft/fields.blade.php b/resources/views/admin/aircraft/fields.blade.php index 373f59b2..3f23c31e 100644 --- a/resources/views/admin/aircraft/fields.blade.php +++ b/resources/views/admin/aircraft/fields.blade.php @@ -12,22 +12,27 @@
-
+
{!! Form::label('icao', 'ICAO:') !!} {!! Form::text('icao', null, ['class' => 'form-control']) !!}
-
+
{!! Form::label('registration', 'Registration:') !!} {!! Form::text('registration', null, ['class' => 'form-control']) !!}
-
+
{!! Form::label('tail_number', 'Tail Number:') !!} {!! Form::text('tail_number', null, ['class' => 'form-control']) !!}
+ +
+ {!! Form::label('zfw', 'Zero Fuel Weight:') !!} + {!! Form::text('zfw', null, ['class' => 'form-control']) !!} +