diff --git a/Makefile b/Makefile index 629e7bb0..b4fb0bfc 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ install: db reset: @rm database/testing.sqlite @php artisan optimize + @php artisan route:clear @php artisan config:clear @sqlite3 database/testing.sqlite "" @php artisan migrate:refresh --seed diff --git a/app/Models/Aircraft.php b/app/Models/Aircraft.php index 0f2983b2..0a96d77f 100644 --- a/app/Models/Aircraft.php +++ b/app/Models/Aircraft.php @@ -24,8 +24,8 @@ class Aircraft extends Model 'aircraft_class_id', 'icao', 'name', - 'full_name', 'registration', + 'tail_number', 'active', ]; @@ -38,7 +38,6 @@ class Aircraft extends Model = [ 'icao' => 'string', 'name' => 'string', - 'full_name' => 'string', 'registration' => 'string', 'active' => 'boolean', ]; @@ -50,11 +49,9 @@ class Aircraft extends Model */ public static $rules = [ - 'icao' => 'required|max:4', + 'icao' => 'required|max:5', 'name' => 'required', - 'full_name' => 'required', - 'registration' => 'required', - 'active' => 'default:1', + 'active' => '', ]; /** diff --git a/app/Models/Fare.php b/app/Models/Fare.php index 2526887f..54685c69 100644 --- a/app/Models/Fare.php +++ b/app/Models/Fare.php @@ -53,7 +53,6 @@ class Fare extends Model = [ 'code' => 'required', 'name' => 'required', - 'cost' => 'default:0.0', ]; public function aircraft() { diff --git a/composer.json b/composer.json index 0f1551c1..074a2475 100755 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~5.0", + "phpunit/phpunit": "~5.7", "symfony/css-selector": "3.1.*", "symfony/dom-crawler": "3.1.*" }, diff --git a/composer.lock b/composer.lock index a566ef46..fe0b73f8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "d6ded0be19cfd6b1fb37f7eeb6baadb4", + "content-hash": "e5d6a4a09e901eae8c895fe8c97979cc", "packages": [ { "name": "barryvdh/laravel-ide-helper", diff --git a/database/migrations/2017_06_09_010621_create_aircrafts_table.php b/database/migrations/2017_06_09_010621_create_aircrafts_table.php index 3825d777..d16dee6d 100644 --- a/database/migrations/2017_06_09_010621_create_aircrafts_table.php +++ b/database/migrations/2017_06_09_010621_create_aircrafts_table.php @@ -12,7 +12,6 @@ class CreateAircraftsTable extends Migration $table->integer('aircraft_class_id')->unsigned()->nullable(); $table->string('icao'); $table->string('name'); - $table->string('full_name')->nullable(); $table->string('registration')->nullable(); $table->string('tail_number')->nullable(); $table->string('cargo_capacity')->nullable(); diff --git a/resources/views/admin/aircraft/fields.blade.php b/resources/views/admin/aircraft/fields.blade.php index f9ee41f0..c3ebd5d6 100644 --- a/resources/views/admin/aircraft/fields.blade.php +++ b/resources/views/admin/aircraft/fields.blade.php @@ -1,6 +1,6 @@
- {!! Form::label('icao', 'ICAO:') !!} + {!! Form::label('icao', 'ICAO:') !!} (find) {!! Form::text('icao', null, ['class' => 'form-control']) !!}
@@ -10,24 +10,24 @@ {!! Form::text('name', null, ['class' => 'form-control']) !!} - -
- {!! Form::label('full_name', 'Full Name:') !!} - {!! Form::text('full_name', 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('active', 'Active:') !!}
diff --git a/resources/views/admin/aircraft/show_fields.blade.php b/resources/views/admin/aircraft/show_fields.blade.php index e225efa6..7d20053a 100644 --- a/resources/views/admin/aircraft/show_fields.blade.php +++ b/resources/views/admin/aircraft/show_fields.blade.php @@ -1,47 +1,35 @@ - -
- {!! Form::label('id', 'ID:') !!} -

{!! $aircraft->id !!}

-
- -
+
{!! Form::label('icao', 'ICAO:') !!}

{!! $aircraft->icao !!}

-
+
{!! Form::label('name', 'Name:') !!}

{!! $aircraft->name !!}

- -
- {!! Form::label('full_name', 'Full Name:') !!} -

{!! $aircraft->full_name !!}

-
- -
+
{!! Form::label('registration', 'Registration:') !!}

{!! $aircraft->registration !!}

-
+
{!! Form::label('active', 'Active:') !!}

{!! $aircraft->active !!}

-
+
{!! Form::label('created_at', 'Created At:') !!}

{!! $aircraft->created_at !!}

-
+
{!! Form::label('updated_at', 'Updated At:') !!}

{!! $aircraft->updated_at !!}

diff --git a/resources/views/admin/aircraft/table.blade.php b/resources/views/admin/aircraft/table.blade.php index fb22e2f9..eb72cfda 100644 --- a/resources/views/admin/aircraft/table.blade.php +++ b/resources/views/admin/aircraft/table.blade.php @@ -9,7 +9,7 @@ @foreach($aircraft as $ac) - {!! $ac->icao !!} + {!! $ac->icao !!} {!! $ac->name !!} {!! $ac->registration !!} {!! $ac->active !!} diff --git a/resources/views/admin/app.blade.php b/resources/views/admin/app.blade.php index d2c7073d..dc387efb 100644 --- a/resources/views/admin/app.blade.php +++ b/resources/views/admin/app.blade.php @@ -2,7 +2,7 @@ - phpVMS Admin + phpvms4 admin @@ -17,7 +17,7 @@ @yield('css') - + @if (!Auth::guest())
@@ -37,6 +37,40 @@ diff --git a/resources/views/admin/menu.blade.php b/resources/views/admin/menu.blade.php index 08863621..1c7ece51 100644 --- a/resources/views/admin/menu.blade.php +++ b/resources/views/admin/menu.blade.php @@ -1,2 +1,17 @@ -
  • airlines
  • -
  • aircraft
  • +
  • + dashboard +
  • + +
  • operations
  • +
  • + pireps + 3 + +
  • +
  • fleet
  • +
  • fares
  • + +
  • config
  • +
  • airlines
  • +
  • airports
  • +
  • aircraft classes
  • diff --git a/routes/web.php b/routes/web.php index 96cdc54b..a012e38d 100755 --- a/routes/web.php +++ b/routes/web.php @@ -1,44 +1,36 @@ 'Frontend', + 'as' => 'frontend.', 'middleware' => ['role:admin|user'], ], function () { Route::resource('dashboard', 'DashboardController'); }); +Auth::routes(); + /** * Admin Routes */ Route::group([ 'namespace' => 'Admin', - 'middleware' => ['role:admin'], 'prefix' => 'admin', + 'as' => 'admin.', + 'middleware' => ['role:admin'], ], function () { - Route::get('', ['uses' => 'DashboardController@index']); - Route::get('/', ['uses' => 'DashboardController@index']); - Route::resource('airports', 'AirportController'); Route::resource('airlines', 'AirlinesController'); Route::resource('aircraft', 'AircraftController'); Route::resource('aircraftclasses', 'AircraftClassController'); Route::resource('fares', 'FareController'); + + Route::get('', ['uses' => 'DashboardController@index']); + Route::get('/', ['uses' => 'DashboardController@index']); + Route::get('/dashboard', ['uses' => 'DashboardController@index','name' => 'dashboard']); });