From d6dbb3f1e7853c2da710cce95769b7361df7e211 Mon Sep 17 00:00:00 2001
From: Gogs
Date: Thu, 3 Jun 2021 19:56:23 +0200
Subject: [PATCH] Format Manufacturer Controller refactor
---
README.md | 9 +
...facturers.php => AircraftManufacturer.php} | 2 +-
controllers/AircraftTypeGroups.php | 16 +-
controllers/Aircrafts.php | 16 +-
.../aircraftmanufacturer/_list_toolbar.htm | 23 ++
.../aircraftmanufacturer/config_form.yaml | 10 +
.../config_list.yaml | 4 +-
controllers/aircraftmanufacturer/create.htm | 54 ++++
.../index.htm | 0
controllers/aircraftmanufacturer/preview.htm | 23 ++
controllers/aircraftmanufacturer/update.htm | 62 ++++
.../aircraftmanufacturers/_list_toolbar.htm | 18 --
.../aircraftmanufacturers/config_form.yaml | 10 -
controllers/aircraftmanufacturers/create.htm | 46 ---
controllers/aircraftmanufacturers/preview.htm | 22 --
controllers/aircraftmanufacturers/update.htm | 54 ----
controllers/aircrafts/_list_toolbar.htm | 31 +-
controllers/aircrafts/config_form.yaml | 8 +-
controllers/aircrafts/config_list.yaml | 6 +-
controllers/aircrafts/create.htm | 78 ++---
controllers/aircrafts/preview.htm | 22 +-
controllers/aircrafts/update.htm | 94 +++---
.../aircrafttypegroups/_list_toolbar.htm | 31 +-
.../aircrafttypegroups/config_form.yaml | 8 +-
.../aircrafttypegroups/config_list.yaml | 6 +-
controllers/aircrafttypegroups/create.htm | 80 ++---
controllers/aircrafttypegroups/preview.htm | 25 +-
controllers/aircrafttypegroups/update.htm | 96 +++---
controllers/aircrafttypes/_list_toolbar.htm | 31 +-
controllers/aircrafttypes/config_form.yaml | 8 +-
controllers/aircrafttypes/config_list.yaml | 6 +-
controllers/aircrafttypes/create.htm | 80 ++---
controllers/aircrafttypes/preview.htm | 22 +-
controllers/aircrafttypes/update.htm | 96 +++---
lang/en/lang.php | 36 ++-
models/AircraftManufacturer.php | 6 +-
models/aircraftmanufacturer/columns.yaml | 34 +--
models/aircraftmanufacturer/fields.yaml | 32 +-
models/aircrafttype/columns.yaml | 138 ++++-----
models/aircrafttype/fields.yaml | 288 +++++++++---------
models/aircrafttypegroup/columns.yaml | 12 +-
models/aircrafttypegroup/fields.yaml | 8 +-
package.json | 2 +-
plugin.yaml | 50 +--
...eate_aircraft_type_aircraft_type_group.php | 62 ++--
...lder_table_create_aircraft_type_groups.php | 44 +--
updates/builder_table_create_aircrafts.php | 128 ++++----
47 files changed, 1011 insertions(+), 926 deletions(-)
rename controllers/{AircraftManufacturers.php => AircraftManufacturer.php} (88%)
create mode 100644 controllers/aircraftmanufacturer/_list_toolbar.htm
create mode 100644 controllers/aircraftmanufacturer/config_form.yaml
rename controllers/{aircraftmanufacturers => aircraftmanufacturer}/config_list.yaml (77%)
create mode 100644 controllers/aircraftmanufacturer/create.htm
rename controllers/{aircraftmanufacturers => aircraftmanufacturer}/index.htm (100%)
create mode 100644 controllers/aircraftmanufacturer/preview.htm
create mode 100644 controllers/aircraftmanufacturer/update.htm
delete mode 100644 controllers/aircraftmanufacturers/_list_toolbar.htm
delete mode 100644 controllers/aircraftmanufacturers/config_form.yaml
delete mode 100644 controllers/aircraftmanufacturers/create.htm
delete mode 100644 controllers/aircraftmanufacturers/preview.htm
delete mode 100644 controllers/aircraftmanufacturers/update.htm
diff --git a/README.md b/README.md
index cf179f9..a69f732 100644
--- a/README.md
+++ b/README.md
@@ -13,8 +13,13 @@
## Aircrafts
- BelongsTo AircraftTypes
+- BelongsToMany AircraftTypeGroups
- **TODO** BelongsTo Airports (External DB, Multiple)
+## AircraftTypeGroups
+
+- BelongsToMany AircraftTypes
+
---
# Todo
@@ -30,3 +35,7 @@
## Aircrafts
- Form Localization
+
+## Aircraft Type Groups
+
+- Form Localization
diff --git a/controllers/AircraftManufacturers.php b/controllers/AircraftManufacturer.php
similarity index 88%
rename from controllers/AircraftManufacturers.php
rename to controllers/AircraftManufacturer.php
index cb0d540..0db4437 100644
--- a/controllers/AircraftManufacturers.php
+++ b/controllers/AircraftManufacturer.php
@@ -3,7 +3,7 @@
use Backend\Classes\Controller;
use BackendMenu;
-class AircraftManufacturers extends Controller
+class AircraftManufacturer extends Controller
{
public $implement = ['Backend\Behaviors\ListController', 'Backend\Behaviors\FormController'];
diff --git a/controllers/AircraftTypeGroups.php b/controllers/AircraftTypeGroups.php
index d35aba7..e8818f8 100644
--- a/controllers/AircraftTypeGroups.php
+++ b/controllers/AircraftTypeGroups.php
@@ -5,13 +5,13 @@ use BackendMenu;
class AircraftTypeGroups extends Controller
{
- public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
-
- public $listConfig = 'config_list.yaml';
- public $formConfig = 'config_form.yaml';
+ public $implement = ['Backend\Behaviors\ListController', 'Backend\Behaviors\FormController'];
- public function __construct()
- {
- parent::__construct();
- }
+ public $listConfig = 'config_list.yaml';
+ public $formConfig = 'config_form.yaml';
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
}
diff --git a/controllers/Aircrafts.php b/controllers/Aircrafts.php
index 0e6de8a..24e64f5 100644
--- a/controllers/Aircrafts.php
+++ b/controllers/Aircrafts.php
@@ -5,13 +5,13 @@ use BackendMenu;
class Aircrafts extends Controller
{
- public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
-
- public $listConfig = 'config_list.yaml';
- public $formConfig = 'config_form.yaml';
+ public $implement = ['Backend\Behaviors\ListController', 'Backend\Behaviors\FormController'];
- public function __construct()
- {
- parent::__construct();
- }
+ public $listConfig = 'config_list.yaml';
+ public $formConfig = 'config_form.yaml';
+
+ public function __construct()
+ {
+ parent::__construct();
+ }
}
diff --git a/controllers/aircraftmanufacturer/_list_toolbar.htm b/controllers/aircraftmanufacturer/_list_toolbar.htm
new file mode 100644
index 0000000..3f09077
--- /dev/null
+++ b/controllers/aircraftmanufacturer/_list_toolbar.htm
@@ -0,0 +1,23 @@
+
diff --git a/controllers/aircraftmanufacturer/config_form.yaml b/controllers/aircraftmanufacturer/config_form.yaml
new file mode 100644
index 0000000..cb19304
--- /dev/null
+++ b/controllers/aircraftmanufacturer/config_form.yaml
@@ -0,0 +1,10 @@
+name: Aircraft Manufacturer
+form: $/germanairlinesva/fleet/models/aircraftmanufacturer/fields.yaml
+modelClass: GermanAirlinesVa\Fleet\Models\AircraftManufacturer
+defaultRedirect: germanairlinesva/fleet/aircraftmanufacturer
+create:
+ redirect: 'germanairlinesva/fleet/aircraftmanufacturer/update/:id'
+ redirectClose: germanairlinesva/fleet/aircraftmanufacturer
+update:
+ redirect: germanairlinesva/fleet/aircraftmanufacturer
+ redirectClose: germanairlinesva/fleet/aircraftmanufacturer
diff --git a/controllers/aircraftmanufacturers/config_list.yaml b/controllers/aircraftmanufacturer/config_list.yaml
similarity index 77%
rename from controllers/aircraftmanufacturers/config_list.yaml
rename to controllers/aircraftmanufacturer/config_list.yaml
index 0ca23b3..45a6f08 100644
--- a/controllers/aircraftmanufacturers/config_list.yaml
+++ b/controllers/aircraftmanufacturer/config_list.yaml
@@ -1,6 +1,6 @@
list: $/germanairlinesva/fleet/models/aircraftmanufacturer/columns.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftManufacturer
-title: AircraftManufacturers
+title: Aircraft Manufacturers
noRecordsMessage: 'backend::lang.list.no_records'
showSetup: true
showCheckboxes: true
@@ -9,4 +9,4 @@ toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
-recordUrl: 'germanairlinesva/fleet/aircraftmanufacturers/update/:id'
+recordUrl: 'germanairlinesva/fleet/aircraftmanufacturer/update/:id'
diff --git a/controllers/aircraftmanufacturer/create.htm b/controllers/aircraftmanufacturer/create.htm
new file mode 100644
index 0000000..86ad368
--- /dev/null
+++ b/controllers/aircraftmanufacturer/create.htm
@@ -0,0 +1,54 @@
+
+
+
+
+fatalError): ?>
+
+= Form::open(['class' =>
+'layout']) ?>
+
+= $this->formRender() ?>
+
+
+
+= Form::close() ?>
+
+
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircraftmanufacturers/index.htm b/controllers/aircraftmanufacturer/index.htm
similarity index 100%
rename from controllers/aircraftmanufacturers/index.htm
rename to controllers/aircraftmanufacturer/index.htm
diff --git a/controllers/aircraftmanufacturer/preview.htm b/controllers/aircraftmanufacturer/preview.htm
new file mode 100644
index 0000000..d939756
--- /dev/null
+++ b/controllers/aircraftmanufacturer/preview.htm
@@ -0,0 +1,23 @@
+
+
+
+
+fatalError): ?>
+
+= $this->formRenderPreview() ?>
+
+
+= e($this->fatalError) ?>
+
+
+
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircraftmanufacturer/update.htm b/controllers/aircraftmanufacturer/update.htm
new file mode 100644
index 0000000..6f7d582
--- /dev/null
+++ b/controllers/aircraftmanufacturer/update.htm
@@ -0,0 +1,62 @@
+
+
+
+
+fatalError): ?>
+
+= Form::open(['class' =>
+'layout']) ?>
+
+= $this->formRender() ?>
+
+
+= Form::close() ?>
+
+
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircraftmanufacturers/_list_toolbar.htm b/controllers/aircraftmanufacturers/_list_toolbar.htm
deleted file mode 100644
index f71061a..0000000
--- a/controllers/aircraftmanufacturers/_list_toolbar.htm
+++ /dev/null
@@ -1,18 +0,0 @@
-
diff --git a/controllers/aircraftmanufacturers/config_form.yaml b/controllers/aircraftmanufacturers/config_form.yaml
deleted file mode 100644
index 2a19b6b..0000000
--- a/controllers/aircraftmanufacturers/config_form.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: AircraftManufacturers
-form: $/germanairlinesva/fleet/models/aircraftmanufacturer/fields.yaml
-modelClass: GermanAirlinesVa\Fleet\Models\AircraftManufacturer
-defaultRedirect: germanairlinesva/fleet/aircraftmanufacturers
-create:
- redirect: 'germanairlinesva/fleet/aircraftmanufacturers/update/:id'
- redirectClose: germanairlinesva/fleet/aircraftmanufacturers
-update:
- redirect: germanairlinesva/fleet/aircraftmanufacturers
- redirectClose: germanairlinesva/fleet/aircraftmanufacturers
diff --git a/controllers/aircraftmanufacturers/create.htm b/controllers/aircraftmanufacturers/create.htm
deleted file mode 100644
index 98cff61..0000000
--- a/controllers/aircraftmanufacturers/create.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-fatalError): ?>
-
- = Form::open(['class' => 'layout']) ?>
-
-
- = $this->formRender() ?>
-
-
-
-
- = Form::close() ?>
-
-
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
diff --git a/controllers/aircraftmanufacturers/preview.htm b/controllers/aircraftmanufacturers/preview.htm
deleted file mode 100644
index 972530f..0000000
--- a/controllers/aircraftmanufacturers/preview.htm
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-fatalError): ?>
-
-
- = $this->formRenderPreview() ?>
-
-
-
- = e($this->fatalError) ?>
-
-
-
-
- = e(trans('backend::lang.form.return_to_list')) ?>
-
-
\ No newline at end of file
diff --git a/controllers/aircraftmanufacturers/update.htm b/controllers/aircraftmanufacturers/update.htm
deleted file mode 100644
index d550e64..0000000
--- a/controllers/aircraftmanufacturers/update.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-fatalError): ?>
-
- = Form::open(['class' => 'layout']) ?>
-
-
- = $this->formRender() ?>
-
-
-
- = Form::close() ?>
-
-
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
diff --git a/controllers/aircrafts/_list_toolbar.htm b/controllers/aircrafts/_list_toolbar.htm
index ef39e0f..57e55cb 100644
--- a/controllers/aircrafts/_list_toolbar.htm
+++ b/controllers/aircrafts/_list_toolbar.htm
@@ -1,18 +1,21 @@
-
= e(trans('backend::lang.form.create')) ?>
-
" class="btn btn-primary oc-icon-plus"
+ >= e(trans('backend::lang.form.create')) ?>
+
- = e(trans('backend::lang.list.delete_selected')) ?>
-
+ data-request="onDelete"
+ data-request-confirm="= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
+ data-trigger-action="enable"
+ data-trigger=".control-list input[type=checkbox]"
+ data-trigger-condition="checked"
+ data-request-success="$(this).prop('disabled', true)"
+ data-stripe-load-indicator
+ >
+ = e(trans('backend::lang.list.delete_selected')) ?>
+
diff --git a/controllers/aircrafts/config_form.yaml b/controllers/aircrafts/config_form.yaml
index 39a8639..5d906f2 100644
--- a/controllers/aircrafts/config_form.yaml
+++ b/controllers/aircrafts/config_form.yaml
@@ -3,8 +3,8 @@ form: $/germanairlinesva/fleet/models/aircraft/fields.yaml
modelClass: GermanAirlinesVa\Fleet\Models\Aircraft
defaultRedirect: germanairlinesva/fleet/aircrafts
create:
- redirect: 'germanairlinesva/fleet/aircrafts/update/:id'
- redirectClose: germanairlinesva/fleet/aircrafts
+ redirect: 'germanairlinesva/fleet/aircrafts/update/:id'
+ redirectClose: germanairlinesva/fleet/aircrafts
update:
- redirect: germanairlinesva/fleet/aircrafts
- redirectClose: germanairlinesva/fleet/aircrafts
+ redirect: germanairlinesva/fleet/aircrafts
+ redirectClose: germanairlinesva/fleet/aircrafts
diff --git a/controllers/aircrafts/config_list.yaml b/controllers/aircrafts/config_list.yaml
index dd2ef2b..1b34bc6 100644
--- a/controllers/aircrafts/config_list.yaml
+++ b/controllers/aircrafts/config_list.yaml
@@ -6,7 +6,7 @@ showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
- buttons: list_toolbar
- search:
- prompt: 'backend::lang.list.search_prompt'
+ buttons: list_toolbar
+ search:
+ prompt: 'backend::lang.list.search_prompt'
recordUrl: 'germanairlinesva/fleet/aircrafts/update/:id'
diff --git a/controllers/aircrafts/create.htm b/controllers/aircrafts/create.htm
index 41790dd..cb5b932 100644
--- a/controllers/aircrafts/create.htm
+++ b/controllers/aircrafts/create.htm
@@ -1,46 +1,52 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+
- = Form::close() ?>
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafts/preview.htm b/controllers/aircrafts/preview.htm
index e6c1809..dcadc34 100644
--- a/controllers/aircrafts/preview.htm
+++ b/controllers/aircrafts/preview.htm
@@ -1,22 +1,20 @@
-
+
fatalError): ?>
-
- = $this->formRenderPreview() ?>
-
+= $this->formRenderPreview() ?>
- = e($this->fatalError) ?>
+= e($this->fatalError) ?>
-
- = e(trans('backend::lang.form.return_to_list')) ?>
-
-
\ No newline at end of file
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafts/update.htm b/controllers/aircrafts/update.htm
index 949d258..5e51cca 100644
--- a/controllers/aircrafts/update.htm
+++ b/controllers/aircrafts/update.htm
@@ -1,54 +1,60 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypegroups/_list_toolbar.htm b/controllers/aircrafttypegroups/_list_toolbar.htm
index e43c52b..5fb5cc0 100644
--- a/controllers/aircrafttypegroups/_list_toolbar.htm
+++ b/controllers/aircrafttypegroups/_list_toolbar.htm
@@ -1,18 +1,21 @@
-
= e(trans('backend::lang.form.create')) ?>
-
" class="btn btn-primary oc-icon-plus"
+ >= e(trans('backend::lang.form.create')) ?>
+
- = e(trans('backend::lang.list.delete_selected')) ?>
-
+ data-request="onDelete"
+ data-request-confirm="= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
+ data-trigger-action="enable"
+ data-trigger=".control-list input[type=checkbox]"
+ data-trigger-condition="checked"
+ data-request-success="$(this).prop('disabled', true)"
+ data-stripe-load-indicator
+ >
+ = e(trans('backend::lang.list.delete_selected')) ?>
+
diff --git a/controllers/aircrafttypegroups/config_form.yaml b/controllers/aircrafttypegroups/config_form.yaml
index f8c6829..4eaca4c 100644
--- a/controllers/aircrafttypegroups/config_form.yaml
+++ b/controllers/aircrafttypegroups/config_form.yaml
@@ -3,8 +3,8 @@ form: $/germanairlinesva/fleet/models/aircrafttypegroup/fields.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftTypeGroup
defaultRedirect: germanairlinesva/fleet/aircrafttypegroups
create:
- redirect: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
- redirectClose: germanairlinesva/fleet/aircrafttypegroups
+ redirect: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
+ redirectClose: germanairlinesva/fleet/aircrafttypegroups
update:
- redirect: germanairlinesva/fleet/aircrafttypegroups
- redirectClose: germanairlinesva/fleet/aircrafttypegroups
+ redirect: germanairlinesva/fleet/aircrafttypegroups
+ redirectClose: germanairlinesva/fleet/aircrafttypegroups
diff --git a/controllers/aircrafttypegroups/config_list.yaml b/controllers/aircrafttypegroups/config_list.yaml
index 0cca711..436c9dc 100644
--- a/controllers/aircrafttypegroups/config_list.yaml
+++ b/controllers/aircrafttypegroups/config_list.yaml
@@ -6,7 +6,7 @@ showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
- buttons: list_toolbar
- search:
- prompt: 'backend::lang.list.search_prompt'
+ buttons: list_toolbar
+ search:
+ prompt: 'backend::lang.list.search_prompt'
recordUrl: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
diff --git a/controllers/aircrafttypegroups/create.htm b/controllers/aircrafttypegroups/create.htm
index 34eca1a..b4b029c 100644
--- a/controllers/aircrafttypegroups/create.htm
+++ b/controllers/aircrafttypegroups/create.htm
@@ -1,46 +1,54 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+
- = Form::close() ?>
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypegroups/preview.htm b/controllers/aircrafttypegroups/preview.htm
index c8fcf6b..ded0d8f 100644
--- a/controllers/aircrafttypegroups/preview.htm
+++ b/controllers/aircrafttypegroups/preview.htm
@@ -1,22 +1,23 @@
-
+
fatalError): ?>
-
- = $this->formRenderPreview() ?>
-
+= $this->formRenderPreview() ?>
- = e($this->fatalError) ?>
+= e($this->fatalError) ?>
-
- = e(trans('backend::lang.form.return_to_list')) ?>
-
-
\ No newline at end of file
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypegroups/update.htm b/controllers/aircrafttypegroups/update.htm
index 5d3abd8..2c7eb86 100644
--- a/controllers/aircrafttypegroups/update.htm
+++ b/controllers/aircrafttypegroups/update.htm
@@ -1,54 +1,62 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypes/_list_toolbar.htm b/controllers/aircrafttypes/_list_toolbar.htm
index 550ad6e..9cc14c1 100644
--- a/controllers/aircrafttypes/_list_toolbar.htm
+++ b/controllers/aircrafttypes/_list_toolbar.htm
@@ -1,18 +1,21 @@
-
= e(trans('backend::lang.form.create')) ?>
-
" class="btn btn-primary oc-icon-plus"
+ >= e(trans('backend::lang.form.create')) ?>
+
- = e(trans('backend::lang.list.delete_selected')) ?>
-
+ data-request="onDelete"
+ data-request-confirm="= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
+ data-trigger-action="enable"
+ data-trigger=".control-list input[type=checkbox]"
+ data-trigger-condition="checked"
+ data-request-success="$(this).prop('disabled', true)"
+ data-stripe-load-indicator
+ >
+ = e(trans('backend::lang.list.delete_selected')) ?>
+
diff --git a/controllers/aircrafttypes/config_form.yaml b/controllers/aircrafttypes/config_form.yaml
index a6820d5..d3b4580 100644
--- a/controllers/aircrafttypes/config_form.yaml
+++ b/controllers/aircrafttypes/config_form.yaml
@@ -3,8 +3,8 @@ form: $/germanairlinesva/fleet/models/aircrafttype/fields.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftType
defaultRedirect: germanairlinesva/fleet/aircrafttypes
create:
- redirect: 'germanairlinesva/fleet/aircrafttypes/update/:id'
- redirectClose: germanairlinesva/fleet/aircrafttypes
+ redirect: 'germanairlinesva/fleet/aircrafttypes/update/:id'
+ redirectClose: germanairlinesva/fleet/aircrafttypes
update:
- redirect: germanairlinesva/fleet/aircrafttypes
- redirectClose: germanairlinesva/fleet/aircrafttypes
+ redirect: germanairlinesva/fleet/aircrafttypes
+ redirectClose: germanairlinesva/fleet/aircrafttypes
diff --git a/controllers/aircrafttypes/config_list.yaml b/controllers/aircrafttypes/config_list.yaml
index 8744d30..33eac57 100644
--- a/controllers/aircrafttypes/config_list.yaml
+++ b/controllers/aircrafttypes/config_list.yaml
@@ -6,7 +6,7 @@ showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
- buttons: list_toolbar
- search:
- prompt: 'backend::lang.list.search_prompt'
+ buttons: list_toolbar
+ search:
+ prompt: 'backend::lang.list.search_prompt'
recordUrl: 'germanairlinesva/fleet/aircrafttypes/update/:id'
diff --git a/controllers/aircrafttypes/create.htm b/controllers/aircrafttypes/create.htm
index 1a9bf38..280118b 100644
--- a/controllers/aircrafttypes/create.htm
+++ b/controllers/aircrafttypes/create.htm
@@ -1,46 +1,54 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+
- = Form::close() ?>
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypes/preview.htm b/controllers/aircrafttypes/preview.htm
index 17be2ef..f1b6f10 100644
--- a/controllers/aircrafttypes/preview.htm
+++ b/controllers/aircrafttypes/preview.htm
@@ -1,22 +1,20 @@
-
+
fatalError): ?>
-
- = $this->formRenderPreview() ?>
-
+= $this->formRenderPreview() ?>
- = e($this->fatalError) ?>
+= e($this->fatalError) ?>
-
- = e(trans('backend::lang.form.return_to_list')) ?>
-
-
\ No newline at end of file
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/controllers/aircrafttypes/update.htm b/controllers/aircrafttypes/update.htm
index b28bc62..a3c2ec5 100644
--- a/controllers/aircrafttypes/update.htm
+++ b/controllers/aircrafttypes/update.htm
@@ -1,54 +1,62 @@
-
+
fatalError): ?>
- = Form::open(['class' => 'layout']) ?>
+= Form::open(['class' =>
+'layout']) ?>
-
- = $this->formRender() ?>
-
+= $this->formRender() ?>
-
+= Form::close() ?>
- = e(trans($this->fatalError)) ?>
- = e(trans('backend::lang.form.return_to_list')) ?>
-
\ No newline at end of file
+= e(trans($this->fatalError)) ?>
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
diff --git a/lang/en/lang.php b/lang/en/lang.php
index 9892a97..ea25bbd 100644
--- a/lang/en/lang.php
+++ b/lang/en/lang.php
@@ -1,20 +1,18 @@
[
- 'name' => 'Fleet',
- 'description' => '',
- ],
- 'aircraft' => [
- 'manufacturers' => [
- 'name' => 'Name',
- 'link' => 'Link',
- 'history' => 'History',
- ],
- ],
- 'menu' => [
- 'main' => 'GA Fleet',
- 'manufacturers' => 'Aircraft Manufacturers',
- 'types' => 'Aircraft Types',
- 'aircrafts' => 'Aircrafts',
- 'groups' => 'Aircraft Type Groups',
- ],
-];
\ No newline at end of file
+ 'plugin' => [
+ 'name' => 'Fleet',
+ 'description' => '',
+ ],
+ 'aircraft_manufacturers' => [
+ 'name' => 'Name',
+ 'link' => 'Link',
+ 'history' => 'History',
+ ],
+ 'menu' => [
+ 'main' => 'GA Fleet',
+ 'manufacturers' => 'Aircraft Manufacturers',
+ 'types' => 'Aircraft Types',
+ 'aircrafts' => 'Aircrafts',
+ 'groups' => 'Aircraft Type Groups',
+ ],
+];
diff --git a/models/AircraftManufacturer.php b/models/AircraftManufacturer.php
index 9e3ee86..3e07d67 100644
--- a/models/AircraftManufacturer.php
+++ b/models/AircraftManufacturer.php
@@ -24,7 +24,11 @@ class AircraftManufacturer extends Model
/**
* @var array Validation rules
*/
- public $rules = [];
+ public $rules = [
+ 'name' => 'required',
+ 'link' => 'required',
+ 'history' => 'required',
+ ];
public $hasMany = [
'aircraft_types' => 'GermanAirlinesVa\Fleet\Models\AircraftType',
diff --git a/models/aircraftmanufacturer/columns.yaml b/models/aircraftmanufacturer/columns.yaml
index a4d3217..cff6d24 100644
--- a/models/aircraftmanufacturer/columns.yaml
+++ b/models/aircraftmanufacturer/columns.yaml
@@ -1,18 +1,18 @@
columns:
- id:
- label: id
- type: text
- name:
- label: name
- type: text
- searchable: true
- sortable: true
- history:
- label: history
- type: text
- searchable: false
- link:
- label: link
- type: text
- searchable: false
- sortable: false
+ id:
+ label: id
+ type: text
+ name:
+ label: name
+ type: text
+ searchable: true
+ sortable: true
+ history:
+ label: history
+ type: text
+ searchable: false
+ link:
+ label: link
+ type: text
+ searchable: false
+ sortable: false
diff --git a/models/aircraftmanufacturer/fields.yaml b/models/aircraftmanufacturer/fields.yaml
index 690eb48..5f26bca 100644
--- a/models/aircraftmanufacturer/fields.yaml
+++ b/models/aircraftmanufacturer/fields.yaml
@@ -1,17 +1,17 @@
fields:
- name:
- label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.name'
- span: auto
- required: 1
- type: text
- link:
- label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.link'
- span: auto
- required: 1
- type: text
- history:
- label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.history'
- size: large
- span: auto
- required: 1
- type: richeditor
+ name:
+ label: 'germanairlinesva.fleet::lang.aircraft_manufacturers.name'
+ span: auto
+ required: 1
+ type: text
+ link:
+ label: 'germanairlinesva.fleet::lang.aircraft_manufacturers.link'
+ span: auto
+ required: 1
+ type: text
+ history:
+ label: 'germanairlinesva.fleet::lang.aircraft_manufacturers.history'
+ size: large
+ span: auto
+ required: 1
+ type: richeditor
diff --git a/models/aircrafttype/columns.yaml b/models/aircrafttype/columns.yaml
index 19eeb2b..b3451b5 100644
--- a/models/aircrafttype/columns.yaml
+++ b/models/aircrafttype/columns.yaml
@@ -1,70 +1,70 @@
columns:
- id:
- label: id
- type: text
- aircraft_manufacturers_id:
- label: aircraft_manufacturers_id
- type: number
- typerating_id:
- label: typerating_id
- type: number
- only_charter:
- label: only_charter
- type: text
- type:
- label: type
- type: text
- description:
- label: description
- type: text
- simbrief_type:
- label: simbrief_type
- type: text
- wingspan:
- label: wingspan
- type: text
- length:
- label: length
- type: text
- cruise_speed:
- label: cruise_speed
- type: text
- range:
- label: range
- type: text
- engines:
- label: engines
- type: text
- dom:
- label: dom
- type: number
- mpld:
- label: mpld
- type: number
- mzfm:
- label: mzfm
- type: number
- fuel_capacity:
- label: fuel_capacity
- type: number
- mtom:
- label: mtom
- type: number
- mlam:
- label: mlam
- type: number
- max_fl:
- label: max_fl
- type: number
- capacity_flight_crew:
- label: capacity_flight_crew
- type: number
- capacity_cabin_crew:
- label: capacity_cabin_crew
- type: number
- capacity_passengers:
- label: capacity_passengers
- type: number
- capacity_cargo:
- label: capacity_cargo
- type: number
+ id:
+ label: id
+ type: text
+ aircraft_manufacturers_id:
+ label: aircraft_manufacturers_id
+ type: number
+ typerating_id:
+ label: typerating_id
+ type: number
+ only_charter:
+ label: only_charter
+ type: text
+ type:
+ label: type
+ type: text
+ description:
+ label: description
+ type: text
+ simbrief_type:
+ label: simbrief_type
+ type: text
+ wingspan:
+ label: wingspan
+ type: text
+ length:
+ label: length
+ type: text
+ cruise_speed:
+ label: cruise_speed
+ type: text
+ range:
+ label: range
+ type: text
+ engines:
+ label: engines
+ type: text
+ dom:
+ label: dom
+ type: number
+ mpld:
+ label: mpld
+ type: number
+ mzfm:
+ label: mzfm
+ type: number
+ fuel_capacity:
+ label: fuel_capacity
+ type: number
+ mtom:
+ label: mtom
+ type: number
+ mlam:
+ label: mlam
+ type: number
+ max_fl:
+ label: max_fl
+ type: number
+ capacity_flight_crew:
+ label: capacity_flight_crew
+ type: number
+ capacity_cabin_crew:
+ label: capacity_cabin_crew
+ type: number
+ capacity_passengers:
+ label: capacity_passengers
+ type: number
+ capacity_cargo:
+ label: capacity_cargo
+ type: number
diff --git a/models/aircrafttype/fields.yaml b/models/aircrafttype/fields.yaml
index 38c3c4e..aa22a8b 100644
--- a/models/aircrafttype/fields.yaml
+++ b/models/aircrafttype/fields.yaml
@@ -1,145 +1,145 @@
tabs:
- fields:
- aircraft_manufacturer:
- label: Manufacturer
- nameFrom: name
- descriptionFrom: description
- span: auto
- required: 1
- type: relation
- tab: Operational
- typerating_id:
- label: Typerating
- span: auto
- required: 1
- type: number
- tab: Operational
- only_charter:
- label: 'Charter Only'
- span: auto
- required: 1
- type: switch
- tab: Operational
- type:
- label: Type
- span: auto
- required: 1
- type: text
- tab: Operational
- simbrief_type:
- label: 'SimBrief Type'
- span: auto
- required: 1
- type: text
- tab: Operational
- aircraft_type_groups:
- label: 'Aircraft Type Groups'
- nameFrom: comment
- descriptionFrom: description
- span: auto
- required: 1
- type: relation
- tab: Operational
- dom:
- label: DOM
- span: auto
- required: 1
- type: number
- tab: Weights
- mpld:
- label: 'Max Payload'
- span: auto
- required: 1
- type: number
- tab: Weights
- mzfm:
- label: 'Max ZFM'
- span: auto
- required: 1
- type: number
- tab: Weights
- fuel_capacity:
- label: 'Fuel Capacity'
- span: auto
- required: 1
- type: number
- tab: Weights
- mtom:
- label: 'Max TOM'
- span: auto
- required: 1
- type: number
- tab: Weights
- mlam:
- label: 'Max LAM'
- span: auto
- required: 1
- type: number
- tab: Weights
- description:
- label: Description
- size: large
- span: auto
- required: 1
- type: richeditor
- tab: Informational
- wingspan:
- label: Wingspan
- span: auto
- required: 1
- type: text
- tab: Informational
- length:
- label: Length
- span: auto
- required: 1
- type: text
- tab: Informational
- cruise_speed:
- label: 'Cruise Speed'
- span: auto
- required: 1
- type: text
- tab: Informational
- range:
- label: Range
- span: auto
- required: 1
- type: text
- tab: Informational
- engines:
- label: Engines
- span: auto
- required: 1
- type: text
- tab: Informational
- max_fl:
- label: 'Max FL'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_flight_crew:
- label: 'Flight Crew'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_cabin_crew:
- label: 'Cabin Crew'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_passengers:
- label: Passengers
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_cargo:
- label: Cargo
- span: auto
- required: 1
- type: number
- tab: Informational
+ fields:
+ aircraft_manufacturer:
+ label: Manufacturer
+ nameFrom: name
+ descriptionFrom: description
+ span: auto
+ required: 1
+ type: relation
+ tab: Operational
+ typerating_id:
+ label: Typerating
+ span: auto
+ required: 1
+ type: number
+ tab: Operational
+ only_charter:
+ label: 'Charter Only'
+ span: auto
+ required: 1
+ type: switch
+ tab: Operational
+ type:
+ label: Type
+ span: auto
+ required: 1
+ type: text
+ tab: Operational
+ simbrief_type:
+ label: 'SimBrief Type'
+ span: auto
+ required: 1
+ type: text
+ tab: Operational
+ aircraft_type_groups:
+ label: 'Aircraft Type Groups'
+ nameFrom: comment
+ descriptionFrom: description
+ span: auto
+ required: 1
+ type: relation
+ tab: Operational
+ dom:
+ label: DOM
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mpld:
+ label: 'Max Payload'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mzfm:
+ label: 'Max ZFM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ fuel_capacity:
+ label: 'Fuel Capacity'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mtom:
+ label: 'Max TOM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mlam:
+ label: 'Max LAM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ description:
+ label: Description
+ size: large
+ span: auto
+ required: 1
+ type: richeditor
+ tab: Informational
+ wingspan:
+ label: Wingspan
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ length:
+ label: Length
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ cruise_speed:
+ label: 'Cruise Speed'
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ range:
+ label: Range
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ engines:
+ label: Engines
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ max_fl:
+ label: 'Max FL'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_flight_crew:
+ label: 'Flight Crew'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_cabin_crew:
+ label: 'Cabin Crew'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_passengers:
+ label: Passengers
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_cargo:
+ label: Cargo
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
diff --git a/models/aircrafttypegroup/columns.yaml b/models/aircrafttypegroup/columns.yaml
index bc8fedc..3270e2f 100644
--- a/models/aircrafttypegroup/columns.yaml
+++ b/models/aircrafttypegroup/columns.yaml
@@ -1,7 +1,7 @@
columns:
- id:
- label: id
- type: number
- comment:
- label: comment
- type: text
+ id:
+ label: id
+ type: number
+ comment:
+ label: comment
+ type: text
diff --git a/models/aircrafttypegroup/fields.yaml b/models/aircrafttypegroup/fields.yaml
index e4804c2..abb53a9 100644
--- a/models/aircrafttypegroup/fields.yaml
+++ b/models/aircrafttypegroup/fields.yaml
@@ -1,5 +1,5 @@
fields:
- comment:
- label: Comment
- span: auto
- type: text
+ comment:
+ label: Comment
+ span: auto
+ type: text
diff --git a/package.json b/package.json
index 4919751..b2687e4 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,6 @@
"prettier": "^2.3.0"
},
"scripts": {
- "format": "prettier --write './**/*.{php,html}'"
+ "format": "prettier --write './**/*.{php,html,htm,yaml}'"
}
}
diff --git a/plugin.yaml b/plugin.yaml
index 1a23f18..3228493 100644
--- a/plugin.yaml
+++ b/plugin.yaml
@@ -1,28 +1,28 @@
plugin:
- name: 'germanairlinesva.fleet::lang.plugin.name'
- description: 'germanairlinesva.fleet::lang.plugin.description'
- author: 'German Airlines VA'
- icon: oc-icon-plane
- homepage: ''
+ name: 'germanairlinesva.fleet::lang.plugin.name'
+ description: 'germanairlinesva.fleet::lang.plugin.description'
+ author: 'German Airlines VA'
+ icon: oc-icon-plane
+ homepage: ''
navigation:
- main-menu-item:
- label: 'germanairlinesva.fleet::lang.menu.main'
- url: /
+ main-menu-item:
+ label: 'germanairlinesva.fleet::lang.menu.main'
+ url: /
+ icon: icon-plane
+ sideMenu:
+ side-menu-item:
+ label: 'germanairlinesva.fleet::lang.menu.manufacturers'
+ url: /germanairlinesva/fleet/aircraftmanufacturers
+ icon: icon-wrench
+ side-menu-item2:
+ label: 'germanairlinesva.fleet::lang.menu.types'
+ url: germanairlinesva/fleet/aircrafttypes
+ icon: icon-paper-plane
+ side-menu-item3:
+ label: 'germanairlinesva.fleet::lang.menu.aircrafts'
+ url: germanairlinesva/fleet/aircrafts
icon: icon-plane
- sideMenu:
- side-menu-item:
- label: 'germanairlinesva.fleet::lang.menu.manufacturers'
- url: /germanairlinesva/fleet/aircraftmanufacturers
- icon: icon-wrench
- side-menu-item2:
- label: 'germanairlinesva.fleet::lang.menu.types'
- url: germanairlinesva/fleet/aircrafttypes
- icon: icon-paper-plane
- side-menu-item3:
- label: 'germanairlinesva.fleet::lang.menu.aircrafts'
- url: germanairlinesva/fleet/aircrafts
- icon: icon-plane
- side-menu-item4:
- label: 'germanairlinesva.fleet::lang.menu.groups'
- url: germanairlinesva/fleet/aircrafttypegroups
- icon: icon-group
+ side-menu-item4:
+ label: 'germanairlinesva.fleet::lang.menu.groups'
+ url: germanairlinesva/fleet/aircrafttypegroups
+ icon: icon-group
diff --git a/updates/builder_table_create_aircraft_type_aircraft_type_group.php b/updates/builder_table_create_aircraft_type_aircraft_type_group.php
index 1c9d954..6c5c258 100644
--- a/updates/builder_table_create_aircraft_type_aircraft_type_group.php
+++ b/updates/builder_table_create_aircraft_type_aircraft_type_group.php
@@ -1,31 +1,31 @@
-create('aircraft_type_aircraft_type_group', function ($table) {
- $table->engine = 'InnoDB';
- $table->bigInteger('aircraft_type_id')->unsigned();
- $table
- ->foreign('aircraft_type_id')
- ->references('id')
- ->on('aircraft_types');
- $table->bigInteger('aircraft_type_group_id')->unsigned();
- $table
- ->foreign('aircraft_type_group_id')
- ->references('id')
- ->on('aircraft_type_groups');
- });
- }
-
- public function down()
- {
- Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
- Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_aircraft_type_group');
- Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
- }
-}
+create('aircraft_type_aircraft_type_group', function ($table) {
+ $table->engine = 'InnoDB';
+ $table->bigInteger('aircraft_type_id')->unsigned();
+ $table
+ ->foreign('aircraft_type_id')
+ ->references('id')
+ ->on('aircraft_types');
+ $table->bigInteger('aircraft_type_group_id')->unsigned();
+ $table
+ ->foreign('aircraft_type_group_id')
+ ->references('id')
+ ->on('aircraft_type_groups');
+ });
+ }
+
+ public function down()
+ {
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
+ Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_aircraft_type_group');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
+ }
+}
diff --git a/updates/builder_table_create_aircraft_type_groups.php b/updates/builder_table_create_aircraft_type_groups.php
index 3416ea5..847e4bf 100644
--- a/updates/builder_table_create_aircraft_type_groups.php
+++ b/updates/builder_table_create_aircraft_type_groups.php
@@ -1,21 +1,23 @@
-create('aircraft_type_groups', function ($table) {
- $table->engine = 'InnoDB';
- $table->bigIncrements('id')->unsigned();
- $table->string('comment');
- });
- }
-
- public function down()
- {
- Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_groups');
- }
-}
+create('aircraft_type_groups', function ($table) {
+ $table->engine = 'InnoDB';
+ $table->bigIncrements('id')->unsigned();
+ $table->string('comment');
+ });
+ }
+
+ public function down()
+ {
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
+ Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_groups');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
+ }
+}
diff --git a/updates/builder_table_create_aircrafts.php b/updates/builder_table_create_aircrafts.php
index ee2a06f..612463b 100644
--- a/updates/builder_table_create_aircrafts.php
+++ b/updates/builder_table_create_aircrafts.php
@@ -1,64 +1,64 @@
-create('aircrafts', function ($table) {
- $table->engine = 'InnoDB';
- $table->bigIncrements('id')->unsigned();
- $table->bigInteger('aircraft_type_id')->unsigned();
- $table
- ->foreign('aircraft_type_id')
- ->references('id')
- ->on('aircraft_types');
- $table->bigInteger('home_airport_id')->unsigned();
- //$table
- // ->foreign('home_airport_id')
- // ->references('id')
- // ->on('airports');
- $table
- ->bigInteger('airport_id')
- ->unsigned()
- ->nullable();
- //$table
- // ->foreign('airport_id')
- // ->references('id')
- // ->on('airports');
- $table->string('name');
- $table->string('registration');
- $table->boolean('in_use')->default(true);
- $table
- ->double('total_miles')
- ->unsigned()
- ->default(0);
- $table
- ->double('total_fuel')
- ->unsigned()
- ->default(0);
- $table
- ->double('total_flight_time')
- ->unsigned()
- ->default(0);
- $table
- ->double('total_expenses')
- ->unsigned()
- ->default(0);
- $table->enum('current_check', ['a', 'b', 'c', 'd'])->nullable();
- $table->datetime('last_a_check')->default(DB::raw('NOW()'));
- $table->datetime('last_b_check')->default(DB::raw('NOW()'));
- $table->datetime('last_c_check')->default(DB::raw('NOW()'));
- $table->datetime('last_d_check')->default(DB::raw('NOW()'));
- });
- }
-
- public function down()
- {
- Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
- Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
- Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
- }
-}
+create('aircrafts', function ($table) {
+ $table->engine = 'InnoDB';
+ $table->bigIncrements('id')->unsigned();
+ $table->bigInteger('aircraft_type_id')->unsigned();
+ $table
+ ->foreign('aircraft_type_id')
+ ->references('id')
+ ->on('aircraft_types');
+ $table->bigInteger('home_airport_id')->unsigned();
+ //$table
+ // ->foreign('home_airport_id')
+ // ->references('id')
+ // ->on('airports');
+ $table
+ ->bigInteger('airport_id')
+ ->unsigned()
+ ->nullable();
+ //$table
+ // ->foreign('airport_id')
+ // ->references('id')
+ // ->on('airports');
+ $table->string('name');
+ $table->string('registration');
+ $table->boolean('in_use')->default(true);
+ $table
+ ->double('total_miles')
+ ->unsigned()
+ ->default(0);
+ $table
+ ->double('total_fuel')
+ ->unsigned()
+ ->default(0);
+ $table
+ ->double('total_flight_time')
+ ->unsigned()
+ ->default(0);
+ $table
+ ->double('total_expenses')
+ ->unsigned()
+ ->default(0);
+ $table->enum('current_check', ['a', 'b', 'c', 'd'])->nullable();
+ $table->datetime('last_a_check')->default(DB::raw('NOW()'));
+ $table->datetime('last_b_check')->default(DB::raw('NOW()'));
+ $table->datetime('last_c_check')->default(DB::raw('NOW()'));
+ $table->datetime('last_d_check')->default(DB::raw('NOW()'));
+ });
+ }
+
+ public function down()
+ {
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
+ Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
+ }
+}