Compare commits

..

414 Commits

Author SHA1 Message Date
Nabeel Shahzad
e4a42c53ba Build new assets 2022-08-22 12:42:52 -05:00
Nabeel Shahzad
a4b90fcce3 Add colors to the maps options 2022-08-22 12:39:31 -05:00
Nabeel S
78ee1a9769 Merge pull request #690 from nabeelio/7.0.0-beta.4
7.0.0-beta.4
2020-05-09 12:31:35 -04:00
Nabeel Shahzad
7cd01a24d6 Update CHANGELOG 2020-05-09 12:24:23 -04:00
Nabeel Shahzad
d5ea0952f5 Merge branch '7.0.0-beta.4' into dev 2020-05-09 11:57:23 -04:00
Nabeel S
1054d53826 Emails/notifications not sending #675 (#686)
* Add test call to test notification #675

* Fix queue driver with emails not sending; formatting #675
2020-05-09 11:31:25 -04:00
foo barf
69fb5a537e typo in dependency on 'leaflet.geodesic' (#687) 2020-05-09 10:37:58 -04:00
Nabeel S
5b771be653 Fix flight hours field #683 (#684) 2020-05-05 14:36:14 -04:00
Nabeel S
9135337186 Blank/null IATA code isn't unique when added #679 (#681) 2020-05-03 18:23:46 -04:00
Nabeel S
95608dbb79 Merge pull request #682 from nabeelio/680-METAR-Parse-Error
METAR: KM as unit in visibility #680
2020-05-03 11:48:42 -04:00
Nabeel Shahzad
a8fb8e93c8 METAR: KM as unit in visibility #680 2020-05-03 11:08:06 -04:00
Nabeel S
2ea18ae1c6 Fix airline creation logic in installer #677 (#678) 2020-05-02 15:09:27 -04:00
Nabeel S
99f4f3b3d8 Change currency from settings #671 (#672) 2020-04-26 11:55:20 -04:00
Nabeel S
03cfc648b0 Create journal when new airline is created #667 (#670) 2020-04-26 10:31:58 -04:00
Nabeel S
866d95c945 Check for SB being avail before filing #668 (#669) 2020-04-26 10:23:42 -04:00
Nabeel Shahzad
b21201c122 Fix test 2020-04-15 15:16:54 -04:00
Nabeel Shahzad
209b2790b6 Fix URL to briefing 2020-04-15 15:12:57 -04:00
Nabeel Shahzad
90a0a8cfee Add mock SB API key 2020-04-15 10:28:21 -04:00
Nabeel S
8e97a7cc5c Load Simbrief and flight data when getting bids #664 (#665) 2020-04-15 10:11:06 -04:00
Nabeel S
b1bdd40da7 Fix pilots page now showing up #655 (#660) 2020-04-06 18:12:55 -04:00
Nabeel S
40a94cb9ad Add privatized version of name #656 (#658) 2020-04-06 12:03:19 -04:00
Nabeel Shahzad
3c0cd34071 Trim list_to_assoc items 2020-04-02 17:54:40 -04:00
Nabeel S
261984ee90 Fix PirepComment response; 201 to 200 (#654) 2020-04-01 01:05:09 -04:00
Nabeel Shahzad
e8037c7d69 Return full PIREP when updating 2020-03-31 23:42:33 -04:00
Nabeel Shahzad
6f05dd6c86 Add full user response to PIREP API call 2020-03-31 23:32:50 -04:00
Nabeel Shahzad
072d5f76bb Formatting for StyleCI 2020-03-31 17:34:10 -04:00
Nabeel Shahzad
d1d243ef06 Update response objects 2020-03-31 17:26:55 -04:00
Nabeel S
819d3bcb47 Upgrade packages with security alerts (#653) 2020-03-31 12:36:33 -04:00
Nabeel S
60f378f584 Add Simbrief entries as sample data for load #651 (#652) 2020-03-31 12:32:11 -04:00
Nabeel Shahzad
6978fbf2e0 Fix API tests 2020-03-29 15:35:40 -04:00
Nabeel Shahzad
11b1c2b763 Fix tests for API 2020-03-29 15:19:23 -04:00
Nabeel Shahzad
655ac66b52 Formatting 2020-03-29 15:05:56 -04:00
Nabeel Shahzad
e9b30fbe30 Make sure user and acars data is sent from API 2020-03-29 13:33:14 -04:00
Nabeel S
82b873c071 Domain detection failing for .co.uk, etc #647 (#648)
* Fix domain name detection #647

* Ignore page links check if no DB configured #641
2020-03-28 19:07:46 -04:00
Nabeel S
3e7d5f6195 Use theme check in all frontend routes #638 (#645) 2020-03-28 14:45:25 -04:00
Nabeel Shahzad
ba0ae05c2a Make icon column nullable #641 2020-03-28 14:01:53 -04:00
Nabeel S
45873431e4 Add public/private pages #641 (#644)
* Add public/private pages #641

* Cleanup the form requests
2020-03-28 13:03:52 -04:00
Nabeel S
4a3ec38919 Option for SB only on bids; add the new file type #642 (#643)
Option for SB only on bids; add the new file type #642
2020-03-27 11:49:19 -04:00
Nabeel S
f3fe3a56ba Don't return bids by default, fix user flight column #639 (#640)
Fix the user api response, don't return bids by default, fix flights column #639
2020-03-25 18:04:26 -04:00
Nabeel Shahzad
88e8ea6ed1 Add total flights 2020-03-25 17:02:48 -04:00
Nabeel Shahzad
cce575c1a6 Fix avatar/gravatar call throwing error 2020-03-25 10:58:03 -04:00
Nabeel Shahzad
eafea01e22 Fix gravatar url check 2020-03-24 18:54:04 -04:00
Nabeel Shahzad
62cea3eb0c Load the user airline/bid ahead of time; SB XML name fix 2020-03-24 16:17:28 -04:00
Nabeel Shahzad
3f7a7d0f2e Remove empty fields from user return, add avatar 2020-03-24 15:53:59 -04:00
Nabeel S
877d5a5479 Account for admin role, don't error out on null rows #632 (#637) 2020-03-23 11:50:15 -04:00
Nabeel S
9e5386264f SimBrief integration #405 (#635)
* SimBrief integration #405

* Add briefing as API response; add acars_xml field #405
2020-03-23 09:31:35 -04:00
Nabeel Shahzad
04b9e37e1d Fix formatting 2020-03-09 16:40:06 -04:00
Nabeel Shahzad
8998dabb3d Drop the unique index from subfleets.type #628 2020-03-09 16:39:07 -04:00
Nabeel Shahzad
e458a761d3 Include airline name in subfleet name #628 2020-03-09 16:20:04 -04:00
Nabeel Shahzad
3443f6b31e Check for empty on airline id #628 2020-03-09 16:06:54 -04:00
Nabeel S
2a03d53b3f Fix airline mapping for aircraft #628 (#633) 2020-03-09 15:06:36 -04:00
Nabeel S
412919fe21 Account ICAO for subfleet, airline/location if columns exist #628 (#632) 2020-03-09 13:40:10 -04:00
Nabeel S
80b20a8b25 Increase ID column size; seed ID generator with uniqid() #630 (#631) 2020-03-09 13:16:10 -04:00
Nabeel S
2c238763cb Disable using apc/opcache by default if found #625 (#629) 2020-03-09 13:08:07 -04:00
Nabeel S
2846a78d2a Fix saving of fare #621 (#624) 2020-03-06 16:54:53 -05:00
Nabeel S
632c5782de Add fare type for pax/cargo/mixed flights #621 (#623) 2020-03-06 15:10:03 -05:00
Nabeel S
9f3ddd5dbd Add fixed pilot pay for a flight #487 (#622) 2020-03-06 11:36:02 -05:00
Nabeel S
16c977c769 Add load_factor and load_factor_variance to flights #352 (#620) 2020-03-05 20:19:12 -05:00
Nabeel S
9ed2e3f9f4 API: Flight fields are an array when empty #618 (#619)
* Ensure 'fields' field is return as an object for flights #618
* Eager loading for flight fields
2020-03-04 18:14:03 -05:00
Nabeel S
174b602d7c Remove the flight fields link from admin #614 (#615)
* Remove the flight fields link from admin #614

* Change flight_field_value col to be nullable

* Fix updater design
2020-03-04 09:49:51 -05:00
Nabeel Shahzad
b1e745844a Restore theme db lookup 2020-03-04 08:54:55 -05:00
Nabeel S
89481b5fa1 HTTP/HTTPS mixed content errors #612 (#613)
* Configure TrustProxies middleware
* Add trusted proxies to deps
* Replace jquery request with axios request code
* Trust current user IP for forwarded headers
* Update dependencies
* Downgrade self-updater package for PHP 7.2
2020-03-03 10:20:13 -05:00
Nabeel Shahzad
dcf9f48364 Add ID column to fare #608 2020-03-02 17:38:48 -05:00
Nabeel Shahzad
f1902a5faa Fix setting repo resolution 2020-03-02 16:21:53 -05:00
Nabeel Shahzad
3cd6c8ee82 Fix cost/code field #608 2020-03-02 16:08:58 -05:00
Nabeel Shahzad
83a0007b7d Return response from middleware 2020-03-02 15:58:53 -05:00
Nabeel S
b78c1b935e Include fare information in subfleet response #608 (#609) 2020-03-02 15:36:01 -05:00
Nabeel Shahzad
fa89416e5b Fix docs/comments 2020-03-02 10:50:39 -05:00
Nabeel S
4a14e83c88 Performance improvements #602 (#607)
* Update gitignore

* Save theme to the session to avoid a lookup #602

* Formatting

* Move routes into main service provider

* Move Observers into their own service provider
2020-03-01 15:51:00 -05:00
Nabeel S
21e2e48a6e Center on active flights #605 (#606) 2020-03-01 12:41:09 -05:00
Nabeel Shahzad
a040e288de Merge branch 'dev' of github.com:nabeelio/phpvms into dev 2020-03-01 11:18:39 -05:00
Nabeel S
f78d065858 Aircraft status field blank causes error #603 (#604)
* Update composer lock file

* Require aircraft status #603
2020-03-01 11:18:23 -05:00
Nabeel Shahzad
660c5303cb Update composer lock file 2020-02-29 22:21:03 -05:00
Nabeel S
ea9ee985e8 METAR parsing infinite loop bugfix #599 (#600)
METAR parsing infinite loop bugfix #599
2020-02-28 22:50:41 -05:00
Nabeel S
b0f122a301 Table prefixes not being added to indexes (#597)
* Enabled prefixes on any created indexes (multi-site install in single db)

* Formatting

* Check if enum label is looking for a translation

* Return value

* Fix view namespace across modules
2020-02-28 18:56:01 -05:00
Nabeel S
2f40f4737c Installer fixes, remove bcmath, fix design (#596)
* Installer cleanup

* Installer design fixes
2020-02-28 18:00:56 -05:00
Nabeel S
7e742518bc Module/plugin installation working #593 (#594)
* Remove the Sample module

* 593-Fix-Modules-From-Composer

* Fix pre/post install scripts in composer #593

* Formatting
2020-02-28 16:06:45 -05:00
Nabeel S
dbaac04eea Remove airport length restrictions #590 (#592) 2020-02-27 11:37:05 -05:00
Nabeel S
f2b216c404 Remove 4 char restriction from ICAO; use decimal type for lat/lon #590 (#591)
* Remove 4 char restriction from ICAO; use decimal type for lat/lon #590

* Reorder imports
2020-02-26 17:06:39 -05:00
Nabeel S
14aacdfb75 Import expense and ledger entries #443 (#588)
* Fix rank importing with PIREP pay #443

* Import ledger information #443

* Uncomment out testing importers

* Import expense log and settings #443

* Formatting
2020-02-25 14:45:23 -05:00
Nabeel S
07a75de0bf Recalcuate aircraft stats in nightly cron and importer #585 #443 (#587) 2020-02-24 19:35:28 -05:00
Nabeel S
30786b7b27 Set the payrate for the ranks #443 (#586) 2020-02-24 17:52:49 -05:00
Nabeel S
11bbcd1df7 User country mapping; ignore unused groups #443 (#584)
* Fix the user country import #443

* Ignore the old "core" groups because they're unused #443

* Properly sync roles and individual permissions #443
2020-02-24 15:12:36 -05:00
Nabeel Shahzad
342fe31ceb Move full version check below the version write 2020-02-23 21:15:44 -05:00
Nabeel Shahzad
c6f46ee4cb Debug output for version 2020-02-23 21:08:59 -05:00
Nabeel Shahzad
574768262d Include full build id 2020-02-23 20:59:09 -05:00
Nabeel Shahzad
24e2576645 Write out full version to log 2020-02-23 20:49:11 -05:00
Nabeel S
dfbaa1afd3 Fix rowmapper generator, check for fields, map users #443 (#583)
* Fix rowmapper generator, check for fields, map users #443

* Formatting

* Remove value store at the end of the import

* Update the notes for the importer about users

* Uncomment importers disabled during testing
2020-02-23 19:48:28 -05:00
Nabeel S
a1d6fa17ad Respect home hubs setting for registration #580 (#581)
Respect home hubs setting for registration #580
2020-02-23 17:21:26 -05:00
Nabeel S
b34dc4868e Change fuel used to optional #512 (#582) 2020-02-23 16:01:09 -05:00
Nabeel S
0e13905098 Upstream null version; build version tags not being saved properly #575 (#578)
* Check for null version from upstream #575

* Fix for pre-release version numbering

* Move popup to right

* Split get/generate build ID #575
2020-02-23 12:23:19 -05:00
Nabeel S
b9fe8bf738 Fix edit pilot error #576 (#577) 2020-02-23 09:56:43 -05:00
Nabeel S
9ed07da9c3 Upsert on ACARS positions #572 (#573) 2020-02-22 16:03:01 -05:00
Nabeel S
6e87f7804c Fix the namespace path on updater templates #570 (#571) 2020-02-21 20:36:27 -05:00
Nabeel S
cc23c32db7 Route not found error for Pirep::resource() call #559 (#565) 2020-02-20 12:42:22 -05:00
Nabeel S
0297ec3746 Add bcmath to the required extensions list #558 (#564) 2020-02-20 11:36:47 -05:00
Nabeel S
da575932a7 Add extra check for being set #560 (#563) 2020-02-20 11:36:26 -05:00
Nabeel S
c0fbc7d491 Missing on bids page #561 (#562) 2020-02-20 10:49:15 -05:00
Nabeel S
0060f794ae Refresh theme cache on settings page load #554 (#557) 2020-02-18 17:10:31 -05:00
Nabeel S
9304daea7a Add the argc_argv flag for the cgi exec #553 (#556) 2020-02-18 17:01:00 -05:00
Nabeel S
8300a69ad5 Fix migrations when table prefix is involved #442 (#555)
* Fix migrations when table prefix is involved #442

* Formatting
2020-02-18 08:23:32 -05:00
Nabeel S
2d36376e29 Add logo to the flights page if its set #417 (#550) 2020-02-14 18:54:05 -05:00
Nabeel S
77f2138a1c Add Google Analytics tracking ID to settings and to main template #382 (#551) 2020-02-12 18:28:11 -05:00
Nabeel S
b9993b9c23 Set expenses on specific flight types #348 (#549)
* Set expenses on specific flight types #348

* Formatting

* Use strict check for in_array
2020-02-12 10:40:52 -05:00
Nabeel Shahzad
f16af4d9b1 Remove extraneous flight time text 2020-02-11 13:59:42 -05:00
Nabeel S
f392bf1cb8 Add additional events for PIREP states #436 (#548) 2020-02-11 13:56:20 -05:00
Nabeel Shahzad
39159e2c2e Travis check condition flipped 2020-02-11 13:25:54 -05:00
Nabeel Shahzad
018f6b62f6 Fix mv command 2020-02-11 13:23:43 -05:00
Nabeel Shahzad
4229366585 Specify file paths 2020-02-11 13:17:56 -05:00
Nabeel Shahzad
9fa395a061 Fix directory for tar file 2020-02-11 13:11:22 -05:00
Nabeel Shahzad
8b417ce1a8 Travis fix 2020-02-11 13:04:15 -05:00
Nabeel Shahzad
1d53497424 Fix cleanup tag 2020-02-11 12:39:21 -05:00
Nabeel Shahzad
07917f4ed2 Enable PHP 7.2/7.3 version 2020-02-11 12:33:21 -05:00
Nabeel S
b36a3009dd Cleanup Utils #467 (#547)
* Remove Utils Facade
2020-02-11 12:32:41 -05:00
Nabeel S
be6c164f03 Add checkbox to clear previous data when importing #490 (#546)
* Add checkbox to clear previous data when importing #490
2020-02-11 10:51:18 -05:00
Nabeel S
99118daad9 Auto update #449 (#545)
* Add custom repository type for updates

* Direct to self update module

* Formatting
2020-02-10 17:47:46 -05:00
Nabeel Shahzad
3fcd378f91 Remove subfolder when building the tar 2020-02-10 15:10:06 -05:00
Nabeel Shahzad
6c0d0e08e3 Zip package upload 2020-02-10 13:01:13 -05:00
Nabeel Shahzad
d234a0beb2 Update required runtime 2020-02-10 12:57:39 -05:00
Nabeel Shahzad
7a0e5f0ef4 Zip file creation fix 2020-02-10 12:54:59 -05:00
Jorge Cabal
2e1bcc1d7a Spanish files translation (#542)
Co-authored-by: Jorge Cabal <jcabala14>
2020-02-10 12:50:54 -05:00
Nabeel S
6b79ad7e58 Auto-update functionality #449 (#544)
* Convert tar to zip file for updater

* Add update section to maintenance
2020-02-10 12:39:59 -05:00
Nabeel S
90e1b3317d Distro zip file from tar file #449 (#543)
* Create zip file from tar file

* Formatting
2020-02-10 10:40:42 -05:00
Nabeel S
073e48c396 7.0.0-beta3 Release (#541)
* 391 Notification refactorings (#441)

* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting

* Fix missing newsRepo (#445)

* Refactor and add importer to Installer module #443 (#444)

* Refactor and add importer to Installer module #443

* Refactor for finances to use in import

* Import groups into roles

* Formatting

* Formatting

* Add interface in installer for import

* Notes about importing

* Check for installer folder

* Formatting

* Fix pirep->user mapping

* Unused import

* Formatting

* Replace importer with AJAX powered; better error handling #443 (#447)

* Replace importer with AJAX powered; better error handling #443

* Formatting

* Fix command line importer

* Remove bootstrap cache (#448)

* Cleanup the bootstrap/cache directory when packaging

* Fix removal of bootstrap cache

* Formatting

* Stricter checks on ACARS API data (#451)

* Stricter checks on ACARS API data

* More checks

* Fix for flight_number check forcing to exist

* Allow nullable on flight_id

* Avoid proc_open use #455 (#456)

* Use PhpExecutableFinder() closes #457 #458 (#460)

* Use DateTimeZone instead of int for creating datetime

closes #461

* Fix CSV imports giving Storage class not found #454 (#462)

* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert

* Add PHP 7.4 support (#464)

* Add PHP 7.4 to build matrix

* DB fix

* YAML parser fix in test data

* Show versions

* Package updates

* Track used ICAOs

* 7.4 METAR parsing fix

* METAR parser fix

* Formatting

* Add meters to response units

* Call instance for unit conversion

* Return value

* Catch exception for unknown quantity

* Comment fix

* Formatting

* METAR parsing fixes on PHP 7.4

* Package updates

* More random airport ID

* More random airport ID

* Properly disable toolbar

* Semver written out to version file

* Use dev as default identifier

* Fix BindingResolutionError when debug toolbar isn't present (#465)

* Fix BindingResolutionError when debug toolbar isn't present

* Formatting

* Split the importer module out from the installer module (#468)

* Split the importer module out from the installer module

* Cleanup of unused imports

* Move updater into separate module #453

* Remove unused imports/formatting

* Disable the install and importer modules at the end of the setup

* Unused imports; update IJ style

* test explicit stage for php+mysql

* add more to matrix

* Add different MariaDB versions

* undo

* Cleanup Model doc

* Pilots cannot use the dashboard or flights without admin rights (#481)

* Use auth middleware instead of specific groups for logged in state

* Auth check for admin access

* Check user admin access for updates

* Formatting

* Allow nullable field and calculate distance if nulled for flight import #478 (#482)

* Check for no roles being attached #480 (#483)

* Return the flight fares if there are no subfleet fares #488 (#489)

* Return the flight fares if there are no subfleet fares #488

* Formatting

* Formatting

* Account for units when entering fuel amounts #493

* Search for ICAO not working properly (#496)

* /flights and /flights/search direct to the same endpoint

* Properly set the distance/planned_distance on save (#497)

* 491 Installation Error (#495)

* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting

* Fix GeoService errors when viewing PIREP #498 (#499)

* Add new command to export a specific PIREP for debugging (#501)

* Set a default model value for airports on PIREP (#500)

* Set a default model value for airports on PIREP

* Fix airport icao reference

* Default airport models

* Catch broader exception writing out config files #491

* style

* Add reference to docs on doc site (#502)

* Properly create/update rows importing #486 (#503)

* Add base Dockerfile for Dockerhub builds (#504)

* New subfleet not being attached to an airline on import #479 (#505)

* Fix subfleet not being attached to an airline on creation in import #479

* Call airline name with optional() around subfleet

* Minor cleanup

* Search flights by subfleet #484 (#506)

* API level search of flights #484

* Add Subfleet to flights page for search

* Make the fuel used optional (#512)

* Add make to Docker container

* Add getRootDomain() to Utils (#514)

* Show admin dropdown for admin-access ability (#515)

* Show admin dropdown for admin-access ability closes #509

* Formatting

* Check user permissions on the routes #508 (#516)

* Check user permissions on the routes #508

* Formatting

* Return default value on exception for setting()

* Correct text for no subfleets #507 (#518)

* Add a public_url() helper #513 (#519)

* Reduce number of queries for update check (#520)

* Try to clear caches before updating (#522)

* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting

* Set PIREPs page to public (#526)

Set PIREPs page to public

* Fix live and route map errors #527 (#528)

* Add menu bar for mobile (#529)

* Format all blade templates to 2 spaces #530 (#531)

* Fix PIREP edit endpoint closes #533 (#534)

* Fix import during flight cron #532 (#535)

* PIREPS resource except for show (#536)

* Use optional() around the airport fields (#537)

* Use optional() around the airport fields

* Add null-coalesce around full_name

* Add link to download ACARS config from profile (#539)

* Add link to download ACARS config from profile

* Formatting

* Update xml config file template (#540)
2020-02-08 13:29:34 -05:00
Nabeel S
989e86ecd3 Update xml config file template (#540) 2020-02-07 21:25:59 -05:00
Nabeel S
dd9fbdb6f1 Add link to download ACARS config from profile (#539)
* Add link to download ACARS config from profile

* Formatting
2020-02-07 13:29:43 -05:00
Nabeel S
94cfbd4748 Use optional() around the airport fields (#537)
* Use optional() around the airport fields

* Add null-coalesce around full_name
2020-02-03 12:23:58 -05:00
Nabeel S
5e4a003a92 PIREPS resource except for show (#536) 2020-02-01 14:14:37 -05:00
Nabeel S
893e28eb3a Fix import during flight cron #532 (#535) 2020-02-01 13:54:30 -05:00
Nabeel S
8cde3c93b0 Fix PIREP edit endpoint closes #533 (#534) 2020-02-01 13:37:40 -05:00
Nabeel S
59d09c0cec Format all blade templates to 2 spaces #530 (#531) 2020-02-01 13:05:56 -05:00
Nabeel S
06b47d97e0 Add menu bar for mobile (#529) 2020-01-31 14:32:43 -05:00
Nabeel S
03184db2fe Fix live and route map errors #527 (#528) 2020-01-31 13:57:21 -05:00
Nabeel S
45b8d737e4 Set PIREPs page to public (#526)
Set PIREPs page to public
2020-01-31 09:35:33 -05:00
Nabeel S
51b50972c8 Try to clear caches before updating (#522)
* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting
2020-01-30 14:59:48 -05:00
Nabeel S
3c1b433c29 Reduce number of queries for update check (#520) 2020-01-30 12:44:59 -05:00
Nabeel S
f0719d4d8d Add a public_url() helper #513 (#519) 2020-01-30 11:06:51 -05:00
Nabeel S
f5bc087f38 Correct text for no subfleets #507 (#518) 2020-01-30 11:04:22 -05:00
Nabeel S
02b16d5e57 Return default value on exception for setting() 2020-01-30 10:54:51 -05:00
Nabeel S
63b574181a Check user permissions on the routes #508 (#516)
* Check user permissions on the routes #508

* Formatting
2020-01-30 09:23:31 -05:00
Nabeel S
ff913e5304 Show admin dropdown for admin-access ability (#515)
* Show admin dropdown for admin-access ability closes #509

* Formatting
2020-01-30 09:00:41 -05:00
Nabeel S
e431f75ad4 Add getRootDomain() to Utils (#514) 2020-01-28 12:42:46 -05:00
Nabeel Shahzad
819ebece6d Add make to Docker container 2020-01-28 10:12:40 -05:00
Nabeel S
df832088d5 Make the fuel used optional (#512) 2020-01-22 10:33:10 -05:00
Nabeel S
2415caab54 Search flights by subfleet #484 (#506)
* API level search of flights #484

* Add Subfleet to flights page for search
2020-01-16 17:36:03 -05:00
Nabeel S
d03a77bd4b New subfleet not being attached to an airline on import #479 (#505)
* Fix subfleet not being attached to an airline on creation in import #479

* Call airline name with optional() around subfleet

* Minor cleanup
2020-01-16 14:23:23 -05:00
Nabeel S
6fcbd603ba Add base Dockerfile for Dockerhub builds (#504) 2020-01-16 11:49:22 -05:00
Nabeel S
c2f7c5e421 Properly create/update rows importing #486 (#503) 2020-01-16 10:40:42 -05:00
Nabeel S
fa01c61677 Add reference to docs on doc site (#502) 2020-01-16 09:49:28 -05:00
Nabeel Shahzad
b7b0ac0a73 style 2020-01-15 13:59:02 -05:00
Nabeel Shahzad
bf24ffb1ba Catch broader exception writing out config files #491 2020-01-15 13:57:56 -05:00
Nabeel S
831b72fb2b Set a default model value for airports on PIREP (#500)
* Set a default model value for airports on PIREP

* Fix airport icao reference

* Default airport models
2020-01-15 13:00:58 -05:00
Nabeel S
de8046288b Add new command to export a specific PIREP for debugging (#501) 2020-01-15 11:50:42 -05:00
Nabeel S
7d07008871 Fix GeoService errors when viewing PIREP #498 (#499) 2020-01-15 09:09:58 -05:00
Nabeel S
d4da0a6d6a 491 Installation Error (#495)
* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting
2020-01-14 13:55:24 -05:00
Nabeel S
aafc9680bf Properly set the distance/planned_distance on save (#497) 2020-01-14 13:45:22 -05:00
Nabeel Shahzad
9aded3a552 /flights and /flights/search direct to the same endpoint 2020-01-10 10:17:11 -05:00
Nabeel S
03284959d6 Search for ICAO not working properly (#496) 2020-01-10 09:41:32 -05:00
Nabeel Shahzad
4844692bd9 Account for units when entering fuel amounts #493 2020-01-09 07:34:05 -05:00
Nabeel S
74052e4542 Return the flight fares if there are no subfleet fares #488 (#489)
* Return the flight fares if there are no subfleet fares #488

* Formatting

* Formatting
2020-01-06 13:44:43 -05:00
Nabeel S
282cb4be95 Check for no roles being attached #480 (#483) 2019-12-26 09:42:03 +05:00
Nabeel S
4f4d0c266a Allow nullable field and calculate distance if nulled for flight import #478 (#482) 2019-12-25 17:16:34 +05:00
Nabeel S
17637c32d4 Pilots cannot use the dashboard or flights without admin rights (#481)
* Use auth middleware instead of specific groups for logged in state

* Auth check for admin access

* Check user admin access for updates

* Formatting
2019-12-25 13:31:09 +05:00
Nabeel Shahzad
66a1192739 Cleanup Model doc 2019-12-22 09:46:41 +05:00
Nabeel S
e862537a20 Split the importer module out from the installer module (#468)
* Split the importer module out from the installer module

* Cleanup of unused imports

* Move updater into separate module #453

* Remove unused imports/formatting

* Disable the install and importer modules at the end of the setup

* Unused imports; update IJ style

* test explicit stage for php+mysql

* add more to matrix

* Add different MariaDB versions

* undo
2019-12-12 15:07:35 -05:00
Nabeel S
a58bca390b Fix BindingResolutionError when debug toolbar isn't present (#465)
* Fix BindingResolutionError when debug toolbar isn't present

* Formatting
2019-12-11 15:12:31 -05:00
Nabeel S
e6d38f9338 Add PHP 7.4 support (#464)
* Add PHP 7.4 to build matrix

* DB fix

* YAML parser fix in test data

* Show versions

* Package updates

* Track used ICAOs

* 7.4 METAR parsing fix

* METAR parser fix

* Formatting

* Add meters to response units

* Call instance for unit conversion

* Return value

* Catch exception for unknown quantity

* Comment fix

* Formatting

* METAR parsing fixes on PHP 7.4

* Package updates

* More random airport ID

* More random airport ID

* Properly disable toolbar

* Semver written out to version file

* Use dev as default identifier
2019-12-11 12:57:18 -05:00
Nabeel S
1f65b744a0 Fix CSV imports giving Storage class not found #454 (#462)
* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert
2019-12-10 13:53:55 -05:00
Nabeel S
d9a1e6aba7 Use DateTimeZone instead of int for creating datetime
closes #461
2019-12-09 22:11:20 -05:00
Nabeel S
8cb0021b9f Use PhpExecutableFinder() closes #457 #458 (#460) 2019-12-09 15:26:30 -05:00
Nabeel S
8042c4ffc1 Avoid proc_open use #455 (#456) 2019-12-05 14:17:36 -05:00
Nabeel Shahzad
cc8662445c Allow nullable on flight_id 2019-12-03 15:52:00 -05:00
Nabeel Shahzad
64a04f70a3 Fix for flight_number check forcing to exist 2019-12-03 15:45:18 -05:00
Nabeel S
b06287da23 Stricter checks on ACARS API data (#451)
* Stricter checks on ACARS API data

* More checks
2019-12-02 18:27:58 -05:00
Nabeel S
83821d1e04 Remove bootstrap cache (#448)
* Cleanup the bootstrap/cache directory when packaging

* Fix removal of bootstrap cache

* Formatting
2019-12-02 10:29:16 -05:00
Nabeel S
68eff40753 Replace importer with AJAX powered; better error handling #443 (#447)
* Replace importer with AJAX powered; better error handling #443

* Formatting

* Fix command line importer
2019-12-02 09:57:35 -05:00
Nabeel S
50dc79bc8d Refactor and add importer to Installer module #443 (#444)
* Refactor and add importer to Installer module #443

* Refactor for finances to use in import

* Import groups into roles

* Formatting

* Formatting

* Add interface in installer for import

* Notes about importing

* Check for installer folder

* Formatting

* Fix pirep->user mapping

* Unused import

* Formatting
2019-11-27 09:19:20 -05:00
Nabeel S
f95a3f336b Fix missing newsRepo (#445) 2019-11-23 12:58:48 -05:00
Nabeel S
ea3ab21beb 391 Notification refactorings (#441)
* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting
2019-11-20 10:16:01 -05:00
Nabeel S
a335ed8e9b Merge pull request #440 from nabeelio/dev
Merge 7.0.0-beta.2 to master
2019-11-19 11:45:13 -05:00
Nabeel Shahzad
02973a0f22 Use GITHUB_TOKEN variable in release 2019-11-19 11:21:12 -05:00
Nabeel S
bffa5ebde2 Refactor the upgrade pending check to see if there are settings/permissions yaml changes (#438) 2019-11-19 10:54:42 -05:00
Nabeel S
3ec64c989b Fixes (#435)
* Add flight level field to PIREP field closes #401

* Default value for distance 0 closes #400

* Block airline deletion if assets exist #367

* Formatting

* Move some of the base exception classes

* Fix skin references to use settings table

* Set default for theme name if setting is wrong
2019-11-19 10:06:07 -05:00
Nabeel Shahzad
c643833496 Update stalebot 2019-11-06 11:42:01 -05:00
Nabeel Shahzad
759979fc10 Random cache prefix closes #374 2019-11-06 11:31:33 -05:00
Nabeel Shahzad
8859682366 Set debug=true for new installs 2019-11-06 11:29:25 -05:00
Nabeel S
f5183babf6 #406 Refactor bids (#432)
* Add flight_id column to pireps table

* Refactor PIREPs and bids closes 406

* Formatting
2019-11-05 11:44:31 -05:00
voipmeister
db087d0ccb fixes for issue #419 (#429)
* fixes for issue #419

* no spaces

* no spaces
2019-11-01 08:33:43 -04:00
Nabeel S
70d43e6e53 Wrap values in travis env (#426)
* Wrap values in travis env

* Inline CronService
2019-10-30 10:23:31 -04:00
Nabeel S
a45770732a Show a message about setting up the cron and if there was an error running it (#425) 2019-10-30 09:55:32 -04:00
Nabeel S
ec4f10d43a 359 Select theme in settings (#423)
* Update composer package versions

* Laravel version

* Change theme in the admin settings page closes #359

* Fix comment
2019-10-30 09:05:18 -04:00
Nabeel S
eff9f6fec6 Fix blank aircraft field causing error closes #414 (#422) 2019-10-29 13:57:17 -04:00
Nabeel Shahzad
96394228ea Select box formatting 2019-10-29 13:09:23 -04:00
Nabeel S
ae68550448 Move telemetry option into settings; checkbox in install refs #415 (#416) 2019-10-29 13:07:53 -04:00
Nabeel S
a2ea9b29ba Bundle CSS changes (#421)
* Bundle CSS changes

* Edit language

* Clickable flight IDs #419

* Fix dropdown menu going offscreen

* formatting
2019-10-29 13:03:04 -04:00
Benjamín Buske
1725ea5a9e Some minor CSS fixes as discussed on Discord (#420)
* Minor CSS Changes

Minor CSS changes to the original. 

#1: Added button to show own bids. 
#2: Added padding to Search buttons and fields  
#3: Fixed search fields leaving the search box

* Minor CSS Changes to Search Fields

Search Fields have been changed from round to square for better look.
2019-10-28 13:21:21 -04:00
Nabeel Shahzad
12679e85a8 Updated changelog 2019-10-23 15:29:34 -04:00
Nabeel Shahzad
79d4928e18 Fix for http auth in htaccess 2019-10-23 12:36:21 -04:00
Nabeel S
7a34756188 Issue fixes (#413)
* Auto lookup missing airports closes #404

* Ensure flight ICAOs are capitalized closes #404

* Update htaccess in root closes #412

* Update htaccess in root closes #412

* StyleCI fix
2019-10-23 12:01:31 -04:00
Nabeel Shahzad
97baf98d04 Formatting 2019-09-20 09:11:34 -04:00
Nabeel Shahzad
eb27c94637 Fix for bad unit conversions in API responses 2019-09-20 09:05:09 -04:00
Nabeel S
5f9e7d5754 Catch error messages in notifying (#403)
* Catch error messages in notifying

* Formatting
2019-09-17 19:11:02 -04:00
Nabeel S
6e9dcf8a31 Design and file upload issues (#399)
* Fix some styling issues/edit button on PIREP overview page

* Fix validation for file/url upload

* Formatting
2019-09-16 15:17:51 -04:00
Nabeel S
aedb1f22b6 Don't allow cancels from certain states (#396)
* Don't allow cancels from certain states

* Unused imports

* Don't reset the state doubly

* Move SetUserActive into listener; code cleanup

* Unused imports

* Add missing files into htaccess

* Move Command contract to correct folder
2019-09-16 13:08:26 -04:00
Nabeel Shahzad
41baefbf4a Fix styler 2019-09-14 11:18:09 -04:00
Nabeel Shahzad
3c21047c15 Fix playback file path 2019-09-14 11:15:42 -04:00
Nabeel Shahzad
52332c250b Fix the route() calls for L6 2019-09-13 18:20:50 -04:00
Nabeel Shahzad
0c89d36a16 Remove remnants of Timezonelist library 2019-09-13 17:54:46 -04:00
Nabeel S
4ac781a20d Fix map checkout call (#394) 2019-09-13 15:10:47 -04:00
Nabeel S
d68d8791bd 389 API Changes (#393)
* Update PHPUnit to 8

* Fix API endpoints closes #389

* Update pagination method in Repository contract to look at the page number closes #390

* Remove unused imports

* Fix tests in FlightTests

* Typecast page

* Don't register factories

* Remove Factory loading

* Remove unused imports
2019-09-13 11:21:40 -04:00
Nabeel S
23eb9dcbda 384 Laravel 6 changes (#385)
* 384 Laravel 6 changes

* Library versions

* Update package versions

* Add keyType to models

* Remove unused dependencies

* StyleCI fixes

* Fix models for test

* Fix tests output and update test runner

* Unused imports

* Update exceptions handler

* Fix login page
2019-09-13 08:05:02 -04:00
Nabeel S
7a76ac4226 CSS Libraries and style updates (#388)
* Update now-ui frontend lib to latest instead of the beta

* Update to bootstrap 4 lib

* Fix flights and profile pages
2019-09-12 11:48:41 -04:00
Nabeel S
37fc761567 380 vacentral library (#381)
* Update vaCentral library for new API server format

* Formatting

* Remove missing/unused import
2019-09-05 16:55:51 -04:00
Nabeel Shahzad
1b82ef6c88 Fix mix error for admin.css 2019-09-04 08:03:39 -04:00
Nabeel S
7ace8bccd6 Use Notification/Notifiable (#379)
* Add migrations for notifiables

* Configure spatie-backup to run as part of cron

* Convert Mailer to Notification; add pirep notifications

* Styling
2019-08-30 15:59:17 -04:00
Nabeel S
b213f2bb4c Add maintenance section to admin, clear caches #376 (#377)
* Add maintenance section to admin, clear caches #376

* Formatting
2019-08-30 15:59:08 -04:00
Nabeel S
0d1f38cf85 Refactor all JS API calls #360 (#375)
* Refactor all JS API calls #360

* Remove unused imports

* Lint JS

* Fix doubled api key

* Formatting

* Added extra logging to distance lookup

* Remove the .editorconfig file in distrib

* shell check fixes

* Remove the .editorconfig file in distrib
2019-08-30 08:08:00 -04:00
Nabeel Shahzad
e62e4a865d Rename mix_public() to public_mix() for consistency with public_asset() 2019-08-28 10:52:35 -04:00
Nabeel S
09f3e3cfdf Set the baseURL for ajax requests (#373)
* Set the baseURL for ajax requests

* Use async/await on AJAX calls

* Add mix_public() cache generated asset cache busting

* Move storage container into separate class

* Fix some styling
2019-08-27 15:08:42 -04:00
Nabeel S
fd2f4f2150 Move airline transaction code into service layer (#371)
* Move airline transaction code into service layer

* Remove unused import
2019-08-26 14:55:59 -04:00
Nabeel S
651174bda8 229 url for downloads (#369)
* Allow file uploads for subfleet

* Allow URL to be used for a download

* Remove old FileUploadRequest

* Move file removal logic to service layer

* Remove unused import

* Remove unused packages
2019-08-26 14:43:50 -04:00
Nabeel S
bbec276da8 #355 Calculate distance button (#366)
* #355 Calculate distance button in add/edit Flight page

* Styling

* Move add/edit flight logic out of controller and into service layer

* Styling

* Formatting

* Run styleci against modules dir

* Styleci config

* Style fixes in /modules
2019-08-26 12:32:46 -04:00
Nabeel Shahzad
25999d55a3 Update dep versions 2019-08-26 09:09:12 -04:00
Nabeel S
6018a6dcaa Add Contract interface for airport lookup functionality (#365)
* Add Contract interface for airport lookup functionality

* style ci fixes
2019-08-22 14:32:49 -04:00
Nabeel Shahzad
94ba5d8680 Disable the requests throttler 2019-08-22 12:45:15 -04:00
Nabeel Shahzad
3d6a29795b Carry headers through the handler 2019-08-22 12:26:46 -04:00
Nabeel Shahzad
dd2b297cc5 Carry headers when rethrowing errors to REST 2019-08-22 12:12:44 -04:00
Nabeel Shahzad
7fdaf62ef5 Add 'status' field to error response 2019-08-21 08:19:49 -04:00
Nabeel S
182aabf426 Refactor error handling internally to follow RFC7807 (#362)
* Refactor error handling internally to follow RFC7807

* style fixes
2019-08-21 08:17:44 -04:00
Nabeel Shahzad
91a5eb535d Add abstract class for route finding mechanism 2019-08-20 08:48:45 -04:00
Nabeel Shahzad
b6189bab7e Remove the table prefix on importer 2019-08-10 21:12:18 -04:00
Nabeel S
dc51897314 Additional logging for the stats recalculation (#358)
* Additional logging for the stats recalculation

* style fix
2019-08-10 20:42:35 -04:00
Nabeel S
c1103afe8f Add missing expiry time for PIREP API (#356) 2019-08-09 22:49:25 -04:00
Nabeel Shahzad
39fbdcb787 Add the airline back into seed data 2019-08-09 13:57:56 -04:00
Nabeel S
47be7507f0 Fix/metar reading (#354)
* Account for empty ICAO; added tests

* Fix null returns

* Fix typo in volume units display

* Add version field for bug report template

* Some more changes to the bug report template
2019-08-08 17:41:53 -04:00
Nabeel S
5cafebe4d6 Fix/metar reading (#353)
* Fix reading of the METAR information for AviationWeather. Fix the DI

* StyleCI fixes
2019-08-08 14:52:34 -04:00
Nabeel Shahzad
becf6c95f0 StyleCI fixes 2019-08-08 13:44:18 -04:00
Nabeel Shahzad
380c9d13b6 Error handling around reset install; clear cache 2019-08-08 13:42:43 -04:00
Nabeel S
a08c9db284 Add setting to include transfer hours in calculations (#350)
* Add setting to include transfer hours in calculations

* Add some extra tests to check versions

* A couple of more version test cases
2019-08-08 12:50:43 -04:00
Nabeel S
ff6ba4c29a Remove ext-cal from requirements list (#349)
* Remove ext-cal from requirements list

* Fix the travis phpunit config
2019-08-08 12:50:32 -04:00
Nabeel Shahzad
f6465bea58 Add error logging around metar parsing call 2019-08-07 13:25:40 -04:00
Nabeel S
5cce1b3040 Multiple ticket crash fixes (#347)
* Fix for initial seed data not being run during install closes #346

* StyleCI keepin' me honest

* Tooltips for ranks
2019-08-07 12:32:49 -04:00
Nabeel S
e12188b7d3 Issue/327 versioning (#345)
* Switch to semver format

* Rewrite new version check to use Github Releases and cron

* Styling

* Remove v from in front of version

* New version check test fix

* Uncomment test case
2019-08-06 17:48:00 -04:00
Nabeel S
092b9fc9dc Add step fields to enable decimal points on fields #342 (#343)
* Add step fields to enable decimal points on fields #342

* Update js-yaml version due to vulnerability scan

* Don't seed dev files when env == local

* Fix

* Fix  to be static

* Add visibilty keyword
2019-08-06 15:54:21 -04:00
Nabeel S
6292b05ad5 Update issue templates (#344) 2019-08-06 15:26:37 -04:00
Nabeel Shahzad
732a0c4088 Merge branch 'dev' of github.com:nabeelio/phpvms into dev 2019-08-06 07:39:41 -04:00
Nabeel S
753804b71b Issue fixes (#341)
* Better error handling around ACARS position updates

* Add step for decimals on fuel block/used fields closes #340

* Styling

* Rename AcarsController to LiveMapController; update JS dependencies
2019-08-05 13:07:22 -04:00
Nabeel S
9f3ba05880 Issue/329 refactor seeding (#337)
* Fix Contracts class names

* Refactoring of the file seeds so it's not a mess

* StyleCI fixes
2019-08-05 08:27:53 -04:00
Nabeel Shahzad
3a97071fcf Fix Contracts class names 2019-08-02 09:02:23 -04:00
Nabeel Shahzad
d4c172e734 Fix the role creation #334 2019-08-02 08:05:03 -04:00
Nabeel S
95147e31bf Fix issue where user stats aren't incremented on PIREP auto accept (#335)
* Fix issue where user stats aren't incremented on PIREP auto accept

* Formatting
2019-08-01 15:23:59 -04:00
Nabeel Shahzad
63485d5a0f Make hours and minutes fields required 2019-08-01 13:15:33 -04:00
Nabeel Shahzad
aa57997ff5 PIREP fields not showing up and blocking PIREP submission 2019-08-01 13:13:11 -04:00
Nabeel Shahzad
f31d6a00ec Remove log tail 2019-08-01 13:12:54 -04:00
Nabeel Shahzad
e307da36b5 Brute force directory creation 2019-08-01 13:12:33 -04:00
Nabeel Shahzad
be5dd68c81 Directories still not being retained #333 2019-08-01 13:04:10 -04:00
Nabeel Shahzad
e9e2e12e4e Fix avatars dir name #333 2019-08-01 12:47:17 -04:00
Nabeel S
981a5915e3 Merge pull request #331 from nabeelio/313/fuel-finances
Account for fuel in the finance calculations #313
2019-07-23 10:29:05 -04:00
Nabeel Shahzad
224cfaf603 Remove debugging that stops execution 2019-07-23 10:17:51 -04:00
Nabeel Shahzad
71f5d33af7 Formatting in FlightExporter 2019-07-23 09:42:31 -04:00
Nabeel Shahzad
70f470d64e Formatting 2019-07-23 09:08:05 -04:00
Nabeel Shahzad
fcc6295a77 Remove unused/dead code 2019-07-23 09:00:39 -04:00
Nabeel Shahzad
c5007f2928 Formatting 2019-07-23 08:43:40 -04:00
Nabeel Shahzad
62a10224a0 Account for fuel in the finance calculations #313 2019-07-23 08:41:20 -04:00
Nabeel S
ee1c8ee3fa Merge pull request #328 from nabeelio/328/pending-updates
Middleware to detect is update is pending; move Routes into HTTP
2019-07-18 11:07:22 -04:00
Nabeel Shahzad
823325d049 Styling 2019-07-18 10:54:28 -04:00
Nabeel Shahzad
b2cf7acfb6 Middleware to detect is update is pending; move Routes into HTTP 2019-07-18 10:51:05 -04:00
Nabeel Shahzad
c6547ac7fc Style fix 2019-07-18 09:55:10 -04:00
Nabeel Shahzad
748601064c Fix Validator import 2019-07-18 09:54:03 -04:00
Nabeel Shahzad
a9c5be1c70 Add opcache option; change detection during install for cache driver 2019-07-18 09:26:33 -04:00
Nabeel S
a0a6ab027f Merge pull request #325 from nabeelio/282-import-special-chars
Change exporter to use utf-8 close #282
2019-07-17 14:01:49 -04:00
Nabeel Shahzad
e97ae78e47 Fix for tests 2019-07-17 13:54:44 -04:00
Nabeel Shahzad
89a01afc7c Fix throws pathing for tests 2019-07-17 13:40:56 -04:00
Nabeel Shahzad
9475a737f0 Change exporter to use utf-8 close #282 2019-07-17 13:36:16 -04:00
Nabeel S
0225a84a81 Merge pull request #324 from nabeelio/265-editable-pilot-id
Backend changes separating id from pilot_id
2019-07-17 12:49:22 -04:00
Nabeel Shahzad
bb15119bf0 Append rules for Create/Update 2019-07-17 11:00:30 -04:00
Nabeel Shahzad
95ae3aacb3 Unique email check 2019-07-17 10:59:11 -04:00
Nabeel Shahzad
482a9cb04f formatting 2019-07-17 10:04:22 -04:00
Nabeel Shahzad
f5dcd06838 Remove the NotNull checks 2019-07-17 09:57:05 -04:00
Nabeel Shahzad
9c8c06ef28 Fix metar clouds test 2019-07-17 09:56:16 -04:00
Nabeel Shahzad
567ff91de0 Add pilot ID change fields to the admin screen 2019-07-17 09:48:20 -04:00
Nabeel Shahzad
337fe5cfaa Rename "Administration" to "Admin" 2019-07-17 08:58:10 -04:00
Nabeel Shahzad
ec81a6d157 Fix errors in the METAR parsing for clouds; display error for pressure units 2019-07-17 08:57:45 -04:00
Nabeel Shahzad
15e6226511 Fix the avatars directory #316 2019-07-17 08:56:38 -04:00
Nabeel Shahzad
80560ec20c Formatting 2019-07-16 14:06:13 -04:00
Nabeel Shahzad
3e1d9080df Backend changes separating id from pilot_id 2019-07-16 13:54:14 -04:00
Nabeel S
454776ecd4 Merge pull request #323 from nabeelio/fix/rename-interfaces
Rename Interfaces to Contracts to better match Laravel conventions
2019-07-15 15:59:34 -04:00
Nabeel Shahzad
dd946d4cdd Reorder imports 2019-07-15 15:51:35 -04:00
Nabeel Shahzad
a720f12e0b Rename Interfaces to Contracts to better match Laravel conventions 2019-07-15 15:44:31 -04:00
Nabeel S
31f16d693b Merge pull request #322 from nabeelio/fix-unit-classes
Cleanup SI Unit classes; METAR fixes
2019-07-15 15:36:54 -04:00
Nabeel Shahzad
ed91ddb5a8 Formatting again 2019-07-15 15:19:22 -04:00
Nabeel Shahzad
08a2be165c Formatting 2019-07-15 15:18:49 -04:00
Nabeel Shahzad
c04bfb78c6 Formatting 2019-07-15 15:17:51 -04:00
Nabeel Shahzad
06d8f11ca3 Cleanup SI Unit classes and interface for REST responses; fixes to a few METAR parsing issues 2019-07-15 15:14:40 -04:00
Nabeel S
466d04caf7 Merge pull request #321 from nabeelio/dependabot/npm_and_yarn/lodash-4.17.13
Bump lodash from 4.17.11 to 4.17.13
2019-07-15 08:02:10 -04:00
dependabot[bot]
02674f6ecb Bump lodash from 4.17.11 to 4.17.13
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 00:09:08 +00:00
Nabeel S
d8795e66da Merge pull request #320 from nabeelio/laravel-update
Update composer library versions
2019-07-09 08:03:17 -04:00
Nabeel Shahzad
8cdf47f7b3 Update composer library versions 2019-07-08 14:41:10 -04:00
Nabeel S
331b9133a8 Merge pull request #319 from nabeelio/issue/316-missing-folders
Add missing folders under storage/public #316
2019-07-08 13:51:53 -04:00
Nabeel Shahzad
783c06d811 Add missing folders under storage/public #316 2019-07-08 13:31:28 -04:00
Nabeel Shahzad
8a4516f1ba Remove gmp requirement from installer 2019-06-21 19:29:25 -04:00
Nabeel Shahzad
6543728478 Merge pull request #314 from nabeelio/issue/296-permissions
Add interface to additional roles/permissions #296
2019-06-21 14:51:43 -04:00
Nabeel Shahzad
54347c6706 Set default for read_only to false 2019-06-20 23:24:08 -04:00
Nabeel Shahzad
b169337fb6 Styling 2019-06-20 23:19:35 -04:00
Nabeel Shahzad
b28ace970c Add interface to additional roles/permissions 2019-06-20 16:52:37 -04:00
Nabeel Shahzad
29ca9711f8 Merge pull request #312 from nabeelio/issue/295-fuel-in-pireps
Fix pax count fields; add fuel used field #295
2019-06-19 15:14:29 -05:00
Nabeel Shahzad
313c0b0c80 Show fuel units in form 2019-06-19 16:05:29 -04:00
Nabeel Shahzad
f9ecabdccc Fix start order 2019-06-19 16:05:24 -04:00
Nabeel Shahzad
abb1eb332d styling 2019-06-19 15:30:47 -04:00
Nabeel Shahzad
faf51de9a9 Fix pax count fields; add fuel used field #295 2019-06-19 15:29:27 -04:00
Nabeel Shahzad
ae464b7601 Add stale check for github issues 2019-06-19 13:15:31 -04:00
Nabeel Shahzad
79c60d34c2 Some admin cleanup 2019-06-19 13:07:03 -04:00
Nabeel Shahzad
fb9c1c3681 Check for calendar extension in installer 2019-06-19 13:02:06 -04:00
Nabeel Shahzad
4653eb20ad don't remove the docker resources 2019-06-19 12:43:09 -04:00
Nabeel Shahzad
c7376a59f0 Move around docker storage folders/config 2019-06-19 12:41:42 -04:00
Nabeel Shahzad
09307443f9 ordering 2019-06-18 19:48:03 -04:00
Nabeel Shahzad
4259533958 Move artisan calls into the install phase 2019-06-18 19:32:05 -04:00
Nabeel Shahzad
da87a35a69 Reordering ops for travis 2019-06-18 19:30:08 -04:00
Nabeel Shahzad
7a468b2c16 Fix php-cs-fixer for build 2019-06-18 19:16:29 -04:00
Nabeel Shahzad
a39549d597 Merge pull request #311 from nabeelio/analysis-zDr9J5
Apply fixes from StyleCI
2019-06-18 17:58:33 -05:00
Nabeel Shahzad
a176ed2dae Apply fixes from StyleCI 2019-06-18 22:58:09 +00:00
Nabeel Shahzad
4ae17f65c8 Upgrade for vulnerabilities 2019-06-18 18:56:35 -04:00
Nabeel Shahzad
be441dacd9 Update for vulnerabilities 2019-06-18 18:54:19 -04:00
Nabeel Shahzad
5210c78d5e Update Laravel version 2019-06-18 18:51:56 -04:00
Nabeel Shahzad
e1bdef98d6 Keep uploaded avatar images within the same aspect ratio #309 2019-05-13 07:52:07 -05:00
Nabeel Shahzad
defd78e5c2 Add the avatars/files folders to the permissions check list 2019-05-12 23:45:07 -05:00
Nabeel Shahzad
27944b8235 don't create env/config files by default 2019-05-12 23:42:35 -05:00
Nabeel Shahzad
f0ef723854 Add blank env and config files, check those permissions in the installer 2019-05-12 18:36:41 -05:00
Nabeel Shahzad
889ed06acc Put note about permissions for directories 2019-05-12 18:33:22 -05:00
Nabeel Shahzad
267a0e21ba Merge pull request #308 from nabeelio/laravel-58
Laravel 5.8 Update
2019-05-12 18:20:34 -05:00
Nabeel Shahzad
7e461f401b Remove .php_cs from dist 2019-05-12 18:13:42 -05:00
Nabeel Shahzad
2ca1f33e68 Formatting 2019-05-12 18:05:36 -05:00
Nabeel Shahzad
dbd7c5e90b Style fixes 2019-05-12 17:49:58 -05:00
Nabeel Shahzad
d65b74d7a0 Formatting 2019-05-12 17:37:22 -05:00
Nabeel Shahzad
8d6621e2a8 Add additional rules 2019-05-12 17:25:52 -05:00
Nabeel Shahzad
88957f4071 Add php-cs-fixer to build 2019-05-12 13:26:44 -05:00
Nabeel Shahzad
75eaec2f11 phpcs standards 2019-05-12 12:08:31 -05:00
Nabeel Shahzad
a79f28caa4 Bump minimum required php version to 7.2 2019-05-12 11:40:03 -05:00
Nabeel Shahzad
25a9ca9b90 styleci fixes 2019-05-12 11:35:03 -05:00
Nabeel Shahzad
d5a3328130 Style fix 2019-05-12 11:31:48 -05:00
Nabeel Shahzad
18c5cf766d Force env vars in travis tests for phpunit 2019-05-12 11:31:16 -05:00
Nabeel Shahzad
1c935998fb Fix nginx command 2019-05-12 11:20:42 -05:00
Nabeel Shahzad
1b1cf2a891 Add redis; use alpine images 2019-05-12 10:51:06 -05:00
Nabeel Shahzad
047a72f3da Force cache to array 2019-05-12 10:50:52 -05:00
Nabeel Shahzad
87aa6ed1da Fix tests for 5.8 2019-05-12 10:50:38 -05:00
Nabeel Shahzad
7f0fb16dc3 Update to Laravel 5.8 2019-05-12 10:10:31 -05:00
Nabeel Shahzad
82f6dfbece Fix not found debug() call 2019-05-11 17:39:58 -05:00
Nabeel Shahzad
b8d4f4e5c4 Merge pull request #306 from nabeelio/issue-297/search-options
Add more search criteria/dev environment via docker-compose #297
2019-05-11 14:47:37 -05:00
Nabeel Shahzad
df814edafe Add the symfony/polyfill-iconv package 2019-05-11 14:11:15 -05:00
Nabeel Shahzad
1ec866d4dc Style fixes 2019-05-11 11:38:56 -05:00
Nabeel Shahzad
7fce5421b4 Reset the criterea before a new search 2019-05-11 11:37:06 -05:00
Nabeel Shahzad
65bd6888e8 Only mount storage folder 2019-05-11 09:20:05 -05:00
Nabeel Shahzad
2ca4393c5a Adjust tail command 2019-05-11 09:14:31 -05:00
Nabeel Shahzad
099600cf4c Fix the PHP Docker image 2019-05-10 19:46:50 -05:00
Nabeel Shahzad
4dd3fc5244 Show if there are database errors 2019-05-10 19:31:11 -05:00
Nabeel Shahzad
a90d9aac39 Save the data files locally 2019-05-10 18:55:24 -05:00
Nabeel Shahzad
81652cf70e Add swagger docs for search 2019-05-10 18:54:10 -05:00
Nabeel Shahzad
5f0db96fc4 Working docker-compose files for development 2019-05-10 18:40:07 -05:00
Nabeel Shahzad
2b45b9fd70 Fix the searchable fields 2019-05-10 16:24:34 -05:00
Nabeel Shahzad
5b061ba636 Add greater than/less than search options #297 2019-05-10 16:03:04 -05:00
Nabeel Shahzad
1dae81b707 Package updates for vulnerabilities 2019-05-08 11:31:57 -05:00
Nabeel Shahzad
3ceb5fbe5b node package vulnerability updates 2019-05-08 11:30:45 -05:00
Nabeel Shahzad
5fac731a57 Remove the github issue templates 2019-05-08 11:27:49 -05:00
Nabeel Shahzad
d00115fc1a Restrict builds to main phpvms repo 2019-05-08 11:20:43 -05:00
Nabeel Shahzad
d2c20f97fd Specify to run on all branches 2019-05-08 11:18:50 -05:00
Nabeel Shahzad
400e4854e8 Docs and matrix to strings 2019-05-08 11:17:38 -05:00
Nabeel Shahzad
12c66e2681 Install 'artifacts' from the shell script 2019-05-08 11:03:52 -05:00
Nabeel Shahzad
56c2115144 Use artifacts plugin 2019-05-08 10:50:46 -05:00
Nabeel Shahzad
de6420ad59 Configure test matrix 2019-05-08 10:41:27 -05:00
Nabeel Shahzad
93b03bb5ab Travis fixes 2019-05-08 10:36:04 -05:00
Nabeel Shahzad
86b68fb515 Add PHP 7.4 to travis 2019-05-08 10:27:05 -05:00
Nabeel Shahzad
52ed248f7d Only generate test autoloaders in dev mode 2019-05-08 07:07:24 -05:00
Nabeel Shahzad
bc58a2b076 Merge pull request #301 from nabeelio/fix/285
Add gmp to requirements in install #285
2019-05-05 09:43:41 -05:00
Nabeel Shahzad
fd96bb49f6 Add gmp to requirements in install #285 2019-04-07 22:36:17 -05:00
Nabeel Shahzad
30a53670fe Merge branch 'dev' of github.com:nabeelio/phpvms into dev 2019-04-07 22:29:13 -05:00
Nabeel Shahzad
204f3a7397 Add github issue templates 2019-04-07 22:29:00 -05:00
Nabeel Shahzad
3a6e3e0e24 Style fixes 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
3bea54136b PHPUnit version fixing 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
655dc39c63 Downgrade PHPUnit again for PHP 7.1 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
e2637ce0a7 Downgrade PHPUnit again for PHP 7.1 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
c8c3e2bb79 Update PHPUnit version 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
ec662243d8 Style fixes 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
93b738be79 Fix for phpunit on 7.1 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
54c4e017cc Add PHP 7.3 to travis build 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
1d0e6cc10e Update composer require t ype 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
29a578ea6a Move the MigrationService to the main package 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
905be6ffc3 Direct composer packages called 'phpvms-plugin' to the modules/ folder 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
2d002e5cc5 Update npm packages 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
2132b50ede Dependency updates 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
8d8857e552 Turn closure into static 2019-04-07 22:27:10 -05:00
Nabeel Shahzad
6816c77845 Cleanup array_merge call 2019-04-07 22:27:09 -05:00
Nabeel Shahzad
2f2eb2e5b2 Mark ID as fillable for ACARS 2019-04-07 22:27:09 -05:00
Nabeel Shahzad
d2257095da Remove block_time from seed file 2019-04-07 22:27:09 -05:00
Nabeel Shahzad
53d4380339 Merge pull request #300 from nabeelio/revert-299-issue-templates
Revert "Update issue templates"
2019-04-07 22:26:20 -05:00
Nabeel Shahzad
4e9ea9aa3c Revert "Update issue templates" 2019-04-07 22:26:09 -05:00
Nabeel Shahzad
a6a52ef7bb Merge pull request #299 from nabeelio/issue-templates
Update issue templates
2019-04-07 22:25:50 -05:00
Nabeel Shahzad
239483dfc4 Update issue templates 2019-04-07 22:25:27 -05:00
Nabeel Shahzad
e4b8707e34 Style fixes 2019-04-07 22:12:45 -05:00
Nabeel Shahzad
c0afb2ea8f PHPUnit version fixing 2019-04-07 21:59:12 -05:00
Nabeel Shahzad
e367bd9a2e Downgrade PHPUnit again for PHP 7.1 2019-04-07 19:46:08 -05:00
Nabeel Shahzad
62871c8a7d Downgrade PHPUnit again for PHP 7.1 2019-04-07 19:37:30 -05:00
Nabeel Shahzad
9bc6fd23b9 Update PHPUnit version 2019-04-07 19:25:06 -05:00
Nabeel Shahzad
9d762df946 Style fixes 2019-04-07 19:23:44 -05:00
Nabeel Shahzad
e48f25d0ba Fix for phpunit on 7.1 2019-04-07 19:17:44 -05:00
Nabeel Shahzad
20a6e0ffb6 Add PHP 7.3 to travis build 2019-04-07 19:10:52 -05:00
Nabeel Shahzad
4b39b44dab Update composer require t ype 2019-04-07 19:07:16 -05:00
Nabeel Shahzad
8c358948e5 Move the MigrationService to the main package 2019-04-07 18:53:24 -05:00
Nabeel Shahzad
3cafe20736 Direct composer packages called 'phpvms-plugin' to the modules/ folder 2019-04-07 18:51:34 -05:00
Nabeel Shahzad
0014a4254d Update npm packages 2019-04-07 18:51:08 -05:00
Nabeel Shahzad
9f226fe574 Dependency updates 2019-04-07 18:43:13 -05:00
Nabeel Shahzad
e23caec9f3 Turn closure into static 2019-04-07 18:09:29 -05:00
Nabeel Shahzad
64bee1b238 Cleanup array_merge call 2019-04-07 17:35:55 -05:00
Nabeel Shahzad
1b1eb1539e Mark ID as fillable for ACARS 2018-12-27 09:35:40 -06:00
Nabeel Shahzad
4bc0a786ab Remove block_time from seed file 2018-12-27 09:23:35 -06:00
1575 changed files with 97329 additions and 180397 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
vendor

26
.editorconfig Normal file
View File

@@ -0,0 +1,26 @@
#
root = true
[*.js]
indent_style = space
indent_size = 2
[*.php]
indent_style = space
indent_size = 4
[*.blade.php]
indent_style = space
indent_size = 2
[*.stub]
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
# Matches the exact files either package.json or .travis.yml
[{package.json, .travis.yml}]
indent_style = space
indent_size = 2

View File

@@ -2,13 +2,16 @@
"extends": "airbnb", "extends": "airbnb",
"env": { "env": {
"es6": true, "es6": true,
"mocha": true "browser": true
}, },
"parserOptions": { "parserOptions": {
"ecmaVersion": 8 "ecmaVersion": 8
}, },
"rules": { "rules": {
"camelcase": 0, "camelcase": 0,
"no-console": 0,
"func-names": 0,
"prefer-object-spread": 0,
"no-param-reassign": [ "no-param-reassign": [
2, 2,
{ {

30
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is. Please upload the Laravel logs as well from `storage/logs/laravel.log` (or the file with the correct date)
**Version**
Please enter the version
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context and attach logs (from `storage/logs/laravel-<date>.log`)

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

10
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
---
daysUntilStale: 60
daysUntilClose: false
exemptLabels:
- pinned
- security
exemptMilestones: true
staleLabel: wontfix
markComment: false
closeComment: false

5
.gitignore vendored
View File

@@ -1,5 +1,7 @@
_ide_helper.php _ide_helper.php
.php_cs.cache
.phpstorm.meta.php .phpstorm.meta.php
.phpunit.result.cache
/vendor /vendor
node_modules/ node_modules/
npm-debug.log npm-debug.log
@@ -27,6 +29,9 @@ env.php
#Homestead.yaml #Homestead.yaml
Homestead.json Homestead.json
LocalValetDriver.php LocalValetDriver.php
docker-compose-profiler.yml
sync.sh
.env.*
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer # Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/ .rocketeer/

View File

@@ -4,8 +4,8 @@ Options -Indexes
RewriteEngine On RewriteEngine On
# Handle Authorization Header # Handle Authorization Header
RewriteCond %{HTTP:Authorization} ^(.*) RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Deny all these files/folders # Deny all these files/folders
RedirectMatch 403 ^/.git/.*?$ RedirectMatch 403 ^/.git/.*?$
@@ -20,6 +20,7 @@ RedirectMatch 403 ^/storage/.*?$
RedirectMatch 403 ^/tests/.*?$ RedirectMatch 403 ^/tests/.*?$
RedirectMatch 403 ^/vendor/.*?$ RedirectMatch 403 ^/vendor/.*?$
RedirectMatch 403 ^/.bowerrc$ RedirectMatch 403 ^/.bowerrc$
RedirectMatch 403 ^/.env
RedirectMatch 403 ^/artisan$ RedirectMatch 403 ^/artisan$
RedirectMatch 403 ^/composer.json RedirectMatch 403 ^/composer.json
RedirectMatch 403 ^/composer.lock RedirectMatch 403 ^/composer.lock
@@ -32,12 +33,6 @@ RedirectMatch 403 ^/package.json
RedirectMatch 403 ^/package-lock.json RedirectMatch 403 ^/package-lock.json
RedirectMatch 403 ^/phpunit.xml RedirectMatch 403 ^/phpunit.xml
RedirectMatch 403 ^/webpack.mix.js RedirectMatch 403 ^/webpack.mix.js
RedirectMatch 403 ^/yarn.lock
# Redirect Trailing Slashes If Not A Folder... RewriteRule ^(.*)$ public/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

37
.php_cs Normal file
View File

@@ -0,0 +1,37 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in('app')
->in('config');
return PhpCsFixer\Config::create()
->setHideProgress(true)
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'strict_param' => true,
'no_php4_constructor' => true,
'no_extra_blank_lines' => true,
'no_superfluous_elseif' => true,
'single_line_comment_style' => false,
'simple_to_complex_string_variable' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'align_double_arrow' => true,
],
/*
'blank_line_before_statement' => [
'statements' => [
'declare',
'for',
'return',
'throw',
'try',
],
],
*/
])
->setFinder($finder);

View File

@@ -23,7 +23,6 @@ disabled:
# - unalign_equals # - unalign_equals
finder: finder:
exclude: exclude:
- modules
- node_modules - node_modules
- storage - storage
- vendor - vendor

View File

@@ -1,11 +1,21 @@
#
# Travis CI config file
#
language: php language: php
php: php:
#- '7.0' - '7.4'
- '7.1' - '7.3'
- '7.2' - '7.2'
#- nightly
#env:
# - DB=mysql
# - DB=mariadb
cache: cache:
# Cache lives for 10 min
# Default of 3m might not be long enough for all the runs
timeout: 600
directories: directories:
- "$HOME/.composer/cache" - "$HOME/.composer/cache"
- "$HOME/.npm" - "$HOME/.npm"
@@ -13,45 +23,139 @@ cache:
services: services:
- mysql - mysql
before_script: #addons:
- cp .travis/env.travis.php env.php # mariadb: '10.2'
install:
- php --version
- mysql --version
- composer install --dev --no-interaction --verbose - composer install --dev --no-interaction --verbose
- npm i tar-to-zip -g
- cp .travis/env.travis.php env.php
- cp .travis/phpunit.travis.xml phpunit.xml
before_script:
- php artisan database:create --reset
- php artisan migrate:refresh --seed
script: script:
- php artisan database:create --reset - vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
- php artisan migrate:refresh --seed - vendor/bin/phpunit --debug --verbose
- cp .travis/phpunit.travis.xml phpunit.xml
- vendor/bin/phpunit --debug --verbose
after_failure: after_failure:
- cat storage/logs/*.log - cat storage/logs/*.log
# Refer to: https://github.com/doctrine/dbal/blob/master/.travis.yml#L39
jobs: jobs:
include: include:
# Different test stages
# - stage: Test
# name: PHP 7.2 + MySQL 5.7
# php: 7.2
# env: DB=mysql
# services:
# - mysql
# - stage: Test
# name: PHP 7.3 + MySQL 5.7
# php: 7.3
# env: DB=mysql
# services:
# - mysql
# - stage: Test
# name: PHP 7.4 + MySQL 5.7
# php: 7.4
# env: DB=mysql
# services:
# - mysql
# - stage: Test
# name: PHP 7.2 + MariaDB 10.1
# php: 7.2
# env: DB=mariadb
# addons:
# mariadb: '10.1'
# - stage: Test
# name: PHP 7.3 + MariaDB 10.1
# php: 7.3
# env: DB=mariadb
# addons:
# mariadb: '10.1'
# - stage: Test
# name: PHP 7.4 + MariaDB 10.1
# php: 7.4
# env: DB=mariadb MARIADB_VERSION=10.1
# addons:
# mariadb: '10.1'
# - stage: Test
# name: PHP 7.2 + MariaDB 10.2
# php: 7.2
# env: DB=mariadb
# addons:
# mariadb: '10.2'
# - stage: Test
# name: PHP 7.3 + MariaDB 10.3
# php: 7.3
# env: DB=mariadb
# addons:
# mariadb: '10.2'
# - stage: Test
# name: PHP 7.4 + MariaDB 10.2
# php: 7.4
# env: DB=mariadb
# addons:
# mariadb: '10.2'
# - stage: Test
# name: PHP 7.2 + MariaDB 10.3
# php: 7.2
# env: DB=mariadb
# addons:
# mariadb: '10.3'
# - stage: Test
# name: PHP 7.3 + MariaDB 10.3
# php: 7.3
# env: DB=mariadb
# addons:
# mariadb: '10.3'
# - stage: Test
# name: PHP 7.4 + MariaDB 10.3
# php: 7.4
# env: DB=mariadb
# addons:
# mariadb: '10.3'
# Just packages up a release
- stage: package - stage: package
script: skip script: skip
before_deploy: before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash - curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
# Configure the conditional deployment
# https://docs.travis-ci.com/user/deployment/#examples-of-conditional-deployment
deploy: deploy:
- provider: script - provider: script
skip_cleanup: true skip_cleanup: true
script: ./.travis/deploy_script.sh script: ./.travis/deploy_script.sh
on: on:
all_branches: true all_branches: true
php: '7.1' repo: nabeelio/phpvms
php: '7.4'
tags: false
# RELEASE STAGE
# Only runs when there's a tag applied to this release (tag should be the version)
# This uses Github Releases and posts it there (provider: releases)
# https://docs.travis-ci.com/user/deployment/releases
- stage: release - stage: release
script: skip script: skip
before_deploy: before_deploy:
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash - curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
- ./.travis/deploy_script.sh - ./.travis/deploy_script.sh
deploy: deploy:
provider: releases provider: releases
skip_cleanup: true skip_cleanup: true
api_key: api_key: $GITHUB_TOKEN
secure: kAOYEThsSF8wM7vx+e+xWKhlvsNzhgKn1bk0zLBb7RLUM5pHIGKV/j0KrCNspwIUEPF0O594H6hCyswlpIZfxW2mTnmPqfbKxG/H2rLEAoOV0/MqzeC/gffxm7Eop6Sn4T/UC9kLSgqRynllbYtJDK6aWESdnvK3Fka0Cnpn7l/2phEf2J/nOF6QT/utpws1E0MUGqrKvX1/UYIu8np5e5aYLPOXnqahK8qzJFL4CyNBv+fhXuXfmOF4UbNbSPnrg/kY0QpUtFpz9ebvg5BjfMXJT0P4Q1BjgKBN76A7vz+ZfPmW6SqKv3o1yisXAgBWzylXh8B6pK+cUk4uXbagcGcIdkGOI6pQ5sLq+JOkBhVjSfogERePkt44KPif4EMsLRw/Jp4pTMy/vmgrON/jkbA+jXsOARTG5vAwIq4lyZzZXWUfirYwXeCfasgf+xTdo9C0cOE0jlqojO7SdF2CinDk9BduYpBTectea8Xx+YP5R1JCZNORDYynlLHKMW/8PJyAG+AsbcfKNTobQAfxw1nHa7GoKP1j4MSx1UtbulZdhmeRX/nUTFIvfgEDrl4cdBlt0/o5SuyN92DiCnvJZaYHcgXwYMvoqdXxBCnBKsM/1BZcykWi7Zt/q8krWYCOfCzBN4TDdmrKsEOUkCSOL9mI6gERHGmcGZN05PxU950=
file_glob: true file_glob: true
file: build/* file: build/*
on: on:
tags: true tags: true
repo: nabeelio/phpvms repo: nabeelio/phpvms
php: '7.1' php: '7.4'

View File

@@ -1,69 +1,77 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ "$TRAVIS" = "true" ]; then if [ "$TRAVIS" != "true" ]; then
exit 0
fi
cd $TRAVIS_BUILD_DIR cd $TRAVIS_BUILD_DIR
if test "$TRAVIS_TAG"; then if test "$TRAVIS_TAG"; then
PKG_NAME=$TRAVIS_TAG VERSION=$TRAVIS_TAG
else
# Pass in the tag as the version to write out
php artisan phpvms:version --write --write-full-version "${VERSION}"
FULL_VERSION=$(php artisan phpvms:version)
else
echo "On branch $TRAVIS_BRANCH" echo "On branch $TRAVIS_BRANCH"
if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then
echo "Not on valid branch, exiting" echo "Not on valid branch, exiting"
exit 0; exit 0
fi;
BASE_VERSION=`php artisan phpvms:version --base-only`
PKG_NAME=${BASE_VERSION}-${TRAVIS_BRANCH}
fi fi
FILE_NAME="phpvms-$PKG_NAME" # Write the version out but place the branch ID in there
TAR_NAME="$FILE_NAME.tar.gz" # This is only for the dev branch
echo "Writing $TAR_NAME" BASE_VERSION=$(php artisan phpvms:version --base-only)
php artisan phpvms:version --write > VERSION # This now includes the pre-release version, so "-dev" by default
VERSION=`cat VERSION` VERSION=${BASE_VERSION}
echo "Version: $VERSION"
echo "Cleaning files" # Don't pass in a version here, just write out the latest hash
php artisan phpvms:version --write "${VERSION}"
FULL_VERSION=$(php artisan phpvms:version)
fi
rm -rf vendor FILE_NAME="phpvms-${VERSION}"
composer install --no-dev --prefer-dist --no-interaction --verbose TAR_NAME="$FILE_NAME.tar.gz"
ZIP_NAME="$FILE_NAME.zip"
# Clean up the dependencies to remove some of the dev packages echo "Version: ${VERSION}"
# declare -a remove_packages=( echo "Full Version: ${FULL_VERSION}"
# 'barryvdh/laravel-ide-helper' echo "Package name: ${TAR_NAME}"
# 'bpocallaghan/generators'
# 'codedungeon/phpunit-result-printer'
# 'fzaninotto/faker'
# 'nikic/php-parser'
# 'phpstan/phpstan'
# 'phpunit/phpunit',
# 'weebly/phpstan-laravel'
# )
#
# for pkg in "${remove_packages[@]}"
# do
# composer --optimize-autoloader --no-interaction remove $pkg
# done
# Leftover individual files to delete echo "==========================="
declare -a remove_files=(
echo "Cleaning files"
rm -rf vendor
composer install --no-dev --prefer-dist --no-interaction --verbose
# Leftover individual files to delete
declare -a remove_files=(
.git .git
.github
.sass-cache .sass-cache
.idea .idea
.travis .travis
tests docker
_ide_helper.php _ide_helper.php
.dockerignore
.dpl .dpl
.editorconfig
.eslintignore .eslintignore
.eslintrc .eslintrc
.php_cs
.php_cs.cache
.phpstorm.meta.php .phpstorm.meta.php
.styleci.yml .styleci.yml
.phpunit.result.cache
env.php env.php
intellij_style.xml
config.php config.php
docker-compose.yml
Makefile Makefile
phpcs.xml
phpunit.xml phpunit.xml
phpvms.iml phpvms.iml
Procfile Procfile
@@ -71,49 +79,72 @@ if [ "$TRAVIS" = "true" ]; then
node_modules node_modules
composer.phar composer.phar
vendor/willdurand/geocoder/tests vendor/willdurand/geocoder/tests
) )
for file in "${remove_files[@]}" for file in "${remove_files[@]}"; do
do
rm -rf $file rm -rf $file
done done
find ./vendor -type d -name ".git" -print0 | xargs rm -rf find ./vendor -type d -name ".git" -print0 | xargs rm -rf
find . -type d -name "sass-cache" -print0 | xargs rm -rf find . -type d -name "sass-cache" -print0 | xargs rm -rf
# clear any app specific stuff that might have been loaded in # clear any app specific stuff that might have been loaded in
find storage/app -mindepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} + find bootstrap/cache -mindepth 1 -maxdepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/app/public -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} + find storage/app -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name public -not -name import -print0 -exec rm -rf {} +
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} + find storage/app/public -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name avatars -not -name uploads -print0 -exec rm -rf {} +
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} + find storage/app/public/avatars -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} + find storage/app/public/uploads -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} + find storage/debugbar -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/docker -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/cache -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/sessions -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/framework/views -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
find storage/logs -mindepth 1 -not -name '.gitignore' -print0 -exec rm -rf {} +
make clean mkdir -p storage/app/public/avatars
mkdir -p storage/app/public/uploads
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/framework/views
echo "Creating Tarball" # Regenerate the autoloader and classes
cd /tmp composer dump-autoload
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms make clean
sha256sum $TAR_NAME > "$TAR_NAME.sha256"
echo "Uploading to S3" cd /tmp
mkdir -p $TRAVIS_BUILD_DIR/build ls -al $TRAVIS_BUILD_DIR/../
cd $TRAVIS_BUILD_DIR/build
mv "/tmp/$TAR_NAME" "/tmp/$TAR_NAME.sha256" . tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR .
artifacts upload --target-paths "/" $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 sha256sum $TAR_NAME >"$TAR_NAME.sha256"
tar2zip $TAR_NAME
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"
# Upload the version for a tagged release. Move to a version file in different ls -al /tmp
# tags. Within phpVMS, we have an option of which version to track in the admin
if test "$TRAVIS_TAG"; then echo "Uploading to S3"
mkdir -p $TRAVIS_BUILD_DIR/build
cd $TRAVIS_BUILD_DIR/build
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256" .
artifacts upload --target-paths "/" $ZIP_NAME $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 $ZIP_NAME.sha256
# Upload the version for a tagged release. Move to a version file in different
# tags. Within phpVMS, we have an option of which version to track in the admin
if test "$TRAVIS_TAG"; then
echo "Uploading release version file" echo "Uploading release version file"
cp "$TRAVIS_BUILD_DIR/VERSION" release_version cp "$TRAVIS_BUILD_DIR/VERSION" release_version
artifacts upload --target-paths "/" release_version artifacts upload --target-paths "/" release_version
else else
echo "Uploading ${TRAVIS_BRANCH}_version file" echo "Uploading ${TRAVIS_BRANCH}_version file"
cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version
artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version
fi
curl -X POST --data "{\"content\": \"A new build is available at http://downloads.phpvms.net/$TAR_NAME ($VERSION)\"}" -H "Content-Type: application/json" $DISCORD_WEBHOOK_URL
fi fi
#if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then
# echo "Skipping Discord branch update broadcast"
#else
curl -X POST \
--data "{\"content\": \"A new build is available at http://downloads.phpvms.net/$TAR_NAME (${FULL_VERSION})\"}" \
-H "Content-Type: application/json" \
$DISCORD_WEBHOOK_URL
#fi

View File

@@ -1,14 +0,0 @@
APP_ENV=prod
APP_KEY=base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=phpvms
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=array

View File

@@ -2,29 +2,28 @@
exit(); exit();
?> ?>
APP_ENV=dev APP_ENV="dev"
APP_KEY=base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY= APP_KEY="base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY="
APP_URL=http://localhost APP_URL="http://localhost"
APP_SKIN=default APP_SKIN="default"
APP_DEBUG=true APP_DEBUG="true"
APP_LOCALE=en APP_LOCALE="en"
PHPVMS_INSTALLED=true PHPVMS_INSTALLED="true"
VACENTRAL_API_KEY=
APP_LOG=daily APP_LOG="daily"
APP_LOG_LEVEL=debug APP_LOG_LEVEL="debug"
APP_LOG_MAX_FILES=3 APP_LOG_MAX_FILES="3"
DB_CONNECTION=mysql DB_CONNECTION="mysql"
DB_HOST=127.0.0.1 DB_HOST="127.0.0.1"
DB_PORT=3306 DB_PORT="3306"
DB_DATABASE=phpvms DB_DATABASE="phpvms"
DB_USERNAME=root DB_USERNAME="root"
DB_PASSWORD= DB_PASSWORD=
CACHE_DRIVER=file CACHE_DRIVER="file"
CACHE_PREFIX= CACHE_PREFIX=
SESSION_DRIVER=file SESSION_DRIVER="file"
QUEUE_DRIVER=database QUEUE_DRIVER="database"

View File

@@ -13,6 +13,9 @@
<directory suffix="Test.php">./tests</directory> <directory suffix="Test.php">./tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<extensions>
<extension class="Tests\Bootstrap"/>
</extensions>
<filter> <filter>
<whitelist processUncoveredFilesFromWhitelist="true"> <whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory> <directory suffix=".php">./app</directory>
@@ -25,5 +28,18 @@
<ini name="error_reporting" value="E_ALL"/> <ini name="error_reporting" value="E_ALL"/>
<ini name="display_errors" value="On"/> <ini name="display_errors" value="On"/>
<ini name="display_startup_errors" value="On"/> <ini name="display_startup_errors" value="On"/>
<server name="APP_ENV" value="testing"/>
<server name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
<server name="APP_DEBUG" value="true"/>
<server name="APP_LOG_LEVEL" value="debug"/>
<server name="DB_CONNECTION" value="memory"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="QUEUE_DRIVER" value="sync"/>
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
</php> </php>
</phpunit> </phpunit>

View File

@@ -1,72 +1,706 @@
## Alpha 3 # Changelog
!! Please do a complete reinstall, with a new database ## [7.0.0-beta.4](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.4) (2020-05-09)
- Finances! The finance portions have been implemented, you can [read about them here](http://docs.phpvms.net/concepts/finances) [Full Changelog](https://github.com/nabeelio/phpvms/compare/7.0.0-beta.3...7.0.0-beta.4)
- Awards! Added the award plugin system. [see docs](http://docs.phpvms.net/customizing/awards)
- Import/Export in admin panel for aircraft, airports, expenses, fares, flights and subfleets
- Changed theme system to using [laravel-theme](https://github.com/igaster/laravel-theme), there are changes to making theming much simpler with much more flexibility.
- Added cron task for background tasks
- Expanded on flight types to match IATA SIMM format
- Added subfleet `cost_block_hour`
- Fixed several security vulnerabilities (thanks magicflyer!)
- Fuel units changed to lbs/kgs [#193](https://github.com/nabeelio/phpvms/issues/193)
- Airports can be restricted to only hubs on registration/user profile
- Cleaned up a lot unused icons and files [#195](https://github.com/nabeelio/phpvms/issues/195)
- Rank restrictions for PIREPs are respected [#170](https://github.com/nabeelio/phpvms/issues/170)
- API: Added the ability to get/update/delete user bids [#172](https://github.com/nabeelio/phpvms/issues/172)
- API: Added `block_time` parameter for PIREP prefile/update/file calls
- API: Added `block_on_time` and `block_off_time` for PIREP prefile/update/file calls
- Artisan: Added a `phpvms:csv-import [table] [file]` to import from CSV
- Artisan: Added a `phpvms:yaml-export [tables]` to export tables to YAML files which can be re-imported using `phpvms:yaml-import`
- Numerous bug fixes
## Alpha 2 (2018-02-23, v7.0.0-alpha2) **Implemented enhancements:**
!! Please do a full reinstall, with recreating the database - Move currency selection to admin settings [\#671](https://github.com/nabeelio/phpvms/issues/671)
- Center live map to custom location [\#661](https://github.com/nabeelio/phpvms/issues/661)
- Pilot Names - Pilots ID [\#656](https://github.com/nabeelio/phpvms/issues/656)
- Simbrief sample data [\#651](https://github.com/nabeelio/phpvms/issues/651)
- Simbrief only available for bids [\#642](https://github.com/nabeelio/phpvms/issues/642)
- PIREP prefile download [\#634](https://github.com/nabeelio/phpvms/issues/634)
- Importer - group imported aircraft by type [\#628](https://github.com/nabeelio/phpvms/issues/628)
- API: When looking up flight, return the load factor [\#611](https://github.com/nabeelio/phpvms/issues/611)
- API: On prefile, return required fields [\#610](https://github.com/nabeelio/phpvms/issues/610)
- Center on active flights [\#605](https://github.com/nabeelio/phpvms/issues/605)
- Profiling/performance improvments [\#602](https://github.com/nabeelio/phpvms/issues/602)
- Aircraft stats resync [\#585](https://github.com/nabeelio/phpvms/issues/585)
- Cron Job [\#553](https://github.com/nabeelio/phpvms/issues/553)
- Importing a CSV with additional airports clears all previous airports [\#490](https://github.com/nabeelio/phpvms/issues/490)
- Use continuation token instead of page/offset [\#469](https://github.com/nabeelio/phpvms/issues/469)
- Combine the Util classes in Facade and Support [\#467](https://github.com/nabeelio/phpvms/issues/467)
- ACARS/Live flight events [\#436](https://github.com/nabeelio/phpvms/issues/436)
- Allow logo upload for airline [\#417](https://github.com/nabeelio/phpvms/issues/417)
- Google Analytics Settings [\#382](https://github.com/nabeelio/phpvms/issues/382)
- Let update only be run if logged in/admin [\#372](https://github.com/nabeelio/phpvms/issues/372)
- Airport Lookup - possible additions [\#364](https://github.com/nabeelio/phpvms/issues/364)
- Set flight type for expenses for flight [\#348](https://github.com/nabeelio/phpvms/issues/348)
- Extend search schedule options [\#297](https://github.com/nabeelio/phpvms/issues/297)
- Change currency from settings \#671 [\#672](https://github.com/nabeelio/phpvms/pull/672)
- Add privatized version of name \#656 [\#658](https://github.com/nabeelio/phpvms/pull/658)
- Add Simbrief entries as sample data for load \#651 [\#652](https://github.com/nabeelio/phpvms/pull/652)
- Option for SB only on bids; add the new file type \#642 [\#643](https://github.com/nabeelio/phpvms/pull/643)
- Account ICAO for subfleet, airline/location if columns exist \#628 [\#632](https://github.com/nabeelio/phpvms/pull/632)
- Performance improvements \#602 [\#607](https://github.com/nabeelio/phpvms/pull/607)
- Center on active flights \#605 [\#606](https://github.com/nabeelio/phpvms/pull/606)
- Installer fixes, remove bcmath, fix design [\#596](https://github.com/nabeelio/phpvms/pull/596)
- Remove airport length restrictions \#590 [\#592](https://github.com/nabeelio/phpvms/pull/592)
- Remove 4 char restriction from ICAO; use decimal type for lat/lon \#590 [\#591](https://github.com/nabeelio/phpvms/pull/591)
- Recalcuate aircraft stats in nightly cron and importer \#585 \#443 [\#587](https://github.com/nabeelio/phpvms/pull/587)
- \(Importer\) Set the pay rate for the ranks \#443 [\#586](https://github.com/nabeelio/phpvms/pull/586)
- Fix rowmapper generator, check for fields, map users \#443 [\#583](https://github.com/nabeelio/phpvms/pull/583)
- Add bcmath to the required extensions list \#558 [\#564](https://github.com/nabeelio/phpvms/pull/564)
- Add the argc\_argv flag for the cgi exec \#553 [\#556](https://github.com/nabeelio/phpvms/pull/556)
- Add logo to the flights page if its set \#417 [\#550](https://github.com/nabeelio/phpvms/pull/550)
- Add additional events for PIREP states \#436 [\#548](https://github.com/nabeelio/phpvms/pull/548)
- Cleanup Utils \#467 [\#547](https://github.com/nabeelio/phpvms/pull/547)
- Add checkbox to clear previous data when importing \#490 [\#546](https://github.com/nabeelio/phpvms/pull/546)
- Distro zip file from tar file \#449 [\#543](https://github.com/nabeelio/phpvms/pull/543)
- Spanish files translation [\#542](https://github.com/nabeelio/phpvms/pull/542)
- Add link to download ACARS config from profile [\#539](https://github.com/nabeelio/phpvms/pull/539)
- Format all blade templates to 2 spaces \#530 [\#531](https://github.com/nabeelio/phpvms/pull/531)
- Add menu bar for mobile [\#529](https://github.com/nabeelio/phpvms/pull/529)
- Fix live and route map errors \#527 [\#528](https://github.com/nabeelio/phpvms/pull/528)
- Set PIREPs page to public [\#526](https://github.com/nabeelio/phpvms/pull/526)
- Try to clear caches before updating [\#522](https://github.com/nabeelio/phpvms/pull/522)
- Reduce number of queries for update check [\#520](https://github.com/nabeelio/phpvms/pull/520)
- Add getRootDomain\(\) to Utils [\#514](https://github.com/nabeelio/phpvms/pull/514)
- Search flights by subfleet \#484 [\#506](https://github.com/nabeelio/phpvms/pull/506)
- Add base Dockerfile for Dockerhub upload [\#504](https://github.com/nabeelio/phpvms/pull/504)
- Add reference to docs on doc site [\#502](https://github.com/nabeelio/phpvms/pull/502)
- Add new command to export a specific PIREP for debugging [\#501](https://github.com/nabeelio/phpvms/pull/501)
- Flight search for departure/arrival airports not using column names [\#496](https://github.com/nabeelio/phpvms/pull/496)
- Split the importer module out from the installer module [\#468](https://github.com/nabeelio/phpvms/pull/468)
- Bump minimum PHP version to 7.1, since 7.0 is already deprecated - [#166](https://github.com/nabeelio/phpvms/issues/166) **Fixed bugs:**
- Upgraded to Laravel 5.6
- Installer: Updated to create `config.php` file, to override config file values without having to modify the config files themselves
- Installer: Moved most options into the `config.php`, out of the `env.php` file
- Admin: Set the country for the airline [#191](https://github.com/nabeelio/phpvms/issues/191)
- Admin: Add ranks from the subfleet edit page
- Admin: Added flight time field to flight add/edit page
- Admin: PIREP hours can't be changed after it's no longer in a pending state
- Admin: Removed the tail number field
- DB: `airport.tz` to `airport.timezone`
- DB: Removed `aircaft.tail_number`
- DB: Decimal type field sizes shrunk to the default sizes
- DB: Removed the `raw_data` field from the PIREPs table
- API: All units expected in imperial (distance in nautical miles, fuel in lbs, mass in lbs)
- API: Added ability to add/remove bids for users
- API: Added a setting to only show aircraft that are at the departure airport of a flight [#171](https://github.com/nabeelio/phpvms/issues/171)
- API: Most calls, with exception of ACARS, are now private and require an API key to access [#173](https://github.com/nabeelio/phpvms/issues/173)
- API: Create an `/api/flight/:id/route` call to return the route information for a flight [#183](https://github.com/nabeelio/phpvms/issues/183)
- API: Allow a `fields` object to set custom PIREP fields, also returns the current values
- API: `level` not required in prefile anymore
- Setting: Restrict to aircraft that are at a flight's departure airport [#171](https://github.com/nabeelio/phpvms/issues/171)
- Setting: Implementation of filtering flights that are only at the user's current airport [#174](https://github.com/nabeelio/phpvms/issues/174)
- Templates: Add a `SKIN_NAME` template variable to reference the current skin, vs hardcoding the skin name in the templates
- Console: Added `php artisan phpvms:dev-install` command which creates the config files and creates the database/inserts sample data in one command [#176](https://github.com/nabeelio/phpvms/issues/176)
- Rank aircraft restrictions are properly working now [#170](https://github.com/nabeelio/phpvms/issues/170)
#### Fixes - Aircraft hours not counting [\#683](https://github.com/nabeelio/phpvms/issues/683)
- Error creating first user/airline [\#677](https://github.com/nabeelio/phpvms/issues/677)
- submitting PIREP: Page Not Found [\#676](https://github.com/nabeelio/phpvms/issues/676)
- Filing manual report causes SimBrief Error [\#668](https://github.com/nabeelio/phpvms/issues/668)
- Error on finance page in admin [\#667](https://github.com/nabeelio/phpvms/issues/667)
- API: User bids aren't loading SimBrief data for flight [\#664](https://github.com/nabeelio/phpvms/issues/664)
- .: Links to pilot profiles :. [\#655](https://github.com/nabeelio/phpvms/issues/655)
- Some domains \(ex, .co.uk\) not properly parsed [\#647](https://github.com/nabeelio/phpvms/issues/647)
- API: Load bids through the bids.flight fields, not the flights field on the user [\#639](https://github.com/nabeelio/phpvms/issues/639)
- Login page not using theme [\#638](https://github.com/nabeelio/phpvms/issues/638)
- CSV import error says "csv not found" [\#636](https://github.com/nabeelio/phpvms/issues/636)
- Importer - schedules not importing properly [\#630](https://github.com/nabeelio/phpvms/issues/630)
- Disable using of php opcache [\#625](https://github.com/nabeelio/phpvms/issues/625)
- API: Flight fields are an array when empty [\#618](https://github.com/nabeelio/phpvms/issues/618)
- "Pending Pireps" in admin is blank [\#616](https://github.com/nabeelio/phpvms/issues/616)
- Flight fields show all fields, not custom added ones [\#614](https://github.com/nabeelio/phpvms/issues/614)
- Mixed content causes error [\#612](https://github.com/nabeelio/phpvms/issues/612)
- Fares not appearing in API response for user/subfleets [\#608](https://github.com/nabeelio/phpvms/issues/608)
- Not selecting active for aircraft shows nullable error [\#603](https://github.com/nabeelio/phpvms/issues/603)
- Airports page repeats airport name \(infinite loop\) [\#599](https://github.com/nabeelio/phpvms/issues/599)
- Calculate Distance button not working [\#595](https://github.com/nabeelio/phpvms/issues/595)
- Support Seaports with 3 letter IATA/ID codes [\#590](https://github.com/nabeelio/phpvms/issues/590)
- Hubs only show for registration [\#580](https://github.com/nabeelio/phpvms/issues/580)
- Error when updating user in admin [\#576](https://github.com/nabeelio/phpvms/issues/576)
- Updater not working because Source repository \[github\] is not defined [\#575](https://github.com/nabeelio/phpvms/issues/575)
- Flights Page Search Subfleet Column [\#574](https://github.com/nabeelio/phpvms/issues/574)
- Duplicate key entry for ACARS data [\#572](https://github.com/nabeelio/phpvms/issues/572)
- No hint path defined for updater [\#570](https://github.com/nabeelio/phpvms/issues/570)
- My Bids Page Error [\#561](https://github.com/nabeelio/phpvms/issues/561)
- I can't change Current Theme [\#554](https://github.com/nabeelio/phpvms/issues/554)
- Pilots cannot use the dashboard or flights without admin rights [\#480](https://github.com/nabeelio/phpvms/issues/480)
- Database prefix not being applied [\#442](https://github.com/nabeelio/phpvms/issues/442)
- Install not working [\#411](https://github.com/nabeelio/phpvms/issues/411)
- typo in dependency on 'leaflet.geodesic' [\#687](https://github.com/nabeelio/phpvms/pull/687)
- Emails/notifications not sending \#675 [\#686](https://github.com/nabeelio/phpvms/pull/686)
- Aircraft hours not showing/incrementing \#683 [\#684](https://github.com/nabeelio/phpvms/pull/684)
- METAR: KM as unit in visibility \#680 [\#682](https://github.com/nabeelio/phpvms/pull/682)
- Blank/null IATA code isn't unique when added \#679 [\#681](https://github.com/nabeelio/phpvms/pull/681)
- Fix airline creation in installer \#677 [\#678](https://github.com/nabeelio/phpvms/pull/678)
- Journal not created when airline is created \#667 [\#670](https://github.com/nabeelio/phpvms/pull/670)
- Check for SB being avail before filing \#668 [\#669](https://github.com/nabeelio/phpvms/pull/669)
- Load Simbrief and flight data when getting bids \#664 [\#665](https://github.com/nabeelio/phpvms/pull/665)
- Fix pilots page not showing up \#655 [\#660](https://github.com/nabeelio/phpvms/pull/660)
- Fix PirepComment response; 201 to 200 [\#654](https://github.com/nabeelio/phpvms/pull/654)
- Domain detection failing for .co.uk, etc \#647 [\#648](https://github.com/nabeelio/phpvms/pull/648)
- Auth routes not using themes \#638 [\#645](https://github.com/nabeelio/phpvms/pull/645)
- Don't return bids by default, fix user flight column \#639 [\#640](https://github.com/nabeelio/phpvms/pull/640)
- Account for admin role, don't error out on null rows \#632 [\#637](https://github.com/nabeelio/phpvms/pull/637)
- Fix airline mapping for aircraft \#628 [\#633](https://github.com/nabeelio/phpvms/pull/633)
- Increase ID column size; seed ID generator with uniqid\(\) \#630 [\#631](https://github.com/nabeelio/phpvms/pull/631)
- Disable using apc/opcache by default if found \#625 [\#629](https://github.com/nabeelio/phpvms/pull/629)
- Fix saving of fare \#621 [\#624](https://github.com/nabeelio/phpvms/pull/624)
- API: Flight fields are an array when empty \#618 [\#619](https://github.com/nabeelio/phpvms/pull/619)
- Remove the flight fields link from admin \#614 [\#615](https://github.com/nabeelio/phpvms/pull/615)
- HTTP/HTTPS mixed content errors \#612 [\#613](https://github.com/nabeelio/phpvms/pull/613)
- Fare information not included in subfleet response \#608 [\#609](https://github.com/nabeelio/phpvms/pull/609)
- Aircraft status field blank causes error \#603 [\#604](https://github.com/nabeelio/phpvms/pull/604)
- METAR parsing infinite loop bugfix \#599 [\#600](https://github.com/nabeelio/phpvms/pull/600)
- Table prefixes not being added to indexes [\#597](https://github.com/nabeelio/phpvms/pull/597)
- Import expense and ledger entries \#443 [\#588](https://github.com/nabeelio/phpvms/pull/588)
- User country mapping; ignore unused groups \#443 [\#584](https://github.com/nabeelio/phpvms/pull/584)
- Change fuel used to optional \#512 [\#582](https://github.com/nabeelio/phpvms/pull/582)
- Respect home hubs setting for registration \#580 [\#581](https://github.com/nabeelio/phpvms/pull/581)
- Upstream null version; build version tags not being saved properly \#575 [\#578](https://github.com/nabeelio/phpvms/pull/578)
- Fix edit pilot error \(Facade\Utils missing\) \#576 [\#577](https://github.com/nabeelio/phpvms/pull/577)
- Upsert on ACARS positions \#572 [\#573](https://github.com/nabeelio/phpvms/pull/573)
- Fix the namespace path on updater templates \#570 [\#571](https://github.com/nabeelio/phpvms/pull/571)
- Route not found error for Pirep::resource\(\) call \#559 [\#565](https://github.com/nabeelio/phpvms/pull/565)
- Add extra check for $acars being set \#560 [\#563](https://github.com/nabeelio/phpvms/pull/563)
- Missing $subfleet error on bids page \#561 [\#562](https://github.com/nabeelio/phpvms/pull/562)
- Refresh theme cache on settings page load \#554 [\#557](https://github.com/nabeelio/phpvms/pull/557)
- Fix migrations when table prefix is involved \#442 [\#555](https://github.com/nabeelio/phpvms/pull/555)
- Use optional\(\) around the airport fields [\#537](https://github.com/nabeelio/phpvms/pull/537)
- PIREPS resource except for show [\#536](https://github.com/nabeelio/phpvms/pull/536)
- Fix import during flight cron \#532 [\#535](https://github.com/nabeelio/phpvms/pull/535)
- Fix PIREP edit endpoint [\#534](https://github.com/nabeelio/phpvms/pull/534)
- Add a public\_url\(\) helper \#513 [\#519](https://github.com/nabeelio/phpvms/pull/519)
- Correct text for no subfleets \#507 [\#518](https://github.com/nabeelio/phpvms/pull/518)
- Error page not showing when database isn't configured [\#517](https://github.com/nabeelio/phpvms/pull/517)
- Check user permissions on the routes \#508 [\#516](https://github.com/nabeelio/phpvms/pull/516)
- Show admin dropdown for admin-access ability [\#515](https://github.com/nabeelio/phpvms/pull/515)
- New subfleet not being attached to an airline on import \#479 [\#505](https://github.com/nabeelio/phpvms/pull/505)
- Importing not updating existing items \#486 [\#503](https://github.com/nabeelio/phpvms/pull/503)
- Set a default model value for airports on PIREP [\#500](https://github.com/nabeelio/phpvms/pull/500)
- Fix GeoService errors when viewing PIREP \#498 [\#499](https://github.com/nabeelio/phpvms/pull/499)
- Properly set the distance/planned\_distance [\#497](https://github.com/nabeelio/phpvms/pull/497)
- 491 Installation Error [\#495](https://github.com/nabeelio/phpvms/pull/495)
- Return the flight fares if there are no subfleet fares \#488 [\#489](https://github.com/nabeelio/phpvms/pull/489)
- Error if there are no roles when editing a user \#480 [\#483](https://github.com/nabeelio/phpvms/pull/483)
- Allow nullable field and calculate distance if nulled [\#482](https://github.com/nabeelio/phpvms/pull/482)
- Pilots cannot use the dashboard or flights without admin rights [\#481](https://github.com/nabeelio/phpvms/pull/481)
- Fix BindingResolutionError when debug toolbar isn't present [\#465](https://github.com/nabeelio/phpvms/pull/465)
- Fix CSV imports giving Storage class not found \#454 [\#462](https://github.com/nabeelio/phpvms/pull/462)
- Use PhpExecutableFinder\(\) closes \#457 \#458 [\#460](https://github.com/nabeelio/phpvms/pull/460)
- Avoid proc\_open use \#455 [\#456](https://github.com/nabeelio/phpvms/pull/456)
- Stricter checks on ACARS API data [\#451](https://github.com/nabeelio/phpvms/pull/451)
- Remove bootstrap cache [\#448](https://github.com/nabeelio/phpvms/pull/448)
- PIREP fields being set when filing manually is working **Closed issues:**
- ACARS data wasn't being ordered properly, causing issues on the map [77055991](https://github.com/nabeelio/phpvms/commit/77055991af36877552e1921466987d3066774d6b)
- Field for the rank's image changed to string input [b5dbde8](https://github.com/nabeelio/phpvms/commit/b5dbde84c4c786799f474117381b8227642f0777)
- Set a default value for a setting [#106](https://github.com/nabeelio/phpvms/issues/106)
- Admin: Rank image field fixed
- API: Only active airlines are returned
- API; Return errors if user isn't allowed on the submitted aircraft [#170](https://github.com/nabeelio/phpvms/issues/170)
- API: Fixed typo from `subfleet` to `subfleets` in the `/api/flights` call(s) [f6b2102](https://github.com/nabeelio/phpvms/commit/f6b2102e4827da6177eb4eee0c3ce0d38eb78ce3)
- API: Wrapped all calls in a `data` field
- API: `planned_distance` and `planned_flight_time` fields are now optional
- Setting: Subfleets returned in the flight calls respect the `pireps.restrict_aircraft_to_rank` setting [#170](https://github.com/nabeelio/phpvms/issues/170)
------ - Dashboard error when METAR visibility in KM [\#680](https://github.com/nabeelio/phpvms/issues/680)
- Error adding multiple airlines without IATA codes [\#679](https://github.com/nabeelio/phpvms/issues/679)
- Pages [\#641](https://github.com/nabeelio/phpvms/issues/641)
- Create a "fare type" for cargo [\#621](https://github.com/nabeelio/phpvms/issues/621)
- Split Sample module out into separate repo [\#593](https://github.com/nabeelio/phpvms/issues/593)
- No way to add files to fleet [\#567](https://github.com/nabeelio/phpvms/issues/567)
- Map Center Coords [\#566](https://github.com/nabeelio/phpvms/issues/566)
- Pilot Profile Page Error [\#560](https://github.com/nabeelio/phpvms/issues/560)
- File New Pirep [\#559](https://github.com/nabeelio/phpvms/issues/559)
- I can't add new flight [\#558](https://github.com/nabeelio/phpvms/issues/558)
- Pilot Pay route modifier [\#487](https://github.com/nabeelio/phpvms/issues/487)
- Auto-update [\#449](https://github.com/nabeelio/phpvms/issues/449)
- Setting to not automatically calculate distances [\#446](https://github.com/nabeelio/phpvms/issues/446)
- Classic importer [\#443](https://github.com/nabeelio/phpvms/issues/443)
- SimBrief integration - pirep prefile [\#405](https://github.com/nabeelio/phpvms/issues/405)
- PIREP rejection doesn't move pilot back to previous airport [\#392](https://github.com/nabeelio/phpvms/issues/392)
- Load Factor for flights [\#352](https://github.com/nabeelio/phpvms/issues/352)
## Alpha 1 (2018-02-04, v7.0.0-alpha1) **Merged pull requests:**
- Initial Release - Upgrade packages with security alerts [\#653](https://github.com/nabeelio/phpvms/pull/653)
- Add public/private pages \#641 [\#644](https://github.com/nabeelio/phpvms/pull/644)
- SimBrief integration \#405 [\#635](https://github.com/nabeelio/phpvms/pull/635)
- Add fare type for pax/cargo/mixed flights \#621 [\#623](https://github.com/nabeelio/phpvms/pull/623)
- Add fixed pilot pay for a flight \#487 [\#622](https://github.com/nabeelio/phpvms/pull/622)
- Add load factor and variance to flights \#352 [\#620](https://github.com/nabeelio/phpvms/pull/620)
- Module/plugin installation working \#593 [\#594](https://github.com/nabeelio/phpvms/pull/594)
- Add Google Analytics tracking ID to settings and to main template \#382 [\#551](https://github.com/nabeelio/phpvms/pull/551)
- Set expenses on specific flight types \#348 [\#549](https://github.com/nabeelio/phpvms/pull/549)
- Auto update \#449 [\#545](https://github.com/nabeelio/phpvms/pull/545)
- Auto-update functionality \#449 [\#544](https://github.com/nabeelio/phpvms/pull/544)
- ACARS XML config file download [\#540](https://github.com/nabeelio/phpvms/pull/540)
- Make the fuel used optional [\#512](https://github.com/nabeelio/phpvms/pull/512)
- Add PHP 7.4 support [\#464](https://github.com/nabeelio/phpvms/pull/464)
- Replace importer with AJAX powered; better error handling \#443 [\#447](https://github.com/nabeelio/phpvms/pull/447)
- Fix missing newsRepo variable [\#445](https://github.com/nabeelio/phpvms/pull/445)
- Refactor and add importer to Installer module \#443 [\#444](https://github.com/nabeelio/phpvms/pull/444)
- 391 Notification refactorings [\#441](https://github.com/nabeelio/phpvms/pull/441)
## [7.0.0-beta.3](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.3) (2020-02-08)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/7.0.0-beta.2...7.0.0-beta.3)
**Implemented enhancements:**
- Fix formatting in blade files [\#530](https://github.com/nabeelio/phpvms/issues/530)
- Make PIREP view page public [\#525](https://github.com/nabeelio/phpvms/issues/525)
- Fix map line colors [\#523](https://github.com/nabeelio/phpvms/issues/523)
- Null-able fuel values on PIREP [\#510](https://github.com/nabeelio/phpvms/issues/510)
- include subfleet in search options [\#484](https://github.com/nabeelio/phpvms/issues/484)
- PHP 7.4 in Travis [\#463](https://github.com/nabeelio/phpvms/issues/463)
- Move cron problem report to main page [\#458](https://github.com/nabeelio/phpvms/issues/458)
**Fixed bugs:**
- Method GET for /pireps/\<id\>/edit not supported [\#533](https://github.com/nabeelio/phpvms/issues/533)
- Cron error for removing expired flights [\#532](https://github.com/nabeelio/phpvms/issues/532)
- Live map marker click not working [\#527](https://github.com/nabeelio/phpvms/issues/527)
- Redirect to installer properly [\#513](https://github.com/nabeelio/phpvms/issues/513)
- Admin panel link not shown for users in role group [\#509](https://github.com/nabeelio/phpvms/issues/509)
- Users without "admin" role can modify roles [\#508](https://github.com/nabeelio/phpvms/issues/508)
- Edit flights page - text error [\#507](https://github.com/nabeelio/phpvms/issues/507)
- Installation error with external databases [\#494](https://github.com/nabeelio/phpvms/issues/494)
- Pirep not in KG [\#493](https://github.com/nabeelio/phpvms/issues/493)
- Installation Error step2 [\#491](https://github.com/nabeelio/phpvms/issues/491)
- Fares assigned to flights not working/overwritten by Subfleet [\#488](https://github.com/nabeelio/phpvms/issues/488)
- Status not changing when importing CSV for aircraft [\#486](https://github.com/nabeelio/phpvms/issues/486)
- Default Theme unusable on Mobile [\#485](https://github.com/nabeelio/phpvms/issues/485)
- Fatal Error in subfleet page when importing routes with new aircraft [\#479](https://github.com/nabeelio/phpvms/issues/479)
- Flights CSV import fails if no distance stipulated [\#478](https://github.com/nabeelio/phpvms/issues/478)
- Subfleet CSV import [\#476](https://github.com/nabeelio/phpvms/issues/476)
- Cron - DateTime::construct\(\) expects parameter 2 to be DateTimeZone, int given [\#461](https://github.com/nabeelio/phpvms/issues/461)
- if PHP\_CLI not found in cron maintenance, put generic `php` exec there [\#457](https://github.com/nabeelio/phpvms/issues/457)
- Importing schedule bug [\#454](https://github.com/nabeelio/phpvms/issues/454)
- The updater/installer should clear all caches [\#408](https://github.com/nabeelio/phpvms/issues/408)
**Closed issues:**
- Error 500 when trying to access Dashboard. [\#498](https://github.com/nabeelio/phpvms/issues/498)
- Import multiple aircraft of different subtypes in one sheet [\#477](https://github.com/nabeelio/phpvms/issues/477)
- Split out installer/importer from updater [\#453](https://github.com/nabeelio/phpvms/issues/453)
- ACARS update fields can be nulled [\#450](https://github.com/nabeelio/phpvms/issues/450)
- Retryable HTTP client [\#430](https://github.com/nabeelio/phpvms/issues/430)
- Pireps page: 'Pending' doesn't show pending PIREPs [\#427](https://github.com/nabeelio/phpvms/issues/427)
- Email when news sent out [\#391](https://github.com/nabeelio/phpvms/issues/391)
- Save cron last run time [\#386](https://github.com/nabeelio/phpvms/issues/386)
**Merged pull requests:**
- 7.0.0-beta3 Release [\#541](https://github.com/nabeelio/phpvms/pull/541)
## [7.0.0-beta.2](https://github.com/nabeelio/phpvms/tree/7.0.0-beta.2) (2019-11-19)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-beta...7.0.0-beta.2)
**Implemented enhancements:**
- CSS Love needed for the Flights Page [\#418](https://github.com/nabeelio/phpvms/issues/418)
- Add Subfleet, Custom Fields and Fares during initial schedule entry [\#410](https://github.com/nabeelio/phpvms/issues/410)
- PIREP from flight/bid; orig: Bid not removed after flight accepted [\#406](https://github.com/nabeelio/phpvms/issues/406)
- Auto airport lookup [\#404](https://github.com/nabeelio/phpvms/issues/404)
- API Changes [\#389](https://github.com/nabeelio/phpvms/issues/389)
- "Maintenance" section in admin [\#376](https://github.com/nabeelio/phpvms/issues/376)
- Auto-calculate Distance on Add Flight page [\#355](https://github.com/nabeelio/phpvms/issues/355)
- Change PIREP fuel field type [\#340](https://github.com/nabeelio/phpvms/issues/340)
- Fuel in pireps [\#295](https://github.com/nabeelio/phpvms/issues/295)
- Add field to set aircraft location [\#277](https://github.com/nabeelio/phpvms/issues/277)
- Suggestion: edit pilot ID [\#265](https://github.com/nabeelio/phpvms/issues/265)
- Combine subfleet and aircraft export [\#233](https://github.com/nabeelio/phpvms/issues/233)
- Allow URL for downloads [\#229](https://github.com/nabeelio/phpvms/issues/229)
- Move settings into database seeder [\#224](https://github.com/nabeelio/phpvms/issues/224)
- Allow specifying transfer hours on registration [\#129](https://github.com/nabeelio/phpvms/issues/129)
- Backend changes separating id from pilot\_id [\#324](https://github.com/nabeelio/phpvms/pull/324)
**Fixed bugs:**
- Flight ID's and Airport ICAO's not clickable on airport page [\#419](https://github.com/nabeelio/phpvms/issues/419)
- Distance lookup needs bcmath extension [\#407](https://github.com/nabeelio/phpvms/issues/407)
- Missing flight level field on frontend [\#401](https://github.com/nabeelio/phpvms/issues/401)
- Set distance to 0 if no value [\#400](https://github.com/nabeelio/phpvms/issues/400)
- Upload livery via admin [\#398](https://github.com/nabeelio/phpvms/issues/398)
- Block deleting airline if there are assets associated with it [\#367](https://github.com/nabeelio/phpvms/issues/367)
- Cron not calculating number of flights [\#357](https://github.com/nabeelio/phpvms/issues/357)
- Error Seeing data of pilot profile [\#351](https://github.com/nabeelio/phpvms/issues/351)
- Fresh install doesn't create rank [\#346](https://github.com/nabeelio/phpvms/issues/346)
- Fuel cost only allows whole numbers for price [\#342](https://github.com/nabeelio/phpvms/issues/342)
- API calls in subfolder going to root domain [\#339](https://github.com/nabeelio/phpvms/issues/339)
- Errors versión 7.0.0 \(compilación 181025-6f7735\) [\#332](https://github.com/nabeelio/phpvms/issues/332)
- Error on Install [\#303](https://github.com/nabeelio/phpvms/issues/303)
- Having a "Error 505" when trying to install PHPVMS [\#302](https://github.com/nabeelio/phpvms/issues/302)
- Error when viewing profile or trying to add flights [\#291](https://github.com/nabeelio/phpvms/issues/291)
- "Hubs as home airport" doesn't work [\#288](https://github.com/nabeelio/phpvms/issues/288)
- Undocumented Extension Required - PHP 7.2 GMP [\#285](https://github.com/nabeelio/phpvms/issues/285)
- ErrorException Trying to get property 'name' of non-object [\#281](https://github.com/nabeelio/phpvms/issues/281)
**Closed issues:**
- Add settings.yaml changes to update available check [\#437](https://github.com/nabeelio/phpvms/issues/437)
- Write current version to DB [\#428](https://github.com/nabeelio/phpvms/issues/428)
- Message for configuring cron [\#424](https://github.com/nabeelio/phpvms/issues/424)
- Opt in for telemetry on install [\#415](https://github.com/nabeelio/phpvms/issues/415)
- Error when saving a PIREP without filling some fields and attempting to edit it [\#414](https://github.com/nabeelio/phpvms/issues/414)
- Update htaccess file [\#412](https://github.com/nabeelio/phpvms/issues/412)
- Allow typing in drop down menus [\#409](https://github.com/nabeelio/phpvms/issues/409)
- Malformed email error on file [\#402](https://github.com/nabeelio/phpvms/issues/402)
- Residual design issues from Bootstrap update [\#397](https://github.com/nabeelio/phpvms/issues/397)
- Don't allow PIREP cancel if not in PENDING phase [\#395](https://github.com/nabeelio/phpvms/issues/395)
- Pageable Criteria [\#390](https://github.com/nabeelio/phpvms/issues/390)
- Update CSS Libraries [\#387](https://github.com/nabeelio/phpvms/issues/387)
- Laravel 6 [\#384](https://github.com/nabeelio/phpvms/issues/384)
- Profile menu dropdown [\#383](https://github.com/nabeelio/phpvms/issues/383)
- Update vaCentral Library [\#380](https://github.com/nabeelio/phpvms/issues/380)
- Implement Laravel 5.7 Notifications [\#378](https://github.com/nabeelio/phpvms/issues/378)
- Generate random cache prefix on install [\#374](https://github.com/nabeelio/phpvms/issues/374)
- Move transaction/journal code out of controller [\#370](https://github.com/nabeelio/phpvms/issues/370)
- Add Contract for Airport information lookup [\#363](https://github.com/nabeelio/phpvms/issues/363)
- RFC7807 - Standardize API error messages [\#361](https://github.com/nabeelio/phpvms/issues/361)
- Imposible delete bid [\#360](https://github.com/nabeelio/phpvms/issues/360)
- Change theme from settings [\#359](https://github.com/nabeelio/phpvms/issues/359)
- Integration with PACX \[Feature\] [\#338](https://github.com/nabeelio/phpvms/issues/338)
- Why don't you create a free ACARS for PHPVMS7 testing? [\#336](https://github.com/nabeelio/phpvms/issues/336)
- Error add Roles [\#334](https://github.com/nabeelio/phpvms/issues/334)
- Error during installation [\#333](https://github.com/nabeelio/phpvms/issues/333)
- spatie - laravel-backup [\#330](https://github.com/nabeelio/phpvms/issues/330)
- Refactor data seeding [\#329](https://github.com/nabeelio/phpvms/issues/329)
- Notify/download latest version file as part of cron [\#327](https://github.com/nabeelio/phpvms/issues/327)
- Notify if migration/updates are pending [\#326](https://github.com/nabeelio/phpvms/issues/326)
- PIREP ID change [\#318](https://github.com/nabeelio/phpvms/issues/318)
- Missing folders on install [\#316](https://github.com/nabeelio/phpvms/issues/316)
- Pull in VMACars plugin [\#315](https://github.com/nabeelio/phpvms/issues/315)
- Account for fuel in the finances [\#313](https://github.com/nabeelio/phpvms/issues/313)
- Show module in the external website [\#310](https://github.com/nabeelio/phpvms/issues/310)
- Profile picture distorted [\#309](https://github.com/nabeelio/phpvms/issues/309)
- Implement cachable in models [\#307](https://github.com/nabeelio/phpvms/issues/307)
- update [\#305](https://github.com/nabeelio/phpvms/issues/305)
- Error with installer - Permission denied [\#298](https://github.com/nabeelio/phpvms/issues/298)
- No Staff Groups/ Authorised Permissions [\#296](https://github.com/nabeelio/phpvms/issues/296)
- .css and .js 404 [\#294](https://github.com/nabeelio/phpvms/issues/294)
- Error on Install [\#292](https://github.com/nabeelio/phpvms/issues/292)
- Ability to change interval of cron jobs [\#289](https://github.com/nabeelio/phpvms/issues/289)
- ACARS api add response [\#287](https://github.com/nabeelio/phpvms/issues/287)
- No bids returned in json [\#286](https://github.com/nabeelio/phpvms/issues/286)
- Importing \*.csv with special characters [\#282](https://github.com/nabeelio/phpvms/issues/282)
- laravel-theme doesn't seem to be respecting the theme.json extends [\#279](https://github.com/nabeelio/phpvms/issues/279)
- Flight for current location not being restricted [\#263](https://github.com/nabeelio/phpvms/issues/263)
- Self diagnosis [\#253](https://github.com/nabeelio/phpvms/issues/253)
- Add /api/pireps/validate endpoint [\#247](https://github.com/nabeelio/phpvms/issues/247)
- Cosmetic issues [\#245](https://github.com/nabeelio/phpvms/issues/245)
- GDPR Compliance [\#244](https://github.com/nabeelio/phpvms/issues/244)
- Read all settings into the page session [\#243](https://github.com/nabeelio/phpvms/issues/243)
- Open Airspace [\#241](https://github.com/nabeelio/phpvms/issues/241)
- Option to cancel PIREP [\#238](https://github.com/nabeelio/phpvms/issues/238)
- Navdata sources [\#231](https://github.com/nabeelio/phpvms/issues/231)
- Refactor export, use streamed response [\#227](https://github.com/nabeelio/phpvms/issues/227)
- Add expense multiplier to subfleet [\#206](https://github.com/nabeelio/phpvms/issues/206)
- Expenses [\#136](https://github.com/nabeelio/phpvms/issues/136)
- Finances [\#130](https://github.com/nabeelio/phpvms/issues/130)
- phpVMS Classic Importer [\#114](https://github.com/nabeelio/phpvms/issues/114)
- Setup cron tasks [\#95](https://github.com/nabeelio/phpvms/issues/95)
- Warning in admin if Installer module is still present [\#77](https://github.com/nabeelio/phpvms/issues/77)
- flight planning [\#60](https://github.com/nabeelio/phpvms/issues/60)
**Merged pull requests:**
- Merge 7.0.0-beta.2 to master [\#440](https://github.com/nabeelio/phpvms/pull/440)
- Refactor the upgrade pending check to see if there are settings/permi… [\#438](https://github.com/nabeelio/phpvms/pull/438)
- Fixes [\#435](https://github.com/nabeelio/phpvms/pull/435)
- \#406 Refactor bids [\#432](https://github.com/nabeelio/phpvms/pull/432)
- fixes for issue \#419 [\#429](https://github.com/nabeelio/phpvms/pull/429)
- Wrap values in travis env [\#426](https://github.com/nabeelio/phpvms/pull/426)
- Show a message about setting up the cron and if there was an error ru… [\#425](https://github.com/nabeelio/phpvms/pull/425)
- 359 Select theme in settings [\#423](https://github.com/nabeelio/phpvms/pull/423)
- Fix blank aircraft field causing error closes \#414 [\#422](https://github.com/nabeelio/phpvms/pull/422)
- Bundle CSS changes [\#421](https://github.com/nabeelio/phpvms/pull/421)
- Some minor CSS fixes as discussed on Discord [\#420](https://github.com/nabeelio/phpvms/pull/420)
- Move telemetry option into settings; checkbox in install refs \#415 [\#416](https://github.com/nabeelio/phpvms/pull/416)
- Issue fixes [\#413](https://github.com/nabeelio/phpvms/pull/413)
- Catch error messages in notifying [\#403](https://github.com/nabeelio/phpvms/pull/403)
- Design and file upload issues [\#399](https://github.com/nabeelio/phpvms/pull/399)
- Don't allow cancels from certain states [\#396](https://github.com/nabeelio/phpvms/pull/396)
- Fix map checkout call [\#394](https://github.com/nabeelio/phpvms/pull/394)
- 389 API Changes [\#393](https://github.com/nabeelio/phpvms/pull/393)
- CSS Libraries and style updates [\#388](https://github.com/nabeelio/phpvms/pull/388)
- 384 Laravel 6 changes [\#385](https://github.com/nabeelio/phpvms/pull/385)
- 380 vacentral library [\#381](https://github.com/nabeelio/phpvms/pull/381)
- Use Notification/Notifiable [\#379](https://github.com/nabeelio/phpvms/pull/379)
- Add maintenance section to admin, clear caches \#376 [\#377](https://github.com/nabeelio/phpvms/pull/377)
- Refactor all JS API calls \#360 [\#375](https://github.com/nabeelio/phpvms/pull/375)
- Set the baseURL for ajax requests [\#373](https://github.com/nabeelio/phpvms/pull/373)
- Move airline transaction code into service layer [\#371](https://github.com/nabeelio/phpvms/pull/371)
- 229 url for downloads [\#369](https://github.com/nabeelio/phpvms/pull/369)
- \#355 Calculate distance button [\#366](https://github.com/nabeelio/phpvms/pull/366)
- Add Contract interface for airport lookup functionality [\#365](https://github.com/nabeelio/phpvms/pull/365)
- Refactor error handling internally to follow RFC7807 [\#362](https://github.com/nabeelio/phpvms/pull/362)
- Additional logging for the stats recalculation [\#358](https://github.com/nabeelio/phpvms/pull/358)
- Add missing expiry time for PIREP API [\#356](https://github.com/nabeelio/phpvms/pull/356)
- Fix/metar reading [\#354](https://github.com/nabeelio/phpvms/pull/354)
- Fix/metar reading [\#353](https://github.com/nabeelio/phpvms/pull/353)
- Add setting to include transfer hours in calculations [\#350](https://github.com/nabeelio/phpvms/pull/350)
- Remove ext-cal from requirements list [\#349](https://github.com/nabeelio/phpvms/pull/349)
- Multiple ticket crash fixes [\#347](https://github.com/nabeelio/phpvms/pull/347)
- Issue/327 versioning [\#345](https://github.com/nabeelio/phpvms/pull/345)
- Update issue templates [\#344](https://github.com/nabeelio/phpvms/pull/344)
- Add step fields to enable decimal points on fields \#342 [\#343](https://github.com/nabeelio/phpvms/pull/343)
- Issue fixes [\#341](https://github.com/nabeelio/phpvms/pull/341)
- Issue/329 refactor seeding [\#337](https://github.com/nabeelio/phpvms/pull/337)
- Fix issue where user stats aren't incremented on PIREP auto accept [\#335](https://github.com/nabeelio/phpvms/pull/335)
- Account for fuel in the finance calculations \#313 [\#331](https://github.com/nabeelio/phpvms/pull/331)
- Middleware to detect is update is pending; move Routes into HTTP [\#328](https://github.com/nabeelio/phpvms/pull/328)
- Change exporter to use utf-8 close \#282 [\#325](https://github.com/nabeelio/phpvms/pull/325)
- Rename Interfaces to Contracts to better match Laravel conventions [\#323](https://github.com/nabeelio/phpvms/pull/323)
- Cleanup SI Unit classes; METAR fixes [\#322](https://github.com/nabeelio/phpvms/pull/322)
- Bump lodash from 4.17.11 to 4.17.13 [\#321](https://github.com/nabeelio/phpvms/pull/321)
- Update composer library versions [\#320](https://github.com/nabeelio/phpvms/pull/320)
- Add missing folders under storage/public \#316 [\#319](https://github.com/nabeelio/phpvms/pull/319)
- Add interface to additional roles/permissions \#296 [\#314](https://github.com/nabeelio/phpvms/pull/314)
- Fix pax count fields; add fuel used field \#295 [\#312](https://github.com/nabeelio/phpvms/pull/312)
- Apply fixes from StyleCI [\#311](https://github.com/nabeelio/phpvms/pull/311)
- Laravel 5.8 Update [\#308](https://github.com/nabeelio/phpvms/pull/308)
- Add more search criteria/dev environment via docker-compose \#297 [\#306](https://github.com/nabeelio/phpvms/pull/306)
- Add gmp to requirements in install \#285 [\#301](https://github.com/nabeelio/phpvms/pull/301)
- Revert "Update issue templates" [\#300](https://github.com/nabeelio/phpvms/pull/300)
- Update issue templates [\#299](https://github.com/nabeelio/phpvms/pull/299)
## [v7.0.0-beta](https://github.com/nabeelio/phpvms/tree/v7.0.0-beta) (2018-10-25)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-alpha2...v7.0.0-beta)
**Implemented enhancements:**
- Follow flight checkbox on live map [\#246](https://github.com/nabeelio/phpvms/issues/246)
- PIREP restrictions based on settings [\#221](https://github.com/nabeelio/phpvms/issues/221)
- Save PIREP as draft [\#220](https://github.com/nabeelio/phpvms/issues/220)
- Shorten fields on flights table [\#205](https://github.com/nabeelio/phpvms/issues/205)
- Show bids in profile [\#203](https://github.com/nabeelio/phpvms/issues/203)
- Don't change rank if current rank is higher than the one found [\#196](https://github.com/nabeelio/phpvms/issues/196)
- pagination sizes [\#162](https://github.com/nabeelio/phpvms/issues/162)
- Allow overriding templates [\#161](https://github.com/nabeelio/phpvms/issues/161)
- Replace old pjax library with newer one [\#133](https://github.com/nabeelio/phpvms/issues/133)
- Awards [\#113](https://github.com/nabeelio/phpvms/issues/113)
- Setting to restrict airport selection to hubs [\#104](https://github.com/nabeelio/phpvms/issues/104)
- Pilot leave status [\#96](https://github.com/nabeelio/phpvms/issues/96)
- schedule import [\#15](https://github.com/nabeelio/phpvms/issues/15)
**Fixed bugs:**
- Error saving PIREP [\#252](https://github.com/nabeelio/phpvms/issues/252)
- Updater with modules not working [\#249](https://github.com/nabeelio/phpvms/issues/249)
- User registration country and timezone not saving [\#223](https://github.com/nabeelio/phpvms/issues/223)
- Importer inserts invalid data on empty columns/rows [\#222](https://github.com/nabeelio/phpvms/issues/222)
- Import/export - missing fields [\#219](https://github.com/nabeelio/phpvms/issues/219)
- Country flag not showing on user list [\#218](https://github.com/nabeelio/phpvms/issues/218)
- fares/subfleet unique field blocks saving [\#214](https://github.com/nabeelio/phpvms/issues/214)
- module navigation not working \(admin\) [\#201](https://github.com/nabeelio/phpvms/issues/201)
- Bid not removed when pirep if filled [\#200](https://github.com/nabeelio/phpvms/issues/200)
- Not saving Flight Time [\#199](https://github.com/nabeelio/phpvms/issues/199)
**Closed issues:**
- SettingsController/Repo are saving as "on" instead of 1/true [\#272](https://github.com/nabeelio/phpvms/issues/272)
- Auto Accept New Pilot isn't working [\#269](https://github.com/nabeelio/phpvms/issues/269)
- Suggestion: button to copy aircraft [\#267](https://github.com/nabeelio/phpvms/issues/267)
- Combine aircraft and subfleet import/export into one [\#256](https://github.com/nabeelio/phpvms/issues/256)
- cron - recalculate hours [\#254](https://github.com/nabeelio/phpvms/issues/254)
- Install Directory is missing from git repo [\#251](https://github.com/nabeelio/phpvms/issues/251)
- Warning: require\(C:\xampp\Virtual Airline Website\bootstrap/../vendor/autoload.php\): failed to open stream: No such file or directory in C:\xampp\Virtual Airline Website\bootstrap\autoload.php on line 17 [\#248](https://github.com/nabeelio/phpvms/issues/248)
- Settings [\#239](https://github.com/nabeelio/phpvms/issues/239)
- HTTP caching [\#237](https://github.com/nabeelio/phpvms/issues/237)
- Module artisan command bug [\#234](https://github.com/nabeelio/phpvms/issues/234)
- Add /api/news [\#232](https://github.com/nabeelio/phpvms/issues/232)
- Start date/end date, along with day of week options [\#230](https://github.com/nabeelio/phpvms/issues/230)
- Replace weather lookup [\#228](https://github.com/nabeelio/phpvms/issues/228)
- File/avatar uploads [\#226](https://github.com/nabeelio/phpvms/issues/226)
- Change fleet page to load subfleets first [\#217](https://github.com/nabeelio/phpvms/issues/217)
- Add sort options [\#216](https://github.com/nabeelio/phpvms/issues/216)
- Auto loader on Line 17 [\#215](https://github.com/nabeelio/phpvms/issues/215)
- Add flight fields [\#213](https://github.com/nabeelio/phpvms/issues/213)
- Recaptcha in registration [\#212](https://github.com/nabeelio/phpvms/issues/212)
- Browser tests [\#211](https://github.com/nabeelio/phpvms/issues/211)
- Axios HTTP library [\#210](https://github.com/nabeelio/phpvms/issues/210)
- Replace skinning with laravel-theme [\#209](https://github.com/nabeelio/phpvms/issues/209)
- Refactor getting expenses in FinanceData [\#208](https://github.com/nabeelio/phpvms/issues/208)
- Change all money to hold in cents, not dollars [\#204](https://github.com/nabeelio/phpvms/issues/204)
- Pilot pay - rank base and subfleet multiplier [\#197](https://github.com/nabeelio/phpvms/issues/197)
- Flight schedule importer/exporter [\#194](https://github.com/nabeelio/phpvms/issues/194)
- use find/replace in bootstrapWith\(\) call [\#163](https://github.com/nabeelio/phpvms/issues/163)
- Awards [\#155](https://github.com/nabeelio/phpvms/issues/155)
- System Changes/Additions [\#135](https://github.com/nabeelio/phpvms/issues/135)
- Airport & Aircraft Changes [\#134](https://github.com/nabeelio/phpvms/issues/134)
- Handle flight specific fares & multipliers [\#125](https://github.com/nabeelio/phpvms/issues/125)
- Flight set day of week [\#122](https://github.com/nabeelio/phpvms/issues/122)
- Airport page [\#85](https://github.com/nabeelio/phpvms/issues/85)
- Bulk upload charts to airport [\#84](https://github.com/nabeelio/phpvms/issues/84)
- Pull some values from existing .env file [\#79](https://github.com/nabeelio/phpvms/issues/79)
- METAR Information [\#61](https://github.com/nabeelio/phpvms/issues/61)
- flights page [\#57](https://github.com/nabeelio/phpvms/issues/57)
- fuel costs to airports and fuel type on subfleet [\#41](https://github.com/nabeelio/phpvms/issues/41)
- generate aircraft hex code on create [\#33](https://github.com/nabeelio/phpvms/issues/33)
**Merged pull requests:**
- More acceptable translation to opt-in \(es\) [\#284](https://github.com/nabeelio/phpvms/pull/284)
- Fix 404s to requirements/setup in README.md [\#283](https://github.com/nabeelio/phpvms/pull/283)
- Hide expired live flight from live map and remove from DB [\#280](https://github.com/nabeelio/phpvms/pull/280)
- \[WIP\] Laravel 5.7 Update [\#278](https://github.com/nabeelio/phpvms/pull/278)
- Make admin input outline darker [\#276](https://github.com/nabeelio/phpvms/pull/276)
- capture & display pilot transfer hours [\#275](https://github.com/nabeelio/phpvms/pull/275)
- Optimize query with eager loading [\#274](https://github.com/nabeelio/phpvms/pull/274)
- Fix SettingsController saving boolean value as 'on' [\#273](https://github.com/nabeelio/phpvms/pull/273)
- Hide inactive pilot from pilot list page [\#271](https://github.com/nabeelio/phpvms/pull/271)
- Fix flight search restriction [\#270](https://github.com/nabeelio/phpvms/pull/270)
- Apply fixes from StyleCI [\#268](https://github.com/nabeelio/phpvms/pull/268)
- Fix METAR issue [\#264](https://github.com/nabeelio/phpvms/pull/264)
- Apply fixes from StyleCI [\#262](https://github.com/nabeelio/phpvms/pull/262)
- Apply fixes from StyleCI [\#261](https://github.com/nabeelio/phpvms/pull/261)
- Enable eager loading [\#259](https://github.com/nabeelio/phpvms/pull/259)
- Implement cron to remove expired bids [\#258](https://github.com/nabeelio/phpvms/pull/258)
- Fix timezone list HTML Escaped [\#257](https://github.com/nabeelio/phpvms/pull/257)
- Update 07/13/2018 es-translations [\#255](https://github.com/nabeelio/phpvms/pull/255)
- ES translation [\#250](https://github.com/nabeelio/phpvms/pull/250)
- flights filtered per va [\#242](https://github.com/nabeelio/phpvms/pull/242)
- Avatar Issue [\#236](https://github.com/nabeelio/phpvms/pull/236)
- Install bug [\#235](https://github.com/nabeelio/phpvms/pull/235)
## [v7.0.0-alpha2](https://github.com/nabeelio/phpvms/tree/v7.0.0-alpha2) (2018-02-23)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/v7.0.0-alpha1...v7.0.0-alpha2)
**Implemented enhancements:**
- Get user PIREPs [\#192](https://github.com/nabeelio/phpvms/issues/192)
- Use time conversion class [\#190](https://github.com/nabeelio/phpvms/issues/190)
- Require inputs in Imperial units [\#189](https://github.com/nabeelio/phpvms/issues/189)
- Make planned\_distance in prefile optional [\#185](https://github.com/nabeelio/phpvms/issues/185)
- If there's no /pirep/route calls, when it's filed, write the route [\#184](https://github.com/nabeelio/phpvms/issues/184)
- Create a /api/flight/{id}/route call [\#183](https://github.com/nabeelio/phpvms/issues/183)
- Make all APIs behind auth [\#173](https://github.com/nabeelio/phpvms/issues/173)
- Add bid [\#172](https://github.com/nabeelio/phpvms/issues/172)
- Setting for only showing aircraft that are at the departure airport [\#171](https://github.com/nabeelio/phpvms/issues/171)
- Font for input [\#169](https://github.com/nabeelio/phpvms/issues/169)
- Read default value from settings table [\#106](https://github.com/nabeelio/phpvms/issues/106)
**Fixed bugs:**
- Volume units to lbs/kg, not gal/liter [\#193](https://github.com/nabeelio/phpvms/issues/193)
- Add country to airline missing [\#191](https://github.com/nabeelio/phpvms/issues/191)
- SKIN\_NAME missing on error pages [\#187](https://github.com/nabeelio/phpvms/issues/187)
- Airport timezone not being saved [\#182](https://github.com/nabeelio/phpvms/issues/182)
- Rank checkboxes not being saved [\#181](https://github.com/nabeelio/phpvms/issues/181)
- Make sure cancelled PIREPs don't show [\#180](https://github.com/nabeelio/phpvms/issues/180)
- Ignore cancelled PIREPs in duplicate check [\#179](https://github.com/nabeelio/phpvms/issues/179)
- Make sure all fields are returned in PIREP object [\#178](https://github.com/nabeelio/phpvms/issues/178)
- autopopulate SOURCE field in ACARS [\#177](https://github.com/nabeelio/phpvms/issues/177)
- Make sure pireps.restrict\_aircraft\_to\_rank is respected [\#170](https://github.com/nabeelio/phpvms/issues/170)
- Don't change rank if current rank is non-auto promoting [\#168](https://github.com/nabeelio/phpvms/issues/168)
- PIREP hours can't be changed [\#167](https://github.com/nabeelio/phpvms/issues/167)
- Changing a flight status does not save [\#150](https://github.com/nabeelio/phpvms/issues/150)
- Additional PIREP fields don't save correctly [\#146](https://github.com/nabeelio/phpvms/issues/146)
**Closed issues:**
- Cleanup icons [\#195](https://github.com/nabeelio/phpvms/issues/195)
- remove raw\_data field from pirep table [\#188](https://github.com/nabeelio/phpvms/issues/188)
- Remove Resource::withoutWrapping\(\) to follow jsonapi spec [\#186](https://github.com/nabeelio/phpvms/issues/186)
- Add an `artisan phpvms:dev-install` command [\#176](https://github.com/nabeelio/phpvms/issues/176)
- Pagination settings [\#175](https://github.com/nabeelio/phpvms/issues/175)
- Implement setting for flights at pilot's current airport [\#174](https://github.com/nabeelio/phpvms/issues/174)
- Minimum PHP supported version to 7.1 [\#166](https://github.com/nabeelio/phpvms/issues/166)
- Update to Laravel 5.6 [\#165](https://github.com/nabeelio/phpvms/issues/165)
- Updater [\#164](https://github.com/nabeelio/phpvms/issues/164)
- Allow adding rank in subfleet page [\#160](https://github.com/nabeelio/phpvms/issues/160)
- Docs [\#153](https://github.com/nabeelio/phpvms/issues/153)
## [v7.0.0-alpha1](https://github.com/nabeelio/phpvms/tree/v7.0.0-alpha1) (2018-02-04)
[Full Changelog](https://github.com/nabeelio/phpvms/compare/f158c11dea7c0a4af27c93382333b67fdc531e3a...v7.0.0-alpha1)
**Implemented enhancements:**
- Widgetized components [\#127](https://github.com/nabeelio/phpvms/issues/127)
- Set aircraft location on landing [\#112](https://github.com/nabeelio/phpvms/issues/112)
- save user IP on login [\#110](https://github.com/nabeelio/phpvms/issues/110)
- When rejecting PIREP, add a comment/reason [\#107](https://github.com/nabeelio/phpvms/issues/107)
- Check for duplicate PIREPs and add setting [\#105](https://github.com/nabeelio/phpvms/issues/105)
- create vendor.js with webpack [\#91](https://github.com/nabeelio/phpvms/issues/91)
- move from bower to webpack [\#90](https://github.com/nabeelio/phpvms/issues/90)
- Pilots list and profile [\#82](https://github.com/nabeelio/phpvms/issues/82)
- pirep auto-accept for certain rankings [\#24](https://github.com/nabeelio/phpvms/issues/24)
- Investigate removing the Repository pattern to simplify [\#6](https://github.com/nabeelio/phpvms/issues/6)
**Fixed bugs:**
- Error when sending /api/pireps/prefile [\#149](https://github.com/nabeelio/phpvms/issues/149)
- Extra numbers on flights page [\#148](https://github.com/nabeelio/phpvms/issues/148)
- Unable to select any aircraft from fleet on file PIREP page [\#147](https://github.com/nabeelio/phpvms/issues/147)
- Error thrown when editing a saved flight [\#145](https://github.com/nabeelio/phpvms/issues/145)
- When you delete flight from admin, filed pirep will throw error [\#144](https://github.com/nabeelio/phpvms/issues/144)
- Avoid calling MySQL executable for creating database [\#132](https://github.com/nabeelio/phpvms/issues/132)
- Aircraft can be added without specifying a subfleet [\#128](https://github.com/nabeelio/phpvms/issues/128)
- Non error flash messages not showing [\#126](https://github.com/nabeelio/phpvms/issues/126)
- Removing subfleet from flight [\#124](https://github.com/nabeelio/phpvms/issues/124)
- User still has API access if they're not ACTIVE [\#119](https://github.com/nabeelio/phpvms/issues/119)
- Delete bids when flight is deleted [\#103](https://github.com/nabeelio/phpvms/issues/103)
- JSON error messages [\#92](https://github.com/nabeelio/phpvms/issues/92)
- add subfleet to flight broken [\#88](https://github.com/nabeelio/phpvms/issues/88)
- logout functionality not working from frontpage [\#26](https://github.com/nabeelio/phpvms/issues/26)
**Closed issues:**
- `fuel\_used` in pirep/file [\#159](https://github.com/nabeelio/phpvms/issues/159)
- Add additional fields for PIREP and flights [\#158](https://github.com/nabeelio/phpvms/issues/158)
- Stub file [\#157](https://github.com/nabeelio/phpvms/issues/157)
- Add config.php in root on install [\#156](https://github.com/nabeelio/phpvms/issues/156)
- New registrations are auto-accepted and put as active [\#151](https://github.com/nabeelio/phpvms/issues/151)
- new version alert [\#143](https://github.com/nabeelio/phpvms/issues/143)
- Footer copyright text [\#142](https://github.com/nabeelio/phpvms/issues/142)
- Version build number to use string/assigned date [\#141](https://github.com/nabeelio/phpvms/issues/141)
- Handle duplicate flight number [\#139](https://github.com/nabeelio/phpvms/issues/139)
- Restrict shown aircraft to user's rank [\#138](https://github.com/nabeelio/phpvms/issues/138)
- Docs [\#137](https://github.com/nabeelio/phpvms/issues/137)
- Checksum for tarball [\#123](https://github.com/nabeelio/phpvms/issues/123)
- API Items need [\#120](https://github.com/nabeelio/phpvms/issues/120)
- ACARS API [\#118](https://github.com/nabeelio/phpvms/issues/118)
- List of cron jobs required [\#117](https://github.com/nabeelio/phpvms/issues/117)
- Add create/edit fields for columns [\#111](https://github.com/nabeelio/phpvms/issues/111)
- Add PIREP cancel endpoint and cleanup job [\#109](https://github.com/nabeelio/phpvms/issues/109)
- ACARS table should save the route [\#102](https://github.com/nabeelio/phpvms/issues/102)
- /api/fleet and /api/user/fleet [\#101](https://github.com/nabeelio/phpvms/issues/101)
- Assign subfleets to ranks [\#100](https://github.com/nabeelio/phpvms/issues/100)
- show dates/times in proper timezone [\#97](https://github.com/nabeelio/phpvms/issues/97)
- editable fields not working [\#94](https://github.com/nabeelio/phpvms/issues/94)
- Settings page needs to be completed [\#93](https://github.com/nabeelio/phpvms/issues/93)
- Airport page pagination & search [\#87](https://github.com/nabeelio/phpvms/issues/87)
- Mark airport as hub [\#86](https://github.com/nabeelio/phpvms/issues/86)
- Terms and Conditions & COPPA during registration [\#81](https://github.com/nabeelio/phpvms/issues/81)
- Look at alternative to Entrust [\#78](https://github.com/nabeelio/phpvms/issues/78)
- Check if .env file exists in installer [\#76](https://github.com/nabeelio/phpvms/issues/76)
- upload travis artifact to phpvms ftp as "latest.zip" [\#75](https://github.com/nabeelio/phpvms/issues/75)
- Track hours on airframes [\#73](https://github.com/nabeelio/phpvms/issues/73)
- PIREP accept/reject in admin should call PIREP service [\#72](https://github.com/nabeelio/phpvms/issues/72)
- Error with MySQL syntax when creating database. [\#71](https://github.com/nabeelio/phpvms/issues/71)
- pirep comments [\#70](https://github.com/nabeelio/phpvms/issues/70)
- findWithoutFail Method does not exist [\#69](https://github.com/nabeelio/phpvms/issues/69)
- Commit error 403 [\#67](https://github.com/nabeelio/phpvms/issues/67)
- Keep Showing 404.... [\#66](https://github.com/nabeelio/phpvms/issues/66)
- wrap migrate command [\#65](https://github.com/nabeelio/phpvms/issues/65)
- Create 404 page [\#63](https://github.com/nabeelio/phpvms/issues/63)
- link to admin in nav if you have permissions [\#62](https://github.com/nabeelio/phpvms/issues/62)
- Error while creating database [\#56](https://github.com/nabeelio/phpvms/issues/56)
- shared hosting stuff [\#55](https://github.com/nabeelio/phpvms/issues/55)
- gravatar url for profile [\#54](https://github.com/nabeelio/phpvms/issues/54)
- news and notams module [\#52](https://github.com/nabeelio/phpvms/issues/52)
- try atoum vs phpunit [\#51](https://github.com/nabeelio/phpvms/issues/51)
- Cache Airports calls [\#49](https://github.com/nabeelio/phpvms/issues/49)
- add custom fields table for flights [\#48](https://github.com/nabeelio/phpvms/issues/48)
- Events system [\#43](https://github.com/nabeelio/phpvms/issues/43)
- add fuel costs types to the airports table [\#40](https://github.com/nabeelio/phpvms/issues/40)
- adjust "created" date for airline [\#39](https://github.com/nabeelio/phpvms/issues/39)
- add gross\_weight to PIREPs [\#38](https://github.com/nabeelio/phpvms/issues/38)
- subfleet to flight pivot values [\#37](https://github.com/nabeelio/phpvms/issues/37)
- API authentication/middleware [\#36](https://github.com/nabeelio/phpvms/issues/36)
- REST API [\#35](https://github.com/nabeelio/phpvms/issues/35)
- use uuids on a few tables [\#34](https://github.com/nabeelio/phpvms/issues/34)
- subfleet \(ranks, expenses\) [\#32](https://github.com/nabeelio/phpvms/issues/32)
- How to install this? [\#31](https://github.com/nabeelio/phpvms/issues/31)
- experiment with changing PDO mode [\#30](https://github.com/nabeelio/phpvms/issues/30)
- forgot password [\#27](https://github.com/nabeelio/phpvms/issues/27)
- rankings [\#23](https://github.com/nabeelio/phpvms/issues/23)
- module system [\#22](https://github.com/nabeelio/phpvms/issues/22)
- pireps [\#21](https://github.com/nabeelio/phpvms/issues/21)
- admin user management [\#20](https://github.com/nabeelio/phpvms/issues/20)
- modify DatabaseSeeder to look at env [\#19](https://github.com/nabeelio/phpvms/issues/19)
- look at flarum method of install [\#18](https://github.com/nabeelio/phpvms/issues/18)
- navdata ingestion [\#17](https://github.com/nabeelio/phpvms/issues/17)
- settings panel [\#16](https://github.com/nabeelio/phpvms/issues/16)
- routing and scheduling [\#14](https://github.com/nabeelio/phpvms/issues/14)
- airport details page [\#13](https://github.com/nabeelio/phpvms/issues/13)
- currency format config [\#12](https://github.com/nabeelio/phpvms/issues/12)
- aircraft details page [\#11](https://github.com/nabeelio/phpvms/issues/11)
- user dashboard and profile pages [\#10](https://github.com/nabeelio/phpvms/issues/10)
- admin panel work [\#9](https://github.com/nabeelio/phpvms/issues/9)
- theme/skins engine [\#8](https://github.com/nabeelio/phpvms/issues/8)
- Integrate roles and permissions [\#7](https://github.com/nabeelio/phpvms/issues/7)
- rebuild tables [\#5](https://github.com/nabeelio/phpvms/issues/5)
- front-end template [\#4](https://github.com/nabeelio/phpvms/issues/4)
- Laravel 5.4 [\#3](https://github.com/nabeelio/phpvms/issues/3)
- look up role-based permissions [\#2](https://github.com/nabeelio/phpvms/issues/2)
- installer [\#1](https://github.com/nabeelio/phpvms/issues/1)
**Merged pull requests:**
- Fixed a few field entries [\#116](https://github.com/nabeelio/phpvms/pull/116)
- Remove unique email entry [\#115](https://github.com/nabeelio/phpvms/pull/115)
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM php:7.4-fpm-alpine
WORKDIR /var/www/
RUN apk add gmp-dev
RUN curl --silent --show-error https://getcomposer.org/installer | php
# Copy any config files in
COPY resources/docker/php/ext-opcache.ini $PHP_INI_DIR/conf.d/
COPY resources/docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf
RUN ln -sf /dev/stderr /var/log/fpm-error.log
RUN docker-php-ext-install \
calendar \
pdo_mysql \
gmp \
opcache && \
docker-php-ext-enable pdo_mysql opcache
COPY . /var/www/
RUN php composer.phar install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
EXPOSE 9000

View File

@@ -19,7 +19,7 @@ clean:
@php artisan view:clear @php artisan view:clear
@find bootstrap/cache -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf @find bootstrap/cache -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/cache/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf @find storage/framework/cache/ -mindepth 1 -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/sessions/ -mindepth 1 -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf @find storage/framework/sessions/ -mindepth 1 -type f -not -name '.gitignore' -print0 | xargs -0 rm -rf
@find storage/framework/views/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf @find storage/framework/views/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf
@@ -29,6 +29,13 @@ clean:
clean-routes: clean-routes:
@php artisan route:clear @php artisan route:clear
.PHONY: clear
clear:
@php artisan cache:clear
@php artisan config:clear
@php artisan route:clear
@php artisan view:clear
.PHONY: build .PHONY: build
build: build:
@php $(COMPOSER) install --no-interaction @php $(COMPOSER) install --no-interaction
@@ -36,7 +43,7 @@ build:
# This is to build all the stylesheets, etc # This is to build all the stylesheets, etc
.PHONY: build-assets .PHONY: build-assets
build-assets: build-assets:
yarn run dev npm run production
.PHONY: install .PHONY: install
install: build install: build
@@ -52,25 +59,32 @@ update: build
@echo "Done!" @echo "Done!"
.PHONY: reset .PHONY: reset
reset: cleanapp/Models/Traits/JournalTrait.php reset: clean
@php $(COMPOSER) dump-autoload @php $(COMPOSER) dump-autoload
@make reload-db @make reload-db
.PHONY: reload-db .PHONY: reload-db
reload-db: reload-db:
@php artisan phpvms:dev-install --reset-db @php artisan database:create --reset
@php artisan migrate --seed
@echo "Done!"
@make clean
.PHONY: tests .PHONY: tests
tests: test tests: test
.PHONY: test .PHONY: test
test: test: phpcs
#php artisan database:create --reset #php artisan database:create --reset
vendor/bin/phpunit --debug --verbose vendor/bin/phpunit --debug --verbose
.PHONY: .PHONY: phpcs
phpstan: phpcs:
vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app @vendor/bin/php-cs-fixer fix --config=.php_cs -v --diff --diff-format=udiff --dry-run
#.PHONY: phpstan
#phpstan:
# vendor/bin/phpstan analyse -c phpstan.neon -v --level 2 app
.PHONY: replay-acars .PHONY: replay-acars
replay-acars: replay-acars:

View File

@@ -1,5 +1,5 @@
dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground #dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
php-fpm: /usr/local/sbin/php-fpm --nodaemonize php-fpm: /usr/local/sbin/php-fpm --nodaemonize
nginx: /usr/local/bin/nginx -g 'daemon off;' nginx: /usr/local/bin/nginx -g 'daemon off;'
#mysql: /usr/local/bin/mysqld mysql: docker-compose --file ~/docker/mysql/docker-compose.yml up
#mailhog: /usr/local/bin/mailhog #mailhog: /usr/local/bin/mailhog

View File

@@ -2,16 +2,15 @@
[![Build Status](https://travis-ci.org/nabeelio/phpvms.svg)](https://travis-ci.org/nabeelio/phpvms) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d668bebb0a3c46bda381af16ce3d9450)](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=nabeelio/phpvms&amp;utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/nabeel/phpvms/v/stable)](https://packagist.org/packages/nabeel/phpvms) ![StyleCI](https://github.styleci.io/repos/93688482/shield?branch=dev) [![License](https://poser.pugx.org/nabeel/phpvms/license)](https://packagist.org/packages/nabeel/phpvms) [![Build Status](https://travis-ci.org/nabeelio/phpvms.svg)](https://travis-ci.org/nabeelio/phpvms) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d668bebb0a3c46bda381af16ce3d9450)](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=nabeelio/phpvms&amp;utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/nabeel/phpvms/v/stable)](https://packagist.org/packages/nabeel/phpvms) ![StyleCI](https://github.styleci.io/repos/93688482/shield?branch=dev) [![License](https://poser.pugx.org/nabeel/phpvms/license)](https://packagist.org/packages/nabeel/phpvms)
The next phpvms version built on the laravel framework. work in progress. If you're looking for The next phpvms version built on the laravel framework. work in progress. The latest documentation, with installation instructions is available
the old, phpVMS classic, it's [available here](https://github.com/nabeelio/phpvms_v2). [on the phpVMS documentation](http://docs.phpvms.net/) page.
# installation # installation
A full distribution, with all of the composer dependencies, is available at this A full distribution, with all of the composer dependencies, is available at this
[GitHub Releases](https://github.com/nabeelio/phpvms/releases) link. [GitHub Releases](https://github.com/nabeelio/phpvms/releases) link.
The latest documentation, with installation instructions is available
[on the phpVMS documentation](http://docs.phpvms.net/) page.
## Requirements ## Requirements
@@ -30,6 +29,33 @@ The latest documentation, with installation instructions is available
## Installer ## Installer
1. Upload to your server 1. Upload to your server
2. Visit the site, and follow the link to the installer 1. Visit the site, and follow the link to the installer
[View installation details](http://docs.phpvms.net/setup/installation) [View installation details](http://docs.phpvms.net/setup/installation)
# development environment
A full development environment can be brought up using Docker:
```bash
composer install
yarn install
docker-compose build
docker-compose up
```
Then go to `http://localhost`. If you're using dnsmasq, the `app` container is listening on `phpvms.test`, or you can add to your `/etc/hosts` file:
```
127.0.0.1 phpvms.test
```
## Building JS/CSS assets
Yarn is required, run:
```bash
make build-assets
```
This will build all of the assets according to the webpack file.

View File

@@ -5,13 +5,11 @@ namespace App\Bootstrap;
use Illuminate\Contracts\Config\Repository as RepositoryContract; use Illuminate\Contracts\Config\Repository as RepositoryContract;
use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Foundation\Application;
/**
* Class LoadConfiguration
*/
class LoadConfiguration extends \Illuminate\Foundation\Bootstrap\LoadConfiguration class LoadConfiguration extends \Illuminate\Foundation\Bootstrap\LoadConfiguration
{ {
/** /**
* Load the configuration items from all of the files. * Load the configuration items from all of the files. This reads the config.php from
* that's sitting in the root, and then recursively merges it with the current configs
* *
* @param \Illuminate\Contracts\Foundation\Application $app * @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Config\Repository $repository * @param \Illuminate\Contracts\Config\Repository $repository

View File

@@ -2,14 +2,11 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Facades\Utils; use App\Support\Units\Time;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
/**
* Class AcarsReplay
*/
class AcarsReplay extends Command class AcarsReplay extends Command
{ {
protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}'; protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}';
@@ -67,7 +64,7 @@ class AcarsReplay extends Command
protected function startPirep($flight): string protected function startPirep($flight): string
{ {
// convert the planned flight time to be completely in minutes // convert the planned flight time to be completely in minutes
$pft = Utils::hoursToMinutes( $pft = Time::hoursToMinutes(
$flight->planned_hrsenroute, $flight->planned_hrsenroute,
$flight->planned_minenroute $flight->planned_minenroute
); );
@@ -172,7 +169,7 @@ class AcarsReplay extends Command
* @var $flights Collection * @var $flights Collection
*/ */
$flights = collect($files)->transform(function ($f) { $flights = collect($files)->transform(function ($f) {
$file = storage_path('/replay/'.$f.'.json'); $file = $f;
if (file_exists($file)) { if (file_exists($file)) {
$this->info('Loading '.$file); $this->info('Loading '.$file);
$contents = file_get_contents($file); $contents = file_get_contents($file);

View File

@@ -0,0 +1,41 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use Nwidart\Modules\Facades\Module;
class ClearCaches extends Command
{
protected $signature = 'phpvms:caches';
protected $description = 'Clear all caches';
/**
* {@inheritdoc}
*/
public function handle()
{
self::clearCaches();
}
public static function clearCaches()
{
self::clearBootstrapCache();
self::clearModuleCache();
}
/**
* Clear the bootstrap/cache dir
*/
private static function clearBootstrapCache()
{
}
/**
* Rescan for new modules
*/
private static function clearModuleCache()
{
Module::scan();
}
}

View File

@@ -2,12 +2,9 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use Artisan; use Illuminate\Support\Facades\Artisan;
/**
* Class ComposerCommand
*/
class ComposerCommand extends Command class ComposerCommand extends Command
{ {
protected $signature = 'phpvms:composer {cmd}'; protected $signature = 'phpvms:composer {cmd}';

View File

@@ -0,0 +1,95 @@
<?php
namespace App\Console\Commands;
use App;
use App\Contracts\Command;
use App\Services\Installer\SeederService;
use DatabaseSeeder;
use Modules\Installer\Services\ConfigService;
/**
* Create the config files
*/
class CreateConfigs extends Command
{
protected $signature = 'phpvms:config {db_host} {db_name} {db_user} {db_pass}';
protected $description = 'Create the config files';
private $databaseSeeder;
private $seederSvc;
public function __construct(DatabaseSeeder $databaseSeeder, SeederService $seederSvc)
{
parent::__construct();
$this->databaseSeeder = $databaseSeeder;
$this->seederSvc = $seederSvc;
}
/**
* Run dev related commands
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
public function handle()
{
$this->writeConfigs();
// Reload the configuration
App::boot();
$this->info('Recreating database');
$this->call('database:create', [
'--reset' => true,
]);
$this->info('Running migrations');
$this->call('migrate:fresh', [
'--seed' => true,
]);
$this->seederSvc->syncAllSeeds();
$this->info('Done!');
}
/**
* Rewrite the configuration files
*
* @throws \Symfony\Component\HttpFoundation\File\Exception\FileException
*/
protected function writeConfigs()
{
/** @var ConfigService $cfgSvc */
$cfgSvc = app(ConfigService::class);
$this->info('Removing the old config files');
// Remove the old files
$config_file = base_path('config.php');
if (file_exists($config_file)) {
unlink($config_file);
}
$env_file = base_path('env.php');
if (file_exists($env_file)) {
unlink($env_file);
}
//{name} {db_host} {db_name} {db_user} {db_pass}
$this->info('Regenerating the config files');
$cfgSvc->createConfigFiles([
'APP_ENV' => 'dev',
'SITE_NAME' => $this->argument('name'),
'DB_CONN' => 'mysql',
'DB_HOST' => $this->argument('db_host'),
'DB_NAME' => $this->argument('db_name'),
'DB_USER' => $this->argument('db_user'),
'DB_PASS' => $this->argument('db_pass'),
]);
$this->info('Config files generated!');
}
}

View File

@@ -2,15 +2,14 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Console\Services\Database;
use Log; use App\Contracts\Command;
use Illuminate\Support\Facades\Log;
use Tivie\OS\Detector;
/**
* Class CreateDatabase
*/
class CreateDatabase extends Command class CreateDatabase extends Command
{ {
protected $signature = 'database:create {--reset} {--conn=?}'; protected $signature = 'database:create {--reset} {--migrate} {--conn=?}';
protected $description = 'Create a database'; protected $description = 'Create a database';
protected $os; protected $os;
@@ -20,7 +19,7 @@ class CreateDatabase extends Command
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->os = new \Tivie\OS\Detector(); $this->os = new Detector();
} }
/** /**
@@ -38,8 +37,7 @@ class CreateDatabase extends Command
$user = config($dbkey.'username'); $user = config($dbkey.'username');
$pass = config($dbkey.'password'); $pass = config($dbkey.'password');
$dbSvc = new \App\Console\Services\Database(); $dbSvc = new Database();
$dsn = $dbSvc->createDsn($host, $port); $dsn = $dbSvc->createDsn($host, $port);
Log::info('Connection string: '.$dsn); Log::info('Connection string: '.$dsn);

View File

@@ -2,20 +2,24 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Models\Acars; use App\Models\Acars;
use App\Models\Airline; use App\Models\Airline;
use App\Models\Pirep; use App\Models\Pirep;
use App\Models\User; use App\Models\User;
use App\Notifications\Messages\UserRegistered;
use App\Repositories\AcarsRepository;
use App\Services\AirportService;
use App\Services\AwardService; use App\Services\AwardService;
use App\Services\DatabaseService; use App\Services\DatabaseService;
use DB; use App\Services\UserService;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use PDO; use PDO;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
/**
* Class DevCommands
*/
class DevCommands extends Command class DevCommands extends Command
{ {
protected $signature = 'phpvms {cmd} {param?}'; protected $signature = 'phpvms {cmd} {param?}';
@@ -30,6 +34,7 @@ class DevCommands extends Command
public function __construct(DatabaseService $dbSvc) public function __construct(DatabaseService $dbSvc)
{ {
parent::__construct(); parent::__construct();
$this->dbSvc = $dbSvc; $this->dbSvc = $dbSvc;
} }
@@ -46,12 +51,17 @@ class DevCommands extends Command
} }
$commands = [ $commands = [
'list-awards' => 'listAwardClasses',
'clear-acars' => 'clearAcars', 'clear-acars' => 'clearAcars',
'clear-users' => 'clearUsers', 'clear-users' => 'clearUsers',
'compile-assets' => 'compileAssets', 'compile-assets' => 'compileAssets',
'db-attrs' => 'dbAttrs', 'db-attrs' => 'dbAttrs',
'list-awards' => 'listAwardClasses',
'live-flights' => 'liveFlights',
'manual-insert' => 'manualInsert', 'manual-insert' => 'manualInsert',
'metar' => 'getMetar',
'recalculate-stats' => 'recalculateStats',
'reset-install' => 'resetInstall',
'new-user-email' => 'newUserEmail',
'xml-to-yaml' => 'xmlToYaml', 'xml-to-yaml' => 'xmlToYaml',
]; ];
@@ -183,6 +193,19 @@ class DevCommands extends Command
$this->info('Writing yaml to storage: '.$file_name); $this->info('Writing yaml to storage: '.$file_name);
} }
protected function getMetar(): void
{
$icao = $this->argument('param');
if (!$icao) {
$this->error('Enter an ICAO!');
exit();
}
$airportSvc = app(AirportService::class);
$metar = $airportSvc->getMetar($icao);
$this->info($metar->raw);
}
/** /**
* Insert the rows from the file, manually advancing each row * Insert the rows from the file, manually advancing each row
*/ */
@@ -212,4 +235,78 @@ class DevCommands extends Command
} }
} }
} }
/**
* Recalculate the stats for all users
*/
protected function recalculateStats(): void
{
$userSvc = app(UserService::class);
$userSvc->recalculateAllUserStats();
}
/**
* Delete all of the tables, etc from the database, for a clean install
*/
protected function resetInstall(): void
{
$confirm = $this->ask('This will erase your entire install and database, are you sure? y/n ');
if (strtolower($confirm) !== 'y') {
exit(0);
}
try {
if (config('database.default') === 'mysql') {
DB::statement('SET foreign_key_checks=0');
}
$this->info('Dropping all tables');
$tables = DB::connection()->getDoctrineSchemaManager()->listTableNames();
foreach ($tables as $table) {
Schema::dropIfExists($table);
}
} catch (QueryException $e) {
$this->error('DB error: '.$e->getMessage());
}
$this->info('Deleting config file');
try {
unlink('config.php');
} catch (\Exception $e) {
}
$this->info('Deleting env file');
try {
unlink('env.php');
} catch (\Exception $e) {
}
$this->info('Clearing caches');
Artisan::call('cache:clear');
Artisan::call('route:clear');
Artisan::call('config:clear');
Artisan::call('view:clear');
$this->info('Done!');
}
/**
* Test sending a user a registered email
*/
protected function newUserEmail()
{
$user_id = $this->argument('param');
$user = User::find($user_id);
$user->notify(new UserRegistered($user));
}
public function liveFlights(): void
{
$acarsRepo = app(AcarsRepository::class);
$flights = $acarsRepo->getPositions(setting('acars.live_time'))->toArray();
dd($flights);
}
} }

View File

@@ -2,7 +2,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use Modules\Installer\Services\ConfigService; use Modules\Installer\Services\ConfigService;
/** /**
@@ -13,13 +13,14 @@ class DevInstall extends Command
protected $signature = 'phpvms:dev-install {--reset-db} {--reset-configs}'; protected $signature = 'phpvms:dev-install {--reset-db} {--reset-configs}';
protected $description = 'Run a developer install and run the sample migration'; protected $description = 'Run a developer install and run the sample migration';
/** private $databaseSeeder;
* The YAML files with sample data to import
*/ public function __construct(\DatabaseSeeder $databaseSeeder)
protected $yaml_imports = [ {
'sample.yml', parent::__construct();
'acars.yml',
]; $this->databaseSeeder = $databaseSeeder;
}
/** /**
* Run dev related commands * Run dev related commands
@@ -45,16 +46,6 @@ class DevInstall extends Command
'--seed' => true, '--seed' => true,
]); ]);
//
//
$this->info('Importing sample data');
foreach ($this->yaml_imports as $yml) {
$this->call('phpvms:yaml-import', [
'files' => ['app/Database/seeds/'.$yml],
]);
}
$this->info('Done!'); $this->info('Done!');
} }

View File

@@ -2,12 +2,9 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Services\ImportService; use App\Services\ImportService;
/**
* Class ImportCsv
*/
class ImportCsv extends Command class ImportCsv extends Command
{ {
protected $signature = 'phpvms:csv-import {type} {file}'; protected $signature = 'phpvms:csv-import {type} {file}';
@@ -23,6 +20,7 @@ class ImportCsv extends Command
public function __construct(ImportService $importer) public function __construct(ImportService $importer)
{ {
parent::__construct(); parent::__construct();
$this->importer = $importer; $this->importer = $importer;
} }
@@ -36,11 +34,11 @@ class ImportCsv extends Command
$type = $this->argument('type'); $type = $this->argument('type');
$file = $this->argument('file'); $file = $this->argument('file');
if (\in_array($type, ['flight', 'flights'])) { if (\in_array($type, ['flight', 'flights'], true)) {
$status = $this->importer->importFlights($file); $status = $this->importer->importFlights($file);
} elseif ($type === 'aircraft') { } elseif ($type === 'aircraft') {
$status = $this->importer->importAircraft($file); $status = $this->importer->importAircraft($file);
} elseif (\in_array($type, ['airport', 'airports'])) { } elseif (\in_array($type, ['airport', 'airports'], true)) {
$status = $this->importer->importAirports($file); $status = $this->importer->importAirports($file);
} elseif ($type === 'subfleet') { } elseif ($type === 'subfleet') {
$status = $this->importer->importSubfleets($file); $status = $this->importer->importSubfleets($file);

View File

@@ -1,28 +0,0 @@
<?php
namespace App\Console\Commands;
use App\Console\Command;
class ImportFromClassic extends Command
{
protected $signature = 'phpvms:importer {db_host} {db_name} {db_user} {db_pass?} {table_prefix=phpvms_}';
protected $description = 'Import from an older version of phpVMS';
/**
* Run dev related commands
*/
public function handle()
{
$db_creds = [
'host' => $this->argument('db_host'),
'name' => $this->argument('db_name'),
'user' => $this->argument('db_user'),
'pass' => $this->argument('db_pass'),
'table_prefix' => $this->argument('table_prefix'),
];
$importerSvc = new \App\Console\Services\Importer($db_creds);
$importerSvc->run();
}
}

View File

@@ -2,13 +2,10 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Models\Enums\NavaidType; use App\Models\Enums\NavaidType;
use App\Models\Navdata; use App\Models\Navdata;
/**
* Class NavdataImport
*/
class NavdataImport extends Command class NavdataImport extends Command
{ {
protected $signature = 'phpvms:navdata'; protected $signature = 'phpvms:navdata';

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Console\Commands;
use App\Contracts\Command;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Yaml\Yaml;
class PirepExport extends Command
{
protected $signature = 'phpvms:pirep-export {id}';
protected $description = 'PIREP table export';
/**
* Run dev related commands
*/
public function handle()
{
$pirep_id = $this->argument('id');
if (empty($pirep_id)) {
$this->error('No PIREP ID specified');
exit();
}
// List the tables to export and the column name for the pirep id
$tables = [
'pireps' => 'id',
'acars' => 'pirep_id',
'pirep_comments' => 'pirep_id',
'pirep_fares' => 'pirep_id',
'pirep_field_values' => 'pirep_id',
'expenses' => 'ref_model_id',
'journal_transactions' => 'ref_model_id',
];
$export_tables = [];
foreach ($tables as $table => $key) {
$export_tables[$table] = [];
$rows = DB::table($table)
->where($key, '=', $pirep_id)
->get();
foreach ($rows as $row) {
$export_tables[$table][] = (array) $row;
}
}
$yaml = Yaml::dump($export_tables, 4, 2);
echo $yaml;
}
}

View File

@@ -2,12 +2,9 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use GuzzleHttp\Client; use GuzzleHttp\Client;
/**
* Class TestApi
*/
class TestApi extends Command class TestApi extends Command
{ {
protected $signature = 'phpvms:test-api {apikey} {url}'; protected $signature = 'phpvms:test-api {apikey} {url}';

View File

@@ -2,33 +2,21 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Services\VersionService;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
/**
* Class Version
*/
class Version extends Command class Version extends Command
{ {
protected $signature = 'phpvms:version {--write} {--base-only}'; protected $signature = 'phpvms:version {--write} {--base-only} {--write-full-version} {version?}';
/** private $versionSvc;
* Create the version number that gets written out
* public function __construct(VersionService $versionSvc)
* @param mixed $cfg
*
* @return bool|string
*/
protected function createVersionNumber($cfg)
{ {
exec($cfg['git']['git-local'], $version); parent::__construct();
$version = substr($version[0], 0, $cfg['build']['length']);
// prefix with the date in YYMMDD format $this->versionSvc = $versionSvc;
$date = date('ymd');
$version = $date.'-'.$version;
return $version;
} }
/** /**
@@ -38,27 +26,40 @@ class Version extends Command
*/ */
public function handle() public function handle()
{ {
if ($this->option('write')) {
// Write the updated build number out to the file
$version_file = config_path('version.yml'); $version_file = config_path('version.yml');
$cfg = Yaml::parse(file_get_contents($version_file)); $cfg = Yaml::parse(file_get_contents($version_file));
// Get the current build id // If a version is being passed in, the update the build, etc data against this
$build_number = $this->createVersionNumber($cfg); if ($this->argument('version')) {
$version = \SemVer\SemVer\Version::fromString($this->argument('version'));
if ($this->option('write-full-version')) {
$cfg['current']['major'] = $version->getMajor();
$cfg['current']['minor'] = $version->getMinor();
$cfg['current']['patch'] = $version->getPatch();
}
$prerelease = $version->getPreRelease();
if (strpos($prerelease, '.') !== false) {
$prerelease = explode('.', $prerelease);
$cfg['current']['prerelease'] = $prerelease[0];
$cfg['current']['buildmetadata'] = $prerelease[1];
} else {
$cfg['current']['prerelease'] = $prerelease;
}
}
// Always write out the build ID/build number which is the commit hash
$build_number = $this->versionSvc->generateBuildId($cfg);
$cfg['current']['commit'] = $build_number;
$cfg['build']['number'] = $build_number; $cfg['build']['number'] = $build_number;
$c = $cfg['current'];
$version = "v{$c['major']}.{$c['minor']}.{$c['patch']}-{$build_number}";
if ($this->option('write')) {
file_put_contents($version_file, Yaml::dump($cfg, 4, 2)); file_put_contents($version_file, Yaml::dump($cfg, 4, 2));
} }
// Only show the major.minor.patch version $incl_build = empty($this->option('base-only')) ? true : false;
if ($this->option('base-only')) { $version = $this->versionSvc->getCurrentVersion($incl_build);
$version = 'v'.$cfg['current']['major'].'.'
.$cfg['current']['minor'].'.'
.$cfg['current']['patch'];
}
echo $version."\n"; echo $version."\n";
} }
} }

View File

@@ -2,8 +2,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Services\DatabaseService;
use DB; use DB;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
@@ -15,16 +14,6 @@ class YamlExport extends Command
protected $signature = 'phpvms:yaml-export {tables*}'; protected $signature = 'phpvms:yaml-export {tables*}';
protected $description = 'YAML table export'; protected $description = 'YAML table export';
/**
* YamlExport constructor.
*
* @param DatabaseService $dbSvc
*/
public function __construct(DatabaseService $dbSvc)
{
parent::__construct();
}
/** /**
* Run dev related commands * Run dev related commands
*/ */

View File

@@ -2,7 +2,7 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Contracts\Command;
use App\Services\DatabaseService; use App\Services\DatabaseService;
/** /**
@@ -22,6 +22,7 @@ class YamlImport extends Command
public function __construct(DatabaseService $dbSvc) public function __construct(DatabaseService $dbSvc)
{ {
parent::__construct(); parent::__construct();
$this->dbSvc = $dbSvc; $this->dbSvc = $dbSvc;
} }

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron; namespace App\Console\Cron;
use App\Console\Command; use App\Contracts\Command;
use App\Events\CronHourly; use App\Events\CronHourly;
/** /**
@@ -17,7 +17,7 @@ class Hourly extends Command
public function handle(): void public function handle(): void
{ {
$this->redirectLoggingToStdout('cron'); $this->redirectLoggingToFile('cron');
event(new CronHourly()); event(new CronHourly());
} }
} }

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron; namespace App\Console\Cron;
use App\Console\Command; use App\Contracts\Command;
use App\Events\CronMonthly; use App\Events\CronMonthly;
/** /**
@@ -19,7 +19,7 @@ class Monthly extends Command
public function handle(): void public function handle(): void
{ {
$this->redirectLoggingToStdout('cron'); $this->redirectLoggingToFile('cron');
event(new CronMonthly()); event(new CronMonthly());
} }
} }

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron; namespace App\Console\Cron;
use App\Console\Command; use App\Contracts\Command;
use App\Events\CronNightly; use App\Events\CronNightly;
/** /**
@@ -19,7 +19,7 @@ class Nightly extends Command
public function handle(): void public function handle(): void
{ {
$this->redirectLoggingToStdout('cron'); $this->redirectLoggingToFile('cron');
event(new CronNightly()); event(new CronNightly());
} }
} }

View File

@@ -2,7 +2,7 @@
namespace App\Console\Cron; namespace App\Console\Cron;
use App\Console\Command; use App\Contracts\Command;
use App\Events\CronWeekly; use App\Events\CronWeekly;
/** /**
@@ -19,7 +19,7 @@ class Weekly extends Command
public function handle(): void public function handle(): void
{ {
$this->redirectLoggingToStdout('cron'); $this->redirectLoggingToFile('cron');
event(new CronWeekly()); event(new CronWeekly());
} }
} }

View File

@@ -6,12 +6,10 @@ use App\Console\Cron\Hourly;
use App\Console\Cron\Monthly; use App\Console\Cron\Monthly;
use App\Console\Cron\Nightly; use App\Console\Cron\Nightly;
use App\Console\Cron\Weekly; use App\Console\Cron\Weekly;
use App\Services\CronService;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
/**
* Class Kernel
*/
class Kernel extends ConsoleKernel class Kernel extends ConsoleKernel
{ {
/** /**
@@ -27,6 +25,14 @@ class Kernel extends ConsoleKernel
$schedule->command(Weekly::class)->weeklyOn(0); $schedule->command(Weekly::class)->weeklyOn(0);
$schedule->command(Monthly::class)->monthlyOn(1); $schedule->command(Monthly::class)->monthlyOn(1);
$schedule->command(Hourly::class)->hourly(); $schedule->command(Hourly::class)->hourly();
// When spatie-backups runs
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('02:00');
// Update the last time the cron was run
$cronSvc = app(CronService::class);
$cronSvc->updateLastRunTime();
} }
/** /**
@@ -36,7 +42,6 @@ class Kernel extends ConsoleKernel
*/ */
protected function commands(): void protected function commands(): void
{ {
require app_path('Routes/console.php');
$this->load(__DIR__.'/Commands'); $this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/Cron'); $this->load(__DIR__.'/Cron');
} }

View File

@@ -1,695 +0,0 @@
<?php
namespace App\Console\Services;
use App\Facades\Utils;
use App\Models\Aircraft;
use App\Models\Airline;
use App\Models\Airport;
use App\Models\Enums\FlightType;
use App\Models\Enums\PirepSource;
use App\Models\Enums\UserState;
use App\Models\Flight;
use App\Models\Pirep;
use App\Models\Rank;
use App\Models\Subfleet;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use PDO;
use PDOException;
use Symfony\Component\Console\Output\ConsoleOutput;
/**
* Class Importer
* TODO: Batch import
*/
class Importer
{
/**
* Hold references
*/
private $mappedEntities = [];
/**
* Hold the PDO connection to the old database
*
* @var
*/
private $conn;
/**
* @var array
*/
private $creds;
/**
* Hold the instance of the console logger
*
* @var
*/
private $log;
/**
* CONSTANTS
*/
public const BATCH_READ_ROWS = 300;
public const SUBFLEET_NAME = 'Imported Aircraft';
/**
* Importer constructor.
*
* @param $db_creds
*/
public function __construct($db_creds)
{
// Setup the logger
$this->log = new ConsoleOutput();
// The db credentials
$this->creds = array_merge([
'host' => '127.0.0.1',
'port' => 3306,
'name' => '',
'user' => '',
'pass' => '',
'table_prefix' => 'phpvms_',
], $db_creds);
}
/**
* @return int|void
*/
public function run()
{
$this->reconnect();
// Import all the different parts
$this->importRanks();
$this->importAirlines();
$this->importAircraft();
$this->importAirports();
$this->importUsers();
$this->importFlights();
$this->importPireps();
// Finish up
$this->findLastPireps();
$this->recalculateRanks();
}
/**
* Reconnect to the old phpVMS DB using PDO
*/
protected function reconnect()
{
$dsn = 'mysql:'.implode(';', [
'host='.$this->creds['host'],
'port='.$this->creds['port'],
'dbname='.$this->creds['name'],
]);
$this->info('Connection string: '.$dsn);
try {
$this->conn = new PDO($dsn, $this->creds['user'], $this->creds['pass']);
$this->conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
} catch (\PDOException $e) {
$this->error($e);
exit();
}
}
/**
* @param $message
*/
protected function comment($message)
{
$this->log->writeln('<comment>'.$message.'</comment>');
}
/**
* @param $message
*/
protected function error($message)
{
$this->log->writeln('<error>'.$message.'</error>');
}
/**
* @param string|array $message
*/
protected function info($message)
{
if (\is_array($message)) {
/* @noinspection ForgottenDebugOutputInspection */
print_r($message);
} else {
$this->log->writeln('<info>'.$message.'</info>');
}
}
/**
* Return the table name with the prefix
*
* @param $table
*
* @return string
*/
protected function tableName($table)
{
if ($this->creds['table_prefix'] !== false) {
return $this->creds['table_prefix'].$table;
}
return $table;
}
/**
* @param \Illuminate\Database\Eloquent\Model $model
*
* @return bool
*/
protected function saveModel($model)
{
try {
$model->save();
return true;
} catch (QueryException $e) {
if ($e->getCode() !== '23000') {
$this->error($e);
}
return false;
}
}
/**
* Create a new mapping between an old ID and the new one
*
* @param $entity
* @param $old_id
* @param $new_id
*/
protected function addMapping($entity, $old_id, $new_id)
{
if (!array_key_exists($entity, $this->mappedEntities)) {
$this->mappedEntities[$entity] = [];
}
$this->mappedEntities[$entity][$old_id] = $new_id;
}
/**
* Return the ID for a mapping
*
* @param $entity
* @param $old_id
*
* @return bool
*/
protected function getMapping($entity, $old_id)
{
if (!array_key_exists($entity, $this->mappedEntities)) {
return 0;
}
$entity = $this->mappedEntities[$entity];
if (array_key_exists($old_id, $entity)) {
return $entity[$old_id];
}
return 0;
}
/**
* @param $date
*
* @return Carbon
*/
protected function parseDate($date)
{
$carbon = Carbon::parse($date);
return $carbon;
}
/**
* Take a decimal duration and convert it to minutes
*
* @param $duration
*
* @return float|int
*/
protected function convertDuration($duration)
{
if (strpos($duration, '.') !== false) {
$delim = '.';
} elseif (strpos($duration, ':')) {
$delim = ':';
} else {
// no delimiter, assume it's just a straight hour
return (int) $duration * 60;
}
$hm = explode($delim, $duration);
$hours = (int) $hm[0] * 60;
$mins = (int) $hm[1];
return $hours + $mins;
}
/**
* @param $table
*
* @return mixed
*/
protected function getTotalRows($table)
{
$table = $this->tableName($table);
$sql = 'SELECT COUNT(*) FROM '.$table;
$rows = $this->conn->query($sql)->fetchColumn();
$this->info('Found '.$rows.' rows in '.$table);
return (int) $rows;
}
/**
* Read all the rows in a table, but read them in a batched manner
*
* @param string $table The name of the table
* @param null $read_rows Number of rows to read
*
* @return \Generator
*/
protected function readRows($table, $read_rows = null)
{
// Set the table prefix if it has been entered
$this->tableName($table);
$offset = 0;
if ($read_rows === null) {
$read_rows = self::BATCH_READ_ROWS;
}
$total_rows = $this->getTotalRows($table);
while ($offset < $total_rows) {
$rows_to_read = $offset + $read_rows;
if ($rows_to_read > $total_rows) {
$rows_to_read = $total_rows;
}
$this->info('Reading '.$offset.' to '.$rows_to_read.' of '.$total_rows);
$sql = 'SELECT * FROM '.$this->tableName($table)
.' LIMIT '.self::BATCH_READ_ROWS.' OFFSET '.$offset;
try {
foreach ($this->conn->query($sql) as $row) {
yield $row;
}
} catch (PDOException $e) {
// Without incrementing the offset, it should re-run the same query
$this->error($e);
if (strpos($e->getMessage(), 'server has gone away') !== false) {
$this->reconnect();
continue;
}
}
$offset += self::BATCH_READ_ROWS;
}
}
/**
* Return the subfleet
*
* @return mixed
*/
protected function getSubfleet()
{
$airline = Airline::first();
$subfleet = Subfleet::firstOrCreate(
['airline_id' => $airline->id, 'name' => self::SUBFLEET_NAME],
['type' => 'PHPVMS']
);
return $subfleet;
}
/**
* All the individual importers, done on a per-table basis
* Some tables get saved locally for tables that use FK refs
*/
/**
* Import all of the ranks
*/
protected function importRanks()
{
$this->comment('--- RANK IMPORT ---');
$count = 0;
foreach ($this->readRows('ranks') as $row) {
$rank = Rank::firstOrCreate(
['name' => $row->rank],
['image_url' => $row->rankimage, 'hours' => $row->minhours]
);
$this->addMapping('ranks', $row->rankid, $rank->id);
$this->addMapping('ranks', $row->rank, $rank->id);
if ($rank->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' ranks');
}
/**
* Import all of the airlines. Save them all in the private var $airlines
* They're used to lookup from other reference tables
*/
protected function importAirlines()
{
$this->comment('--- AIRLINE IMPORT ---');
$count = 0;
foreach ($this->readRows('airlines') as $row) {
$airline = Airline::firstOrCreate(
['icao' => $row->code],
['iata' => $row->code, 'name' => $row->name, 'active' => $row->enabled]
);
$this->addMapping('airlines', $row->id, $airline->id);
$this->addMapping('airlines', $row->code, $airline->id);
if ($airline->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' airlines');
}
/**
* Imported the aircraft
*/
protected function importAircraft()
{
$this->comment('--- AIRCRAFT IMPORT ---');
$subfleet = $this->getSubfleet();
$this->info('Subfleet ID is '.$subfleet->id);
$count = 0;
foreach ($this->readRows('aircraft') as $row) {
$aircraft = Aircraft::firstOrCreate(
['name' => $row->fullname, 'registration' => $row->registration],
['icao' => $row->icao,
'subfleet_id' => $subfleet->id,
'active' => $row->enabled,
]);
$this->addMapping('aircraft', $row->id, $aircraft->id);
if ($aircraft->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' aircraft');
}
/**
* Import all of the airports
*/
protected function importAirports()
{
$this->comment('--- AIRPORT IMPORT ---');
$count = 0;
foreach ($this->readRows('airports') as $row) {
$attrs = [
'id' => trim($row->icao),
'icao' => trim($row->icao),
'name' => $row->name,
'country' => $row->country,
'lat' => $row->lat,
'lon' => $row->lng,
'hub' => $row->hub,
];
$airport = Airport::updateOrCreate(
['id' => $attrs['id']],
$attrs
);
if ($airport->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' airports');
}
/**
* Import the flights and schedules
*/
protected function importFlights()
{
$this->comment('--- FLIGHT SCHEDULE IMPORT ---');
$count = 0;
foreach ($this->readRows('schedules') as $row) {
$airline_id = $this->getMapping('airlines', $row->code);
$flight_num = trim($row->flightnum);
$attrs = [
'dpt_airport_id' => $row->depicao,
'arr_airport_id' => $row->arricao,
'route' => $row->route ?: '',
'distance' => round($row->distance ?: 0, 2),
'level' => $row->flightlevel ?: 0,
'dpt_time' => $row->deptime ?: '',
'arr_time' => $row->arrtime ?: '',
'flight_time' => $this->convertDuration($row->flighttime) ?: '',
'notes' => $row->notes ?: '',
'active' => $row->enabled ?: true,
];
try {
$flight = Flight::updateOrCreate(
['airline_id' => $airline_id, 'flight_number' => $flight_num],
$attrs
);
} catch (\Exception $e) {
//$this->error($e);
}
$this->addMapping('flights', $row->id, $flight->id);
// TODO: deserialize route_details into ACARS table
if ($flight->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' flights');
}
/**
* Import all of the PIREPs
*/
protected function importPireps()
{
$this->comment('--- PIREP IMPORT ---');
$count = 0;
foreach ($this->readRows('pireps') as $row) {
$pirep_id = $row->pirepid;
$user_id = $this->getMapping('users', $row->pilotid);
$airline_id = $this->getMapping('airlines', $row->code);
$aircraft_id = $this->getMapping('aircraft', $row->aircraft);
$attrs = [
//'id' => $pirep_id,
'user_id' => $user_id,
'airline_id' => $airline_id,
'aircraft_id' => $aircraft_id,
'flight_number' => $row->flightnum ?: '',
'dpt_airport_id' => $row->depicao,
'arr_airport_id' => $row->arricao,
'block_fuel' => $row->fuelused,
'route' => $row->route ?: '',
'source_name' => $row->source,
'created_at' => $this->parseDate($row->submitdate),
'updated_at' => $this->parseDate($row->modifieddate),
];
// Set the distance
$distance = round($row->distance ?: 0, 2);
$attrs['distance'] = $distance;
$attrs['planned_distance'] = $distance;
// Set the flight time properly
$duration = $this->convertDuration($row->flighttime_stamp);
$attrs['flight_time'] = $duration;
$attrs['planned_flight_time'] = $duration;
// Set how it was filed
if (strtoupper($row->source) === 'MANUAL') {
$attrs['source'] = PirepSource::MANUAL;
} else {
$attrs['source'] = PirepSource::ACARS;
}
// Set the flight type
$row->flighttype = strtoupper($row->flighttype);
if ($row->flighttype === 'P') {
$attrs['flight_type'] = FlightType::SCHED_PAX;
} elseif ($row->flighttype === 'C') {
$attrs['flight_type'] = FlightType::SCHED_CARGO;
} else {
$attrs['flight_type'] = FlightType::CHARTER_PAX_ONLY;
}
// Set the flight level of the PIREP is set
if (property_exists($row, 'flightlevel')) {
$attrs['level'] = $row->flightlevel;
} else {
$attrs['level'] = 0;
}
$pirep = Pirep::updateOrCreate(
['id' => $pirep_id],
$attrs
);
$source = strtoupper($row->source);
if ($source === 'SMARTCARS') {
// TODO: Parse smartcars log into the acars table
} elseif ($source === 'KACARS') {
// TODO: Parse kACARS log into acars table
} elseif ($source === 'XACARS') {
// TODO: Parse XACARS log into acars table
}
// TODO: Add extra fields in as PIREP fields
$this->addMapping('pireps', $row->pirepid, $pirep->id);
if ($pirep->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' pireps');
}
protected function importUsers()
{
$this->comment('--- USER IMPORT ---');
$count = 0;
foreach ($this->readRows('pilots', 50) as $row) {
// TODO: What to do about pilot ids
$name = $row->firstname.' '.$row->lastname;
$airline_id = $this->getMapping('airlines', $row->code);
$rank_id = $this->getMapping('ranks', $row->rank);
$state = $this->getUserState($row->retired);
$new_password = Str::random(60);
$attrs = [
'name' => $name,
'password' => Hash::make($new_password),
'api_key' => Utils::generateApiKey(),
'airline_id' => $airline_id,
'rank_id' => $rank_id,
'home_airport_id' => $row->hub,
'curr_airport_id' => $row->hub,
'flights' => (int) $row->totalflights,
'flight_time' => Utils::hoursToMinutes($row->totalhours),
'state' => $state,
'created_at' => $this->parseDate($row->joindate),
];
$user = User::updateOrCreate(
['email' => $row->email],
$attrs
);
$this->addMapping('users', $row->pilotid, $user->id);
if ($user->wasRecentlyCreated) {
$count++;
}
}
$this->info('Imported '.$count.' users');
}
/**
* Go through and set the last PIREP ID for the users
*/
protected function findLastPireps()
{
}
/**
* Recalculate all of the user ranks
*/
protected function recalculateRanks()
{
/*$this->comment('--- RECALCULATING RANKS ---');*/
}
/**
* Get the user's new state from their original state
*
* @param $state
*
* @return int
*/
protected function getUserState($state)
{
// TODO: This state might differ between simpilot and classic version
$state = (int) $state;
// Declare array of classic states
$phpvms_classic_states = [
'ACTIVE' => 0,
'INACTIVE' => 1,
'BANNED' => 2,
'ON_LEAVE' => 3,
];
// Decide which state they will be in accordance with v7
if ($state === $phpvms_classic_states['ACTIVE']) {
return UserState::ACTIVE;
} elseif ($state === $phpvms_classic_states['INACTIVE']) {
// TODO: Make an inactive state?
return UserState::REJECTED;
} elseif ($state === $phpvms_classic_states['BANNED']) {
return UserState::SUSPENDED;
} elseif ($state === $phpvms_classic_states['ON_LEAVE']) {
return UserState::ON_LEAVE;
}
$this->error('Unknown status: '.$state);
}
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Contracts;
use App\Models\Airport;
abstract class AirportLookup
{
/**
* Lookup the information for an airport. Needs to return an instance of the
* Airport model, or an array with the properties listed in the Airport model.
*
* The in-use implementation can be changed in the config/phpvms.php file, so
* different services can be used, in-case vaCentral one isn't working or there
* is a better one available. Don't handle any caching in this layer, that happens
* at the service layer
*
* Return null if there's an error or nothing was found
*
* @example App\Services\AirportLookup\VaCentralLookup
*
* @param string $icao
*
* @return Airport|null
*/
abstract public function getAirport($icao);
}

View File

@@ -1,12 +1,13 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use App\Facades\Utils;
use App\Models\Award as AwardModel; use App\Models\Award as AwardModel;
use App\Models\User; use App\Models\User;
use App\Models\UserAward; use App\Models\UserAward;
use Log; use App\Support\Utils;
use Exception;
use Illuminate\Support\Facades\Log;
/** /**
* Base class for the Awards, you need to extend this, and implement: * Base class for the Awards, you need to extend this, and implement:
@@ -38,12 +39,6 @@ abstract class Award
protected $award; protected $award;
protected $user; protected $user;
/**
* AwardInterface constructor.
*
* @param AwardModel $award
* @param User $user
*/
public function __construct(AwardModel $award = null, User $user = null) public function __construct(AwardModel $award = null, User $user = null)
{ {
$this->award = $award; $this->award = $award;
@@ -73,7 +68,7 @@ abstract class Award
* *
* @return bool|UserAward * @return bool|UserAward
*/ */
final protected function addAward() protected function addAward()
{ {
$w = [ $w = [
'user_id' => $this->user->id, 'user_id' => $this->user->id,
@@ -90,7 +85,7 @@ abstract class Award
try { try {
$award->save(); $award->save();
} catch (\Exception $e) { } catch (Exception $e) {
Log::error( Log::error(
'Error saving award: '.$e->getMessage(), 'Error saving award: '.$e->getMessage(),
$e->getTrace() $e->getTrace()

View File

@@ -1,8 +1,8 @@
<?php <?php
namespace App\Console; namespace App\Contracts;
use Log; use Illuminate\Support\Facades\Log;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;
/** /**
@@ -16,15 +16,25 @@ abstract class Command extends \Illuminate\Console\Command
abstract public function handle(); abstract public function handle();
/** /**
* Splice the logger and replace the active handlers with * Adjust the logging depending on where we're running from
* the handlers from the "cron" stack in config/logging.php
*
* Close out any of the existing handlers so we don't leave
* file descriptors leaking around
*
* @param string $channel_name Channel name to grab the handlers from
*/ */
public function redirectLoggingToStdout($channel_name): void public function __construct()
{
parent::__construct();
// Running in the console but not in the tests
if (app()->runningInConsole() && env('APP_ENV') !== 'testing') {
$this->redirectLoggingToFile('stdout');
}
}
/**
* Splice the logger and replace the active handlers with the handlers from the
* a stack in config/logging.php
*
* @param string $channel_name Channel name from config/logging.php
*/
public function redirectLoggingToFile($channel_name): void
{ {
$logger = app(\Illuminate\Log\Logger::class); $logger = app(\Illuminate\Log\Logger::class);

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Contracts;
use Illuminate\View\View;
abstract class Composer
{
abstract public function compose(View $view);
}

View File

@@ -1,18 +1,21 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Laracasts\Flash\Flash;
/** /**
* Class Controller * Class Controller
*/ */
abstract class Controller extends \Illuminate\Routing\Controller abstract class Controller extends \Illuminate\Routing\Controller
{ {
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
/** /**
* Write a error to the flash and redirect the user to a route * Write a error to the flash and redirect the user to a route
@@ -24,7 +27,7 @@ abstract class Controller extends \Illuminate\Routing\Controller
*/ */
public function flashError($message, $route) public function flashError($message, $route)
{ {
flash()->error($message); Flash::error($message);
return redirect(route($route))->withInput(); return redirect(route($route))->withInput();
} }

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
/** /**
* Borrowed some ideas from myclabs/php-enum after this was created * Borrowed some ideas from myclabs/php-enum after this was created
@@ -46,7 +46,12 @@ abstract class Enum
final public static function label($value) final public static function label($value)
{ {
if (isset(static::$labels[$value])) { if (isset(static::$labels[$value])) {
return trans(static::$labels[$value]); $val = static::$labels[$value];
if (strpos($val, '.') !== false) {
return trans($val);
}
return $val;
} }
} }

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Contracts;
use Illuminate\Validation\Rule;
class FormRequest extends \Illuminate\Foundation\Http\FormRequest
{
/**
* Authorized by default
*
* @return bool
*/
public function authorize(): bool
{
return true;
}
/**
* @return array
*/
public function rules(): array
{
return [];
}
/**
* Set a given column as being unique
*
* @param $table
*
* @return array
*/
public function unique($table)
{
return [
Rule::unique($table)->ignore($this->id, 'id'),
];
}
}

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use App\Models\Airline; use App\Models\Airline;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Contracts;
use Illuminate\Contracts\Events\Dispatcher;
abstract class Listener
{
public static $callbacks = [];
/**
* Sets up any callbacks that are defined in the child class
*
* @param $events
*/
public function subscribe(Dispatcher $events): void
{
foreach (static::$callbacks as $klass => $cb) {
$events->listen($klass, get_class($this).'@'.$cb);
}
}
}

55
app/Contracts/Metar.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
namespace App\Contracts;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
/**
* Base class for implementing retrieving METARs
*/
abstract class Metar
{
/**
* Implement retrieving the METAR - return the METAR string. Needs to be protected,
* since this shouldn't be directly called. Call `get_metar($icao)` instead
*
* @param $icao
*
* @return mixed
*/
abstract protected function metar($icao): string;
/**
* Download the METAR, wrap in caching
*
* @param $icao
*
* @return string
*/
public function get_metar($icao): string
{
$cache = config('cache.keys.WEATHER_LOOKUP');
$key = $cache['key'].$icao;
if (Cache::has($key)) {
$raw_metar = Cache::get($key);
if ($raw_metar !== '') {
return $raw_metar;
}
}
try {
$raw_metar = $this->metar($icao);
} catch (\Exception $e) {
Log::error('Error getting METAR: '.$e->getMessage(), $e->getTrace());
return '';
}
if ($raw_metar !== '') {
Cache::put($key, $raw_metar, $cache['time']);
}
return $raw_metar;
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Contracts;
use Closure;
use Illuminate\Http\Request;
interface Middleware
{
public function handle(Request $request, Closure $next);
}

View File

@@ -1,8 +1,10 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use App\Support\Database;
use DB; use DB;
use Illuminate\Support\Facades\Log;
/** /**
* Class Migration * Class Migration
@@ -23,6 +25,22 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
{ {
} }
/**
* Seed a YAML file into the database
*
* @param string $file Full path to yml file to seed
*/
public function seedFile($file): void
{
try {
$path = base_path($file);
Database::seed_from_yaml_file($path, false);
} catch (\Exception $e) {
Log::error('Unable to load '.$file.' file');
Log::error($e);
}
}
/** /**
* Add rows to a table * Add rows to a table
* *

View File

@@ -1,21 +1,22 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
/** /**
* Class Model
*
* @property mixed $id * @property mixed $id
* @property bool $skip_mutator * @property bool $skip_mutator
*
* @mixin \Illuminate\Database\Eloquent\Builder
*/ */
abstract class Model extends \Illuminate\Database\Eloquent\Model abstract class Model extends \Illuminate\Database\Eloquent\Model
{ {
public const ID_MAX_LENGTH = 12; /**
* Max length of ID for string columns
*/
public const ID_MAX_LENGTH = 16;
/** /**
* For the factories, skip the mutators. Only apply to one instance * For the factories, skip the mutators. Only apply to one instance
*
* @var bool
*/ */
public $skip_mutator = false; public $skip_mutator = false;
} }

View File

@@ -1,13 +1,14 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use Illuminate\Validation\Validator; use Illuminate\Validation\Validator;
use Prettus\Repository\Eloquent\BaseRepository;
/** /**
* Class Repository * @mixin \Prettus\Repository\Eloquent\BaseRepository
*/ */
abstract class Repository extends \Prettus\Repository\Eloquent\BaseRepository abstract class Repository extends BaseRepository
{ {
/** /**
* @param $id * @param $id
@@ -108,4 +109,32 @@ abstract class Repository extends \Prettus\Repository\Eloquent\BaseRepository
return $q; return $q;
}); });
} }
/**
* Retrieve all data of repository, paginated. Added in extra parameter to read from the
* request which page it should be on
*
* @param null $limit
* @param array $columns
* @param string $method
*
* @throws \Prettus\Repository\Exceptions\RepositoryException
*
* @return mixed
*/
public function paginate($limit = null, $columns = ['*'], $method = 'paginate')
{
$this->applyCriteria();
$this->applyScope();
$max = config('repository.pagination.limit', 50);
$limit = (int) ($limit ?? request()->query('limit') ?? $max);
$page = (int) request()->query('page', 1);
$results = $this->model->{$method}($limit, $columns, 'page', $page);
$results->appends(app('request')->query());
$this->resetModel();
return $this->parserResult($results);
}
} }

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Contracts;
/**
* Base class for a resource/response
*/
class Resource extends \Illuminate\Http\Resources\Json\Resource
{
/**
* Iterate through the list of $fields and check if they're a "Unit"
* If they are, then add the response
*
* @param $response
* @param array $fields
*/
public function checkUnitFields(&$response, array $fields): void
{
foreach ($fields as $f) {
if ($this->{$f} instanceof Unit) {
$response[$f] = $this->{$f}->getResponseUnits();
} else {
$response[$f] = $this->{$f};
}
}
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Contracts;
/**
* Abstract class for finding a route from a departure airport to an arrival airport
* Can allow for multiple, configurable methods for finding a route, whether it reaches
* out to a REST API or implement some sort of internal logic to look through a file
* or whatever the logic might be.
*
* Just one public-facing method needs to be implemented
*/
abstract class RouteFinder
{
/**
* Find a route from the departure ICAO to the arrival ICAO
*
* @param $dptIcao
* @param $arrIcao
*
* @return string
*/
abstract public function findRoute($dptIcao, $arrIcao): string;
}

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
/** /**
* Class Service * Class Service

129
app/Contracts/Unit.php Normal file
View File

@@ -0,0 +1,129 @@
<?php
namespace App\Contracts;
use ArrayAccess;
use PhpUnitsOfMeasure\Exception\UnknownUnitOfMeasure;
/**
* Abstract unit wrapper
*/
class Unit implements ArrayAccess
{
/**
* The unit this is kept as
*/
public $unit;
/**
* All of the units of this class
*/
public $units;
/**
* Holds an instance of the PhpUnit type
*
* @var \PhpUnitsOfMeasure\AbstractPhysicalQuantity
*/
protected $instance;
/**
* Units that are included as part of the REST response
*/
public $responseUnits = [];
/**
* @return mixed
*/
public function value()
{
return $this->__toString();
}
/**
* Just call toUnit() on the PhpUnitOfMeasure instance
*
* @param string $unit
*
* @return mixed
*/
public function toUnit($unit)
{
return $this->instance->toUnit($unit);
}
/**
* Return all of the units that get sent back in a response
*/
public function getResponseUnits(): array
{
$response = [];
foreach ($this->responseUnits as $unit) {
$response[$unit] = $this[$unit] ?? 0;
}
return $response;
}
/**
* Implements ArrayAccess
*
* @param $offset
*
* @return bool
*/
public function offsetExists($offset)
{
return $this->offsetGet($offset) !== null;
}
/**
* Implements ArrayAccess
*
* @param $offset
*
* @return mixed
*/
public function offsetGet($offset)
{
try {
$value = $this->instance->toUnit($offset);
if (!$value) {
return;
}
} catch (UnknownUnitOfMeasure $e) {
return;
}
return round($value, 2);
}
/**
* Implements ArrayAccess
*
* @param $offset
* @param $value
*/
public function offsetSet($offset, $value)
{
// $this->units[$offset] = $value;
}
/**
* Implements ArrayAccess
*
* @param $offset
*/
public function offsetUnset($offset)
{
// $this->units[$offset] = null;
}
/**
* @return mixed
*/
public function __toString()
{
return (string) $this->offsetGet($this->unit);
}
}

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace App\Interfaces; namespace App\Contracts;
use Arrilot\Widgets\AbstractWidget; use Arrilot\Widgets\AbstractWidget;

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Hourly; namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly; use App\Events\CronHourly;
use App\Interfaces\Listener;
use App\Models\Bid; use App\Models\Bid;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -2,8 +2,9 @@
namespace App\Cron\Hourly; namespace App\Cron\Hourly;
use App\Contracts\Listener;
use App\Events\CronHourly; use App\Events\CronHourly;
use App\Interfaces\Listener; use App\Models\Enums\PirepState;
use App\Models\Pirep; use App\Models\Pirep;
use Carbon\Carbon; use Carbon\Carbon;
@@ -13,7 +14,7 @@ use Carbon\Carbon;
class RemoveExpiredLiveFlights extends Listener class RemoveExpiredLiveFlights extends Listener
{ {
/** /**
* Remove expired live flights * Remove expired live flights that haven't had an update in the live time
* *
* @param CronHourly $event * @param CronHourly $event
* *
@@ -26,7 +27,7 @@ class RemoveExpiredLiveFlights extends Listener
} }
$date = Carbon::now()->subHours(setting('acars.live_time')); $date = Carbon::now()->subHours(setting('acars.live_time'));
Pirep::whereDate('created_at', '<', $date) Pirep::whereDate('updated_at', '<', $date)
->where('state', PirepState::IN_PROGRESS) ->where('state', PirepState::IN_PROGRESS)
->delete(); ->delete();
} }

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Monthly; namespace App\Cron\Monthly;
use App\Contracts\Listener;
use App\Events\CronMonthly; use App\Events\CronMonthly;
use App\Interfaces\Listener;
use App\Models\Enums\ExpenseType; use App\Models\Enums\ExpenseType;
use App\Services\Finance\RecurringFinanceService; use App\Services\Finance\RecurringFinanceService;

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Nightly; namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly; use App\Events\CronNightly;
use App\Interfaces\Listener;
use App\Models\Enums\ExpenseType; use App\Models\Enums\ExpenseType;
use App\Services\Finance\RecurringFinanceService; use App\Services\Finance\RecurringFinanceService;

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Services\SimBriefService;
/**
* Clear any expired SimBrief flight briefs that aren't attached to a PIREP
*/
class ClearExpiredSimbrief extends Listener
{
private $simbriefSvc;
public function __construct(SimBriefService $simbriefSvc)
{
$this->simbriefSvc = $simbriefSvc;
}
/**
* @param \App\Events\CronNightly $event
*/
public function handle(CronNightly $event): void
{
$this->simbriefSvc->removeExpiredEntries();
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly;
use App\Services\VersionService;
/**
* Determine if any pilots should be set to ON LEAVE status
*/
class NewVersionCheck extends Listener
{
private $versionSvc;
/**
* @param VersionService $versionSvc
*/
public function __construct(VersionService $versionSvc)
{
$this->versionSvc = $versionSvc;
}
/**
* Set any users to being on leave after X days
*
* @param CronNightly $event
*/
public function handle(CronNightly $event): void
{
$this->versionSvc->isNewVersionAvailable();
}
}

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Nightly; namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly; use App\Events\CronNightly;
use App\Interfaces\Listener;
use App\Models\Enums\UserState; use App\Models\Enums\UserState;
use App\Models\User; use App\Models\User;
use App\Services\UserService; use App\Services\UserService;

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Nightly; namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly; use App\Events\CronNightly;
use App\Interfaces\Listener;
use App\Models\Journal; use App\Models\Journal;
use App\Repositories\JournalRepository; use App\Repositories\JournalRepository;
use Log; use Log;

View File

@@ -2,25 +2,24 @@
namespace App\Cron\Nightly; namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly; use App\Events\CronNightly;
use App\Interfaces\Listener; use App\Services\AircraftService;
use App\Models\Enums\UserState;
use App\Repositories\UserRepository;
use App\Services\UserService; use App\Services\UserService;
use Log; use Illuminate\Support\Facades\Log;
/** /**
* This recalculates the balances on all of the journals * This recalculates the balances on all of the journals
*/ */
class RecalculateStats extends Listener class RecalculateStats extends Listener
{ {
private $userRepo; private $aircraftSvc;
private $userSvc; private $userSvc;
public function __construct(UserRepository $userRepo, UserService $userService) public function __construct(AircraftService $aircraftSvc, UserService $userSvc)
{ {
$this->userRepo = $userRepo; $this->aircraftSvc = $aircraftSvc;
$this->userSvc = $userService; $this->userSvc = $userSvc;
} }
/** /**
@@ -33,17 +32,10 @@ class RecalculateStats extends Listener
*/ */
public function handle(CronNightly $event): void public function handle(CronNightly $event): void
{ {
Log::info('Recalculating balances'); Log::info('Recalculating user stats');
$this->userSvc->recalculateAllUserStats();
$w = [ Log::info('Recalcuating aircraft status');
['state', '!=', UserState::REJECTED], $this->aircraftSvc->recalculateStats();
];
$users = $this->userRepo->findWhere($w, ['id', 'name', 'airline_id']);
foreach ($users as $user) {
$this->userSvc->recalculateStats($user);
}
Log::info('Done recalculating stats');
} }
} }

View File

@@ -2,8 +2,8 @@
namespace App\Cron\Nightly; namespace App\Cron\Nightly;
use App\Contracts\Listener;
use App\Events\CronNightly; use App\Events\CronNightly;
use App\Interfaces\Listener;
use App\Models\Enums\Days; use App\Models\Enums\Days;
use App\Models\Flight; use App\Models\Flight;
use Carbon\Carbon; use Carbon\Carbon;

View File

@@ -8,7 +8,7 @@ use Faker\Generator as Faker;
if (!function_exists('createFactoryICAO')) { if (!function_exists('createFactoryICAO')) {
function createFactoryICAO(): string function createFactoryICAO(): string
{ {
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$max = strlen($characters) - 1; $max = strlen($characters) - 1;
$string = ''; $string = '';
for ($i = 0; $i < 4; $i++) { for ($i = 0; $i < 4; $i++) {
@@ -26,14 +26,15 @@ if (!function_exists('createFactoryICAO')) {
* Add any number of airports. Don't really care if they're real or not * Add any number of airports. Don't really care if they're real or not
*/ */
$factory->define(App\Models\Airport::class, function (Faker $faker) { $factory->define(App\Models\Airport::class, function (Faker $faker) {
$used = []; $usedIcaos = [];
return [
'id' => function () use ($used) {
do {
$string = createFactoryICAO();
} while (in_array($string, $used, true));
return $string; return [
'id' => function () use ($usedIcaos) {
do {
$airport = createFactoryICAO();
} while (in_array($airport, $usedIcaos, true));
return $airport;
}, },
'icao' => function (array $apt) { 'icao' => function (array $apt) {
return $apt['id']; return $apt['id'];
@@ -48,8 +49,8 @@ $factory->define(App\Models\Airport::class, function (Faker $faker) {
'lon' => $faker->longitude, 'lon' => $faker->longitude,
'hub' => false, 'hub' => false,
'ground_handling_cost' => $faker->randomFloat(2, 0, 500), 'ground_handling_cost' => $faker->randomFloat(2, 0, 500),
'fuel_100ll_cost' => $faker->randomFloat(2, 0, 100), 'fuel_100ll_cost' => $faker->randomFloat(2, 1, 10),
'fuel_jeta_cost' => $faker->randomFloat(2, 0, 100), 'fuel_jeta_cost' => $faker->randomFloat(2, 1, 10),
'fuel_mogas_cost' => $faker->randomFloat(2, 0, 100), 'fuel_mogas_cost' => $faker->randomFloat(2, 1, 10),
]; ];
}); });

View File

@@ -22,12 +22,14 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) {
'alt_airport_id' => function () { 'alt_airport_id' => function () {
return factory(App\Models\Airport::class)->create()->id; return factory(App\Models\Airport::class)->create()->id;
}, },
'distance' => $faker->numberBetween(0, 3000), 'distance' => $faker->numberBetween(1, 1000),
'route' => null, 'route' => null,
'level' => 0, 'level' => 0,
'dpt_time' => $faker->time(), 'dpt_time' => $faker->time(),
'arr_time' => $faker->time(), 'arr_time' => $faker->time(),
'flight_time' => $faker->numberBetween(60, 360), 'flight_time' => $faker->numberBetween(60, 360),
'load_factor' => $faker->randomElement([15, 20, 50, 90, 100]),
'load_factor_variance' => $faker->randomElement([15, 20, 50, 90, 100]),
'has_bid' => false, 'has_bid' => false,
'active' => true, 'active' => true,
'visible' => true, 'visible' => true,
@@ -35,7 +37,7 @@ $factory->define(App\Models\Flight::class, function (Faker $faker) {
'start_date' => null, 'start_date' => null,
'end_date' => null, 'end_date' => null,
'created_at' => $faker->dateTimeBetween('-1 week', 'now'), 'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
'updated_at' => function (array $flight) { 'updated_at' => static function (array $flight) {
return $flight['created_at']; return $flight['created_at'];
}, },
]; ];

View File

@@ -1,5 +1,8 @@
<?php <?php
use App\Models\Enums\PirepSource;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use Carbon\Carbon; use Carbon\Carbon;
use Faker\Generator as Faker; use Faker\Generator as Faker;
@@ -7,10 +10,15 @@ use Faker\Generator as Faker;
* Create a new PIREP * Create a new PIREP
*/ */
$factory->define(App\Models\Pirep::class, function (Faker $faker) { $factory->define(App\Models\Pirep::class, function (Faker $faker) {
$airline = factory(App\Models\Airline::class)->create();
$flight = factory(App\Models\Flight::class)->create([
'airline_id' => $airline->id,
]);
return [ return [
'id' => $faker->unique()->numberBetween(10, 10000000), 'id' => $faker->unique()->numberBetween(10, 10000000),
'airline_id' => function () { 'airline_id' => function () use ($airline) {
return factory(App\Models\Airline::class)->create()->id; return $airline->id;
}, },
'user_id' => function () { 'user_id' => function () {
return factory(App\Models\User::class)->create()->id; return factory(App\Models\User::class)->create()->id;
@@ -18,18 +26,19 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) {
'aircraft_id' => function () { 'aircraft_id' => function () {
return factory(App\Models\Aircraft::class)->create()->id; return factory(App\Models\Aircraft::class)->create()->id;
}, },
'flight_number' => function (array $pirep) { 'flight_id' => function () use ($flight) {
return factory(App\Models\Flight::class)->create([ return $flight->id;
'airline_id' => $pirep['airline_id'], },
])->flight_number; 'flight_number' => function () use ($flight) {
return $flight->flight_number;
}, },
'route_code' => null, 'route_code' => null,
'route_leg' => null, 'route_leg' => null,
'dpt_airport_id' => function () { 'dpt_airport_id' => function () use ($flight) {
return factory(App\Models\Airport::class)->create()->id; return $flight->dpt_airport_id;
}, },
'arr_airport_id' => function () { 'arr_airport_id' => function () use ($flight) {
return factory(App\Models\Airport::class)->create()->id; return $flight->arr_airport_id;
}, },
'level' => $faker->numberBetween(20, 400), 'level' => $faker->numberBetween(20, 400),
'distance' => $faker->randomFloat(2, 0, 6000), 'distance' => $faker->randomFloat(2, 0, 6000),
@@ -37,8 +46,10 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) {
'flight_time' => $faker->numberBetween(60, 360), 'flight_time' => $faker->numberBetween(60, 360),
'planned_flight_time' => $faker->numberBetween(60, 360), 'planned_flight_time' => $faker->numberBetween(60, 360),
'zfw' => $faker->randomFloat(2), 'zfw' => $faker->randomFloat(2),
'block_fuel' => $faker->randomFloat(2, 0, 30000), 'block_fuel' => $faker->randomFloat(2, 0, 1000),
'fuel_used' => $faker->randomFloat(2, 0, 30000), 'fuel_used' => function (array $pirep) {
return round($pirep['block_fuel'] * .9, 2); // 90% of the fuel loaded was used
},
'block_on_time' => Carbon::now('UTC'), 'block_on_time' => Carbon::now('UTC'),
'block_off_time' => function (array $pirep) { 'block_off_time' => function (array $pirep) {
return $pirep['block_on_time']->subMinutes($pirep['flight_time']); return $pirep['block_on_time']->subMinutes($pirep['flight_time']);
@@ -46,7 +57,7 @@ $factory->define(App\Models\Pirep::class, function (Faker $faker) {
'route' => $faker->text(200), 'route' => $faker->text(200),
'notes' => $faker->text(200), 'notes' => $faker->text(200),
'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]), 'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]),
'source_name' => 'Test Factory', 'source_name' => 'TestFactory',
'state' => PirepState::PENDING, 'state' => PirepState::PENDING,
'status' => PirepStatus::SCHEDULED, 'status' => PirepStatus::SCHEDULED,
'submitted_at' => Carbon::now('UTC')->toDateTimeString(), 'submitted_at' => Carbon::now('UTC')->toDateTimeString(),

View File

@@ -0,0 +1,21 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use Carbon\Carbon;
use Faker\Generator as Faker;
$factory->define(App\Models\SimBrief::class, function (Faker $faker) {
return [
'id' => $faker->unique()->numberBetween(10, 10000000),
'user_id' => null,
'flight_id' => null,
'pirep_id' => null,
'acars_xml' => '',
'ofp_xml' => '',
'created_at' => Carbon::now('UTC')->toDateTimeString(),
'updated_at' => function (array $sb) {
return $sb['created_at'];
},
];
});

View File

@@ -8,6 +8,7 @@ $factory->define(App\Models\User::class, function (Faker $faker) {
return [ return [
'id' => null, 'id' => null,
'pilot_id' => null,
'name' => $faker->name, 'name' => $faker->name,
'email' => $faker->safeEmail, 'email' => $faker->safeEmail,
'password' => $password ?: $password = Hash::make('secret'), 'password' => $password ?: $password = Hash::make('secret'),

View File

@@ -1,15 +1,16 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Services\Installer\SeederService;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class CreateSettingsTable extends Migration class CreateSettingsTable extends Migration
{ {
private $migrationSvc; private $seederSvc;
public function __construct() public function __construct()
{ {
$this->migrationSvc = new \Modules\Installer\Services\MigrationService(); $this->seederSvc = app(SeederService::class);
} }
/** /**
@@ -37,7 +38,7 @@ class CreateSettingsTable extends Migration
$table->timestamps(); $table->timestamps();
}); });
$this->migrationSvc->updateAllSettings(); $this->seederSvc->syncAllSettings();
} }
/** /**

View File

@@ -1,6 +1,7 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Models\Pirep;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
@@ -24,7 +25,7 @@ class CreateUsersTable extends Migration
$table->string('country', 2)->nullable(); $table->string('country', 2)->nullable();
$table->string('home_airport_id', 5)->nullable(); $table->string('home_airport_id', 5)->nullable();
$table->string('curr_airport_id', 5)->nullable(); $table->string('curr_airport_id', 5)->nullable();
$table->string('last_pirep_id', \App\Models\Pirep::ID_MAX_LENGTH)->nullable(); $table->string('last_pirep_id', Pirep::ID_MAX_LENGTH)->nullable();
$table->unsignedBigInteger('flights')->default(0); $table->unsignedBigInteger('flights')->default(0);
$table->unsignedBigInteger('flight_time')->nullable()->default(0); $table->unsignedBigInteger('flight_time')->nullable()->default(0);
$table->unsignedBigInteger('transfer_time')->nullable()->default(0); $table->unsignedBigInteger('transfer_time')->nullable()->default(0);

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class RolesPermissionsTables extends Migration class RolesPermissionsTables extends Migration
@@ -74,11 +74,6 @@ class RolesPermissionsTables extends Migration
'name' => 'admin', 'name' => 'admin',
'display_name' => 'Administrators', 'display_name' => 'Administrators',
], ],
[
'id' => 2,
'name' => 'user',
'display_name' => 'Pilot',
],
]; ];
$this->addData('roles', $roles); $this->addData('roles', $roles);

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class CreateAirlinesTable extends Migration class CreateAirlinesTable extends Migration

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Models\Enums\AircraftState; use App\Models\Enums\AircraftState;
use App\Models\Enums\AircraftStatus; use App\Models\Enums\AircraftStatus;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class CreateFaresTable extends Migration class CreateFaresTable extends Migration

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class CreateAirportsTable extends Migration class CreateAirportsTable extends Migration

View File

@@ -1,6 +1,7 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Contracts\Model;
use App\Models\Enums\FlightType; use App\Models\Enums\FlightType;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
@@ -14,7 +15,7 @@ class CreateFlightTables extends Migration
public function up() public function up()
{ {
Schema::create('flights', function (Blueprint $table) { Schema::create('flights', function (Blueprint $table) {
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('id', Model::ID_MAX_LENGTH);
$table->unsignedInteger('airline_id'); $table->unsignedInteger('airline_id');
$table->unsignedInteger('flight_number'); $table->unsignedInteger('flight_number');
$table->string('route_code', 5)->nullable(); $table->string('route_code', 5)->nullable();
@@ -47,7 +48,7 @@ class CreateFlightTables extends Migration
}); });
Schema::create('flight_fare', function (Blueprint $table) { Schema::create('flight_fare', function (Blueprint $table) {
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('flight_id', Model::ID_MAX_LENGTH);
$table->unsignedInteger('fare_id'); $table->unsignedInteger('fare_id');
$table->string('price', 10)->nullable(); $table->string('price', 10)->nullable();
$table->string('cost', 10)->nullable(); $table->string('cost', 10)->nullable();
@@ -71,7 +72,7 @@ class CreateFlightTables extends Migration
*/ */
Schema::create('flight_field_values', function (Blueprint $table) { Schema::create('flight_field_values', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('flight_id', Model::ID_MAX_LENGTH);
$table->string('name', 50); $table->string('name', 50);
$table->string('slug', 50)->nullable(); $table->string('slug', 50)->nullable();
$table->text('value'); $table->text('value');
@@ -83,7 +84,7 @@ class CreateFlightTables extends Migration
Schema::create('flight_subfleet', function (Blueprint $table) { Schema::create('flight_subfleet', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->unsignedInteger('subfleet_id'); $table->unsignedInteger('subfleet_id');
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('flight_id', Model::ID_MAX_LENGTH);
$table->index(['subfleet_id', 'flight_id']); $table->index(['subfleet_id', 'flight_id']);
$table->index(['flight_id', 'subfleet_id']); $table->index(['flight_id', 'subfleet_id']);

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
class CreateRanksTable extends Migration class CreateRanksTable extends Migration
@@ -28,21 +28,6 @@ class CreateRanksTable extends Migration
$table->unique('name'); $table->unique('name');
}); });
/**
* Initial required data...
*/
$ranks = [
[
'id' => 1,
'name' => 'New Pilot',
'hours' => 0,
'acars_base_pay_rate' => 50,
'manual_base_pay_rate' => 25,
],
];
$this->addData('ranks', $ranks);
} }
/** /**

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
/** /**

View File

@@ -1,6 +1,7 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Contracts\Model;
use App\Models\Enums\FlightType; use App\Models\Enums\FlightType;
use App\Models\Enums\PirepState; use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus; use App\Models\Enums\PirepStatus;
@@ -16,7 +17,7 @@ class CreatePirepTables extends Migration
public function up() public function up()
{ {
Schema::create('pireps', function (Blueprint $table) { Schema::create('pireps', function (Blueprint $table) {
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('id', Model::ID_MAX_LENGTH);
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->unsignedInteger('airline_id'); $table->unsignedInteger('airline_id');
$table->unsignedInteger('aircraft_id')->nullable(); $table->unsignedInteger('aircraft_id')->nullable();
@@ -57,7 +58,7 @@ class CreatePirepTables extends Migration
Schema::create('pirep_comments', function (Blueprint $table) { Schema::create('pirep_comments', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('pirep_id', Model::ID_MAX_LENGTH);
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->text('comment'); $table->text('comment');
$table->timestamps(); $table->timestamps();
@@ -65,7 +66,7 @@ class CreatePirepTables extends Migration
Schema::create('pirep_fares', function (Blueprint $table) { Schema::create('pirep_fares', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('pirep_id', Model::ID_MAX_LENGTH);
$table->unsignedInteger('fare_id'); $table->unsignedInteger('fare_id');
$table->unsignedInteger('count')->nullable()->default(0); $table->unsignedInteger('count')->nullable()->default(0);
@@ -81,7 +82,7 @@ class CreatePirepTables extends Migration
Schema::create('pirep_field_values', function (Blueprint $table) { Schema::create('pirep_field_values', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('pirep_id', Model::ID_MAX_LENGTH);
$table->string('name', 50); $table->string('name', 50);
$table->string('slug', 50)->nullable(); $table->string('slug', 50)->nullable();
$table->string('value')->nullable(); $table->string('value')->nullable();

View File

@@ -1,6 +1,7 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Contracts\Model;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
@@ -16,7 +17,7 @@ class CreateBidsTable extends Migration
Schema::create('bids', function (Blueprint $table) { Schema::create('bids', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('flight_id', Model::ID_MAX_LENGTH);
$table->timestamps(); $table->timestamps();
$table->index('user_id'); $table->index('user_id');

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,7 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use App\Contracts\Model;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
@@ -14,8 +15,8 @@ class CreateAcarsTables extends Migration
public function up() public function up()
{ {
Schema::create('acars', function (Blueprint $table) { Schema::create('acars', function (Blueprint $table) {
$table->string('id', 12); $table->string('id', Model::ID_MAX_LENGTH);
$table->string('pirep_id', \App\Interfaces\Model::ID_MAX_LENGTH); $table->string('pirep_id', Model::ID_MAX_LENGTH);
$table->unsignedTinyInteger('type'); $table->unsignedTinyInteger('type');
$table->unsignedInteger('nav_type')->nullable(); $table->unsignedInteger('nav_type')->nullable();
$table->unsignedInteger('order')->default(0); $table->unsignedInteger('order')->default(0);

View File

@@ -1,7 +1,8 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStatsTable extends Migration class CreateStatsTable extends Migration
{ {
@@ -22,28 +23,6 @@ class CreateStatsTable extends Migration
$table->primary('id'); $table->primary('id');
$table->timestamps(); $table->timestamps();
}); });
/*$this->addCounterGroups([
'flights' => 1,
]);
$stats = [
[
'id' => $this->formatSettingId('flights.total_flights'),
'order' => $this->getNextOrderNumber('flights'),
'value' => 0,
'type' => 'int',
'description' => 'Total number of flights in the VA',
],
[
'id' => $this->formatSettingId('flights.total_time'),
'order' => $this->getNextOrderNumber('flights'),
'value' => 0,
'type' => 'int',
'description' => 'Total number of hours in the VA',
],
];
$this->addData('stats', $stats);*/
} }
/** /**
@@ -53,6 +32,6 @@ class CreateStatsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('settings'); Schema::dropIfExists('stats');
} }
} }

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

View File

@@ -1,6 +1,6 @@
<?php <?php
use App\Interfaces\Migration; use App\Contracts\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;

Some files were not shown because too many files have changed in this diff Show More