diff --git a/app/Database/factories/AircraftFactory.php b/app/Database/factories/AircraftFactory.php index bcf501aa..6ef50057 100644 --- a/app/Database/factories/AircraftFactory.php +++ b/app/Database/factories/AircraftFactory.php @@ -14,7 +14,6 @@ $factory->define(App\Models\Aircraft::class, function (Faker $faker) { 'icao' => $faker->unique()->text(5), 'name' => $faker->unique()->text(50), 'registration' => $faker->unique()->text(10), - 'tail_number' => $faker->unique()->text(10), 'active' => true, 'created_at' => $faker->dateTimeBetween('-1 week', 'now'), 'updated_at' => function (array $pirep) { 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 39f8c471..c7eb26c5 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 @@ -15,10 +15,9 @@ class CreateAircraftsTable extends Migration $table->string('icao', 4)->nullable(); $table->string('airport_id', 5)->nullable(); $table->timestamp('landing_time')->nullable(); - $table->string('hex_code', 10)->nullable(); $table->string('name', 50); $table->string('registration', 10)->nullable(); - $table->string('tail_number', 10)->nullable(); + $table->string('hex_code', 10)->nullable(); $table->unsignedDecimal('zfw', 12)->nullable()->default(0); $table->unsignedBigInteger('flight_time')->nullable()->default(0); $table->boolean('active')->default(true); diff --git a/app/Database/seeds/sample.yml b/app/Database/seeds/sample.yml index 5601aff0..5071245b 100644 --- a/app/Database/seeds/sample.yml +++ b/app/Database/seeds/sample.yml @@ -4,6 +4,7 @@ airlines: icao: VMS iata: VM name: phpvms airlines + country: us active: 1 created_at: now updated_at: now @@ -183,18 +184,15 @@ aircraft: - id: 1 subfleet_id: 1 name: Boeing 747-400 - registration: NC17 - tail_number: 17 + registration: 001Z - id: 2 subfleet_id: 2 name: Boeing 777-200 - registration: NC20 - tail_number: 20 + registration: C202 - id: 3 subfleet_id: 1 name: Boeing 747-412 - registration: NS233 - tail_number: 1233 + registration: S2333 fares: - id: 1 diff --git a/app/Models/Aircraft.php b/app/Models/Aircraft.php index c5fc999d..3ab0eb3a 100644 --- a/app/Models/Aircraft.php +++ b/app/Models/Aircraft.php @@ -12,7 +12,6 @@ class Aircraft extends BaseModel 'name', 'icao', 'registration', - 'tail_number', 'zfw', 'active', ]; diff --git a/resources/views/admin/aircraft/fields.blade.php b/resources/views/admin/aircraft/fields.blade.php index 075881d7..cafc24e9 100644 --- a/resources/views/admin/aircraft/fields.blade.php +++ b/resources/views/admin/aircraft/fields.blade.php @@ -1,55 +1,47 @@
{{ $errors->first('name') }}
-{{ $errors->first('subfleet_id') }}
{{ $errors->first('name') }}
+{{ $errors->first('icao') }}
{{ $errors->first('registration') }}
-{{ $errors->first('tail_number') }}
-{{ $errors->first('zfw') }}
Enter the registration without the country prefix
+ {!! Form::text('registration', null, ['class' => 'form-control']) !!} +{{ $errors->first('registration') }}
+{!! $aircraft->registration !!}/{!! $aircraft->tail_number !!}
{!! $aircraft->registration !!}