From 073e48c396856939ee809346580d4c4395e028a7 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Sat, 8 Feb 2020 13:29:34 -0500 Subject: [PATCH] 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) --- .dockerignore | 1 + .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .travis.yml | 89 +- .travis/deploy_script.sh | 220 ++- Dockerfile | 28 + Makefile | 2 +- app/Bootstrap/LoadConfiguration.php | 6 +- app/Console/Commands/CreateConfigs.php | 95 ++ app/Console/Commands/CreateDatabase.php | 6 +- app/Console/Commands/PirepExport.php | 52 + app/Console/Commands/Version.php | 26 +- app/Console/Kernel.php | 1 - app/Console/Services/Importer.php | 704 -------- app/Contracts/Award.php | 13 +- app/Contracts/Controller.php | 4 +- app/Contracts/Listener.php | 18 +- app/Contracts/Middleware.php | 11 + app/Contracts/Migration.php | 18 + app/Contracts/Model.php | 9 +- app/Contracts/Unit.php | 24 +- app/Cron/Hourly/RemoveExpiredLiveFlights.php | 5 +- app/Database/factories/AirportFactory.php | 17 +- .../2019_07_16_141152_users_add_pilot_id.php | 22 - app/Database/seeds/dev/sample.yml | 10 +- app/Database/seeds/dev/users.yml | 10 +- app/Database/seeds/permissions.yml | 5 +- app/Database/seeds/settings.yml | 14 + app/Events/BaseEvent.php | 14 + app/Events/CronHourly.php | 16 +- app/Events/CronMonthly.php | 13 +- app/Events/CronNightly.php | 13 +- app/Events/CronWeekly.php | 10 +- app/Events/Expenses.php | 5 +- app/Events/NewsAdded.php | 15 + app/Events/PirepAccepted.php | 15 +- app/Events/PirepFiled.php | 6 +- app/Events/PirepRejected.php | 15 +- app/Events/TestEvent.php | 15 +- app/Events/UserAccepted.php | 15 +- app/Events/UserRegistered.php | 15 +- app/Events/UserStateChanged.php | 13 +- app/Events/UserStatsChanged.php | 16 +- app/Exceptions/Handler.php | 80 +- app/Facades/Utils.php | 3 - .../Controllers/Admin/AircraftController.php | 6 +- .../Controllers/Admin/AirportController.php | 24 +- .../Controllers/Admin/AwardController.php | 17 +- .../Controllers/Admin/DashboardController.php | 23 +- .../Controllers/Admin/ExpenseController.php | 16 +- app/Http/Controllers/Admin/FareController.php | 24 +- app/Http/Controllers/Admin/FileController.php | 4 - .../Controllers/Admin/FinanceController.php | 20 +- .../Controllers/Admin/FlightController.php | 1 + .../Admin/FlightFieldController.php | 20 +- .../Admin/MaintenanceController.php | 10 +- .../Controllers/Admin/PirepController.php | 22 +- .../Admin/PirepFieldController.php | 18 +- app/Http/Controllers/Admin/RankController.php | 20 +- .../Controllers/Admin/RolesController.php | 30 +- .../Controllers/Admin/SettingsController.php | 3 - .../Controllers/Admin/SubfleetController.php | 40 +- app/Http/Controllers/Admin/UserController.php | 32 +- app/Http/Controllers/Api/FlightController.php | 31 +- .../Controllers/Auth/RegisterController.php | 5 +- .../Controllers/Frontend/FlightController.php | 106 +- .../Controllers/Frontend/PirepController.php | 6 + .../Frontend/ProfileController.php | 42 +- app/Http/Kernel.php | 6 +- app/Http/Middleware/ApiAuth.php | 8 +- app/Http/Middleware/EncryptCookies.php | 3 +- app/Http/Middleware/InstalledCheck.php | 15 +- app/Http/Middleware/JsonResponse.php | 6 +- app/Http/Middleware/MeasureExecutionTime.php | 18 +- .../Middleware/RedirectIfAuthenticated.php | 15 +- app/Http/Middleware/SetActiveTheme.php | 15 +- app/Http/Middleware/UpdatePending.php | 12 +- app/Http/Middleware/VerifyCsrfToken.php | 3 +- app/Http/Requests/Acars/CommentRequest.php | 2 +- app/Http/Requests/Acars/EventRequest.php | 6 +- app/Http/Requests/Acars/FileRequest.php | 44 +- app/Http/Requests/Acars/LogRequest.php | 6 +- app/Http/Requests/Acars/PositionRequest.php | 24 +- app/Http/Requests/Acars/PrefileRequest.php | 38 +- app/Http/Requests/Acars/RouteRequest.php | 2 +- app/Http/Requests/Acars/UpdateRequest.php | 41 +- app/Http/Routes/admin.php | 271 ++- app/Http/Routes/api.php | 4 + app/Http/Routes/console.php | 18 - app/Http/Routes/web.php | 17 +- .../{BidEvents.php => BidEventHandler.php} | 34 +- app/Listeners/ExpenseListener.php | 3 - ...anceEvents.php => FinanceEventHandler.php} | 32 +- ...etUserActive.php => UserStateListener.php} | 2 +- app/Models/Aircraft.php | 1 + app/Models/Airport.php | 6 +- app/Models/File.php | 2 +- app/Models/Flight.php | 4 +- app/Models/Journal.php | 2 +- app/Models/News.php | 4 + app/Models/Permission.php | 3 + app/Models/Pirep.php | 39 +- app/Models/Role.php | 2 +- app/Models/User.php | 4 +- app/Notifications/Admin/UserRegistered.php | 61 - app/Notifications/BaseNotification.php | 41 + app/Notifications/Channels/MailChannel.php | 41 + .../EventHandler.php} | 83 +- .../Messages/AdminUserRegistered.php | 38 + app/Notifications/Messages/NewsAdded.php | 40 + app/Notifications/Messages/PirepAccepted.php | 50 + app/Notifications/Messages/PirepRejected.php | 47 + app/Notifications/Messages/PirepSubmitted.php | 47 + app/Notifications/Messages/UserPending.php | 42 + app/Notifications/Messages/UserRegistered.php | 39 + app/Notifications/Messages/UserRejected.php | 44 + .../{ => Notifiables}/Backups.php | 2 +- app/Notifications/Notifiables/Broadcast.php | 25 + app/Notifications/PirepAccepted.php | 68 - app/Notifications/PirepRejected.php | 68 - app/Notifications/PirepSubmitted.php | 68 - app/Notifications/UserPending.php | 65 - app/Notifications/UserRegistered.php | 60 - app/Notifications/UserRejected.php | 65 - app/Providers/AppServiceProvider.php | 17 +- app/Providers/EventServiceProvider.php | 16 +- app/Repositories/AirlineRepository.php | 3 - app/Repositories/AirportRepository.php | 7 +- app/Repositories/Criteria/WhereCriteria.php | 21 +- app/Repositories/FlightRepository.php | 34 +- app/Repositories/SubfleetRepository.php | 26 +- app/Services/AwardService.php | 9 +- app/Services/CronService.php | 24 +- app/Services/FareService.php | 13 +- app/Services/Finance/PirepFinanceService.php | 37 +- .../Finance/RecurringFinanceService.php | 25 +- app/Services/FinanceService.php | 114 ++ app/Services/GeoService.php | 51 +- .../ImportExport/AircraftImporter.php | 23 +- app/Services/ImportExport/AirportImporter.php | 8 +- app/Services/ImportExport/ExpenseImporter.php | 10 +- app/Services/ImportExport/FareImporter.php | 10 +- app/Services/ImportExport/FlightImporter.php | 17 +- .../ImportExport/SubfleetImporter.php | 10 +- .../Services/Installer}/DatabaseService.php | 33 +- app/Services/Installer/InstallerService.php | 31 + app/Services/Installer/LoggerTrait.php | 23 + app/Services/Installer/SeederService.php | 25 +- app/Services/NewsService.php | 44 + app/Services/PirepService.php | 6 +- app/Services/RoleService.php | 47 + app/Services/UserService.php | 52 +- app/Services/VersionService.php | 8 + app/Support/Metar.php | 9 +- app/Support/Units/Distance.php | 1 + app/Support/Utils.php | 76 + app/helpers.php | 31 + composer.json | 6 +- composer.lock | 1486 +++++++++-------- config/app.php | 11 +- config/backup.php | 2 +- config/flare.php | 48 + config/laratrust.php | 29 +- config/modules.php | 12 + config/modules_statuses.json | 9 + config/notifications.php | 26 + config/phpvms.php | 7 + config/queue.php | 2 +- config/repository.php | 2 +- config/version.yml | 6 +- docker-compose.yml | 3 +- intellij_style.xml | 24 +- modules/.gitignore | 3 + .../Awards}/Awards/PilotFlightAwards.php | 6 +- .../Awards/Providers/AwardServiceProvider.php | 9 + modules/Awards/module.json | 14 + modules/Importer/Config/config.php | 7 + .../Commands/ImportFromClassicCommand.php | 22 +- .../Http/Controllers/ImporterController.php | 137 ++ .../Providers/ImporterServiceProvider.php | 102 ++ .../Importer/Resources/views/app.blade.php | 94 ++ .../Resources/views/complete.blade.php | 20 + .../Importer/Resources/views/dbtest.blade.php | 8 + .../Importer/Resources/views/error.blade.php | 9 + .../views/flash/check_error.blade.php | 6 + .../Resources/views/flash/message.blade.php | 11 + .../Resources/views/step1-configure.blade.php | 136 ++ .../views/step2-processing.blade.php | 156 ++ modules/Importer/Services/BaseImporter.php | 135 ++ modules/Importer/Services/ImporterService.php | 135 ++ .../Services/Importers/AircraftImporter.php | 65 + .../Services/Importers/AirlineImporter.php | 45 + .../Services/Importers/AirportImporter.php | 62 + .../Services/Importers/ClearDatabase.php | 88 + .../Services/Importers/FinalizeImporter.php | 58 + .../Services/Importers/FlightImporter.php | 70 + .../Services/Importers/GroupImporter.php | 102 ++ .../Services/Importers/PirepImporter.php | 146 ++ .../Services/Importers/RankImport.php | 33 + .../Services/Importers/UserImport.php | 141 ++ modules/Importer/Utils/IdMapper.php | 49 + modules/Importer/Utils/ImporterDB.php | 168 ++ modules/Importer/composer.json | 29 + modules/Importer/module.json | 14 + .../Http/Controllers/InstallerController.php | 16 +- modules/Installer/Http/Routes/install.php | 16 - modules/Installer/Http/Routes/update.php | 9 - .../Providers/InstallerServiceProvider.php | 41 +- .../Installer/Resources/views/app.blade.php | 100 +- .../views/errors/already-installed.blade.php | 14 +- .../views/flash/check_error.blade.php | 8 +- .../Resources/views/flash/dbtest.blade.php | 8 - .../Resources/views/flash/message.blade.php | 14 +- .../Resources/views/install/dbtest.blade.php | 8 + .../views/install/index-start.blade.php | 14 +- .../steps/step1-requirements.blade.php | 96 +- .../views/install/steps/step2-db.blade.php | 226 +-- .../install/steps/step2a-db_output.blade.php | 8 +- .../views/install/steps/step3-user.blade.php | 143 +- .../install/steps/step3a-completed.blade.php | 24 +- .../views/update/index-start.blade.php | 14 +- .../update/steps/step1-no-update.blade.php | 14 +- .../steps/step1-update-available.blade.php | 14 +- .../steps/step2-migrations-done.blade.php | 16 +- .../steps/step3-update-complete.blade.php | 14 +- modules/Installer/Services/ConfigService.php | 3 - modules/Installer/composer.json | 3 +- .../Resources/views/admin/create.blade.php | 10 +- .../Resources/views/admin/index.blade.php | 20 +- .../Sample/Resources/views/index.blade.php | 8 +- modules/Updater/Config/config.php | 4 + .../Http/Controllers/UpdateController.php} | 37 +- .../Providers/UpdateServiceProvider.php | 91 + modules/Updater/Resources/views/app.blade.php | 94 ++ .../views/flash/check_error.blade.php | 6 + .../Resources/views/flash/message.blade.php | 11 + .../Resources/views/index-start.blade.php | 12 + .../views/steps/step1-no-update.blade.php | 13 + .../steps/step1-update-available.blade.php | 12 + .../steps/step2-migrations-done.blade.php | 18 + .../steps/step3-update-complete.blade.php | 13 + modules/Updater/composer.json | 30 + modules/Updater/module.json | 14 + package.json | 4 +- public/.htaccess | 2 +- public/assets/admin/js/app.js | 2 +- public/assets/admin/js/app.js.map | 2 +- public/assets/admin/js/vendor.js | 16 +- public/assets/frontend/js/app.js | 2 +- public/assets/frontend/js/app.js.map | 2 +- public/assets/frontend/js/vendor.js | 10 +- public/assets/global/js/vendor.js | 4 +- public/assets/installer/js/app.js.map | 2 +- public/assets/installer/js/vendor.js | 8 +- public/mix-manifest.json | 18 +- resources/docker/php/Dockerfile | 6 +- resources/js/maps/config.js | 2 +- resources/js/maps/live_map.js | 42 +- resources/js/maps/route_map.js | 15 +- resources/lang/en/common.php | 1 + resources/lang/es/common.php | 1 + resources/lang/it/common.php | 1 + resources/stubs/installer/config.stub | 3 +- .../views/admin/aircraft/create.blade.php | 24 +- resources/views/admin/aircraft/edit.blade.php | 34 +- .../views/admin/aircraft/expenses.blade.php | 142 +- .../views/admin/aircraft/fields.blade.php | 140 +- .../views/admin/aircraft/import.blade.php | 2 +- .../views/admin/aircraft/index.blade.php | 19 +- .../views/admin/aircraft/script.blade.php | 84 +- resources/views/admin/aircraft/show.blade.php | 39 +- .../admin/aircraft/show_fields.blade.php | 56 +- .../views/admin/aircraft/table.blade.php | 90 +- .../views/admin/airlines/create.blade.php | 12 +- resources/views/admin/airlines/edit.blade.php | 22 +- .../views/admin/airlines/fields.blade.php | 82 +- .../views/admin/airlines/index.blade.php | 18 +- resources/views/admin/airlines/show.blade.php | 26 +- .../admin/airlines/show_fields.blade.php | 28 +- .../views/admin/airlines/table.blade.php | 68 +- .../views/admin/airports/create.blade.php | 10 +- resources/views/admin/airports/edit.blade.php | 42 +- .../views/admin/airports/expenses.blade.php | 144 +- .../views/admin/airports/fields.blade.php | 146 +- .../views/admin/airports/import.blade.php | 2 +- .../views/admin/airports/index.blade.php | 28 +- .../views/admin/airports/script.blade.php | 144 +- .../views/admin/airports/search.blade.php | 22 +- resources/views/admin/airports/show.blade.php | 39 +- .../admin/airports/show_fields.blade.php | 29 +- .../views/admin/airports/table.blade.php | 76 +- resources/views/admin/app.blade.php | 206 +-- resources/views/admin/awards/create.blade.php | 12 +- resources/views/admin/awards/edit.blade.php | 10 +- resources/views/admin/awards/fields.blade.php | 116 +- resources/views/admin/awards/index.blade.php | 18 +- .../views/admin/awards/scripts.blade.php | 38 +- resources/views/admin/awards/table.blade.php | 70 +- .../views/admin/common/file_upload.blade.php | 148 +- resources/views/admin/common/import.blade.php | 62 +- .../views/admin/common/none_added.blade.php | 6 +- .../views/admin/components/info.blade.php | 10 +- .../views/admin/components/infobox.blade.php | 52 +- .../views/admin/dashboard/index.blade.php | 101 +- .../views/admin/dashboard/news.blade.php | 118 +- .../admin/dashboard/pirep_chart.blade.php | 117 +- .../views/admin/expenses/create.blade.php | 12 +- resources/views/admin/expenses/edit.blade.php | 14 +- .../views/admin/expenses/fields.blade.php | 98 +- .../views/admin/expenses/import.blade.php | 2 +- .../views/admin/expenses/index.blade.php | 24 +- .../views/admin/expenses/table.blade.php | 70 +- resources/views/admin/fares/create.blade.php | 12 +- resources/views/admin/fares/edit.blade.php | 10 +- resources/views/admin/fares/fields.blade.php | 68 +- resources/views/admin/fares/import.blade.php | 2 +- resources/views/admin/fares/index.blade.php | 14 +- resources/views/admin/fares/show.blade.php | 6 +- .../views/admin/fares/show_fields.blade.php | 24 +- resources/views/admin/fares/table.blade.php | 68 +- .../views/admin/finances/index.blade.php | 26 +- .../views/admin/finances/scripts.blade.php | 14 +- .../views/admin/finances/table.blade.php | 107 +- .../views/admin/flash/check_error.blade.php | 8 +- resources/views/admin/flash/message.blade.php | 49 +- .../views/admin/flightfields/create.blade.php | 12 +- .../views/admin/flightfields/edit.blade.php | 12 +- .../views/admin/flightfields/fields.blade.php | 20 +- .../views/admin/flightfields/index.blade.php | 20 +- .../views/admin/flightfields/table.blade.php | 46 +- .../views/admin/flights/create.blade.php | 12 +- resources/views/admin/flights/edit.blade.php | 36 +- resources/views/admin/flights/fares.blade.php | 160 +- .../views/admin/flights/fields.blade.php | 436 ++--- .../admin/flights/flight_fields.blade.php | 148 +- .../views/admin/flights/import.blade.php | 2 +- resources/views/admin/flights/index.blade.php | 38 +- .../views/admin/flights/scripts.blade.php | 193 ++- .../views/admin/flights/search.blade.php | 38 +- resources/views/admin/flights/show.blade.php | 46 +- .../views/admin/flights/show_fields.blade.php | 132 +- .../views/admin/flights/subfleets.blade.php | 122 +- resources/views/admin/flights/table.blade.php | 85 +- .../views/admin/maintenance/caches.blade.php | 50 +- .../views/admin/maintenance/cron.blade.php | 3 +- .../views/admin/maintenance/index.blade.php | 18 +- resources/views/admin/menu.blade.php | 145 +- .../admin/pagination/bootstrap-4.blade.php | 56 +- .../views/admin/pagination/default.blade.php | 56 +- .../admin/pagination/semantic-ui.blade.php | 60 +- .../pagination/simple-bootstrap-4.blade.php | 24 +- .../admin/pagination/simple-default.blade.php | 24 +- .../views/admin/pirepfields/create.blade.php | 12 +- .../views/admin/pirepfields/edit.blade.php | 12 +- .../views/admin/pirepfields/fields.blade.php | 32 +- .../views/admin/pirepfields/index.blade.php | 12 +- .../views/admin/pirepfields/show.blade.php | 22 +- .../admin/pirepfields/show_fields.blade.php | 20 +- .../views/admin/pirepfields/table.blade.php | 56 +- .../views/admin/pireps/actions.blade.php | 79 +- .../views/admin/pireps/comments.blade.php | 88 +- resources/views/admin/pireps/create.blade.php | 12 +- resources/views/admin/pireps/edit.blade.php | 93 +- resources/views/admin/pireps/fares.blade.php | 36 +- .../views/admin/pireps/field_values.blade.php | 58 +- resources/views/admin/pireps/fields.blade.php | 478 +++--- .../views/admin/pireps/flight_log.blade.php | 20 +- resources/views/admin/pireps/index.blade.php | 16 +- .../views/admin/pireps/pirep_card.blade.php | 86 +- .../views/admin/pireps/scripts.blade.php | 74 +- resources/views/admin/pireps/show.blade.php | 36 +- .../views/admin/pireps/show_fields.blade.php | 148 +- .../views/admin/pireps/transactions.blade.php | 74 +- resources/views/admin/ranks/create.blade.php | 10 +- resources/views/admin/ranks/edit.blade.php | 40 +- resources/views/admin/ranks/fields.blade.php | 188 +-- resources/views/admin/ranks/index.blade.php | 18 +- resources/views/admin/ranks/scripts.blade.php | 52 +- resources/views/admin/ranks/show.blade.php | 20 +- .../views/admin/ranks/show_fields.blade.php | 32 +- .../views/admin/ranks/subfleets.blade.php | 120 +- resources/views/admin/ranks/table.blade.php | 92 +- resources/views/admin/roles/create.blade.php | 12 +- resources/views/admin/roles/edit.blade.php | 22 +- resources/views/admin/roles/fields.blade.php | 83 +- resources/views/admin/roles/index.blade.php | 18 +- resources/views/admin/roles/table.blade.php | 36 +- resources/views/admin/roles/users.blade.php | 26 +- .../views/admin/settings/index.blade.php | 4 +- .../views/admin/settings/script.blade.php | 34 +- resources/views/admin/sidebar.blade.php | 44 +- .../views/admin/subfleets/create.blade.php | 24 +- .../views/admin/subfleets/edit.blade.php | 54 +- .../views/admin/subfleets/expenses.blade.php | 138 +- .../views/admin/subfleets/fares.blade.php | 146 +- .../views/admin/subfleets/fields.blade.php | 108 +- .../views/admin/subfleets/import.blade.php | 2 +- .../views/admin/subfleets/index.blade.php | 16 +- .../views/admin/subfleets/ranks.blade.php | 140 +- .../views/admin/subfleets/script.blade.php | 138 +- .../views/admin/subfleets/show.blade.php | 26 +- .../admin/subfleets/show_fields.blade.php | 20 +- .../views/admin/subfleets/table.blade.php | 52 +- resources/views/admin/users/create.blade.php | 12 +- resources/views/admin/users/edit.blade.php | 30 +- resources/views/admin/users/fields.blade.php | 222 +-- resources/views/admin/users/index.blade.php | 28 +- resources/views/admin/users/search.blade.php | 42 +- resources/views/admin/users/show.blade.php | 6 +- resources/views/admin/users/table.blade.php | 80 +- .../layouts/default/airports/show.blade.php | 166 +- resources/views/layouts/default/app.blade.php | 95 +- .../default/auth/emails/password.blade.php | 3 +- .../default/auth/login_layout.blade.php | 53 +- .../default/auth/passwords/email.blade.php | 64 +- .../default/auth/passwords/reset.blade.php | 103 +- .../layouts/default/auth/pending.blade.php | 12 +- .../layouts/default/auth/register.blade.php | 257 +-- .../layouts/default/auth/registered.blade.php | 6 +- .../layouts/default/auth/rejected.blade.php | 16 +- .../layouts/default/auth/suspended.blade.php | 16 +- .../layouts/default/auth/verify.blade.php | 43 +- .../layouts/default/components/info.blade.php | 10 +- .../layouts/default/dashboard/index.blade.php | 187 +-- .../layouts/default/downloads/index.blade.php | 38 +- .../layouts/default/downloads/table.blade.php | 25 +- .../layouts/default/errors/401.blade.php | 12 +- .../layouts/default/errors/404.blade.php | 14 +- .../layouts/default/errors/503.blade.php | 64 +- .../layouts/default/flash/message.blade.php | 30 +- .../layouts/default/flash/modal.blade.php | 26 +- .../layouts/default/flights/index.blade.php | 18 +- .../layouts/default/flights/map.blade.php | 22 +- .../layouts/default/flights/nav.blade.php | 8 +- .../layouts/default/flights/scripts.blade.php | 26 +- .../layouts/default/flights/search.blade.php | 5 + .../layouts/default/flights/show.blade.php | 134 +- .../layouts/default/flights/table.blade.php | 14 +- .../views/layouts/default/home.blade.php | 75 +- .../layouts/default/livemap/index.blade.php | 2 +- resources/views/layouts/default/nav.blade.php | 4 +- .../notifications/email-plain.blade.php | 20 +- .../default/notifications/email.blade.php | 302 ++-- .../default/pagination/bootstrap-4.blade.php | 56 +- .../default/pagination/default.blade.php | 82 +- .../default/pagination/semantic-ui.blade.php | 60 +- .../pagination/simple-bootstrap-4.blade.php | 24 +- .../pagination/simple-default.blade.php | 24 +- .../default/pireps/custom_fields.blade.php | 38 +- .../layouts/default/pireps/edit.blade.php | 22 +- .../layouts/default/pireps/fares.blade.php | 30 +- .../layouts/default/pireps/fields.blade.php | 4 +- .../layouts/default/pireps/index.blade.php | 26 +- .../layouts/default/pireps/map.blade.php | 28 +- .../default/pireps/pirep_card.blade.php | 114 +- .../layouts/default/pireps/scripts.blade.php | 20 +- .../layouts/default/pireps/show.blade.php | 412 ++--- .../layouts/default/pireps/table.blade.php | 126 +- .../layouts/default/profile/edit.blade.php | 14 +- .../layouts/default/profile/fields.blade.php | 230 +-- .../layouts/default/profile/index.blade.php | 221 +-- resources/views/layouts/default/theme.json | 4 +- .../layouts/default/users/index.blade.php | 16 +- .../layouts/default/users/table.blade.php | 92 +- .../default/widgets/airspace_map.blade.php | 14 +- .../default/widgets/latest_news.blade.php | 28 +- .../default/widgets/latest_pilots.blade.php | 16 +- .../default/widgets/live_map.blade.php | 186 +-- .../layouts/default/widgets/weather.blade.php | 138 +- .../mail/admin/pirep/submitted.blade.php | 12 - .../mail/admin/user/registered.blade.php | 9 - resources/views/mail/pirep/accepted.blade.php | 12 - resources/views/mail/pirep/rejected.blade.php | 12 - .../mail/user/new_login_details.blade.php | 17 - resources/views/mail/user/pending.blade.php | 8 - .../views/mail/user/registered.blade.php | 12 - resources/views/mail/user/rejected.blade.php | 9 - .../mail/admin/pirep/submitted.blade.php | 12 + .../mail/admin/user/registered.blade.php | 9 + .../notifications/mail/news/news.blade.php | 12 + .../mail/pirep/accepted.blade.php | 12 + .../mail/pirep/rejected.blade.php | 12 + .../mail/user/new_login_details.blade.php | 17 + .../notifications/mail/user/pending.blade.php | 8 + .../mail/user/registered.blade.php | 12 + .../mail/user/rejected.blade.php | 9 + resources/views/system/acars/config.blade.php | 5 + .../system/errors/database_error.blade.php | 104 +- .../system/errors/not_installed.blade.php | 106 +- .../views/vendor/datatables/print.blade.php | 70 +- .../views/vendor/mail/html/button.blade.php | 32 +- .../views/vendor/mail/html/footer.blade.php | 18 +- .../views/vendor/mail/html/header.blade.php | 10 +- .../views/vendor/mail/html/layout.blade.php | 85 +- .../views/vendor/mail/html/message.blade.php | 50 +- .../views/vendor/mail/html/panel.blade.php | 22 +- .../vendor/mail/html/promotion.blade.php | 10 +- .../mail/html/promotion/button.blade.php | 22 +- .../views/vendor/mail/html/subcopy.blade.php | 10 +- .../views/vendor/mail/html/table.blade.php | 2 +- .../vendor/mail/markdown/layout.blade.php | 2 +- .../vendor/mail/markdown/message.blade.php | 46 +- swagger.yml | 9 +- tests/AcarsTest.php | 78 + tests/AwardsTest.php | 2 +- tests/FinanceTest.php | 2 +- tests/FlightTest.php | 98 +- tests/ImporterTest.php | 29 +- tests/MetarTest.php | 2 +- tests/PIREPTest.php | 6 +- tests/TestCase.php | 8 +- tests/UtilsTest.php | 18 + tests/VersionTest.php | 21 +- tests/data/aircraft-update.csv | 3 + tests/data/flights.csv | 1 + yarn.lock | 933 ++++++----- 515 files changed, 13939 insertions(+), 10717 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 app/Console/Commands/CreateConfigs.php create mode 100644 app/Console/Commands/PirepExport.php delete mode 100644 app/Console/Services/Importer.php create mode 100644 app/Contracts/Middleware.php create mode 100644 app/Events/BaseEvent.php create mode 100644 app/Events/NewsAdded.php delete mode 100755 app/Http/Routes/console.php rename app/Listeners/{BidEvents.php => BidEventHandler.php} (57%) rename app/Listeners/{FinanceEvents.php => FinanceEventHandler.php} (65%) rename app/Listeners/{SetUserActive.php => UserStateListener.php} (93%) delete mode 100644 app/Notifications/Admin/UserRegistered.php create mode 100644 app/Notifications/BaseNotification.php create mode 100644 app/Notifications/Channels/MailChannel.php rename app/{Listeners/NotificationEvents.php => Notifications/EventHandler.php} (60%) create mode 100644 app/Notifications/Messages/AdminUserRegistered.php create mode 100644 app/Notifications/Messages/NewsAdded.php create mode 100644 app/Notifications/Messages/PirepAccepted.php create mode 100644 app/Notifications/Messages/PirepRejected.php create mode 100644 app/Notifications/Messages/PirepSubmitted.php create mode 100644 app/Notifications/Messages/UserPending.php create mode 100644 app/Notifications/Messages/UserRegistered.php create mode 100644 app/Notifications/Messages/UserRejected.php rename app/Notifications/{ => Notifiables}/Backups.php (90%) create mode 100644 app/Notifications/Notifiables/Broadcast.php delete mode 100644 app/Notifications/PirepAccepted.php delete mode 100644 app/Notifications/PirepRejected.php delete mode 100644 app/Notifications/PirepSubmitted.php delete mode 100644 app/Notifications/UserPending.php delete mode 100644 app/Notifications/UserRegistered.php delete mode 100644 app/Notifications/UserRejected.php rename {modules/Installer/Services => app/Services/Installer}/DatabaseService.php (69%) create mode 100644 app/Services/Installer/LoggerTrait.php create mode 100644 app/Services/NewsService.php create mode 100644 app/Services/RoleService.php create mode 100644 app/Support/Utils.php create mode 100644 config/flare.php create mode 100644 config/modules_statuses.json create mode 100644 config/notifications.php rename {app => modules/Awards}/Awards/PilotFlightAwards.php (88%) create mode 100644 modules/Awards/Providers/AwardServiceProvider.php create mode 100644 modules/Awards/module.json create mode 100644 modules/Importer/Config/config.php rename app/Console/Commands/ImportFromClassic.php => modules/Importer/Console/Commands/ImportFromClassicCommand.php (51%) create mode 100644 modules/Importer/Http/Controllers/ImporterController.php create mode 100644 modules/Importer/Providers/ImporterServiceProvider.php create mode 100644 modules/Importer/Resources/views/app.blade.php create mode 100644 modules/Importer/Resources/views/complete.blade.php create mode 100644 modules/Importer/Resources/views/dbtest.blade.php create mode 100644 modules/Importer/Resources/views/error.blade.php create mode 100644 modules/Importer/Resources/views/flash/check_error.blade.php create mode 100644 modules/Importer/Resources/views/flash/message.blade.php create mode 100644 modules/Importer/Resources/views/step1-configure.blade.php create mode 100644 modules/Importer/Resources/views/step2-processing.blade.php create mode 100644 modules/Importer/Services/BaseImporter.php create mode 100644 modules/Importer/Services/ImporterService.php create mode 100644 modules/Importer/Services/Importers/AircraftImporter.php create mode 100644 modules/Importer/Services/Importers/AirlineImporter.php create mode 100644 modules/Importer/Services/Importers/AirportImporter.php create mode 100644 modules/Importer/Services/Importers/ClearDatabase.php create mode 100644 modules/Importer/Services/Importers/FinalizeImporter.php create mode 100644 modules/Importer/Services/Importers/FlightImporter.php create mode 100644 modules/Importer/Services/Importers/GroupImporter.php create mode 100644 modules/Importer/Services/Importers/PirepImporter.php create mode 100644 modules/Importer/Services/Importers/RankImport.php create mode 100644 modules/Importer/Services/Importers/UserImport.php create mode 100644 modules/Importer/Utils/IdMapper.php create mode 100644 modules/Importer/Utils/ImporterDB.php create mode 100644 modules/Importer/composer.json create mode 100644 modules/Importer/module.json delete mode 100644 modules/Installer/Http/Routes/install.php delete mode 100644 modules/Installer/Http/Routes/update.php delete mode 100644 modules/Installer/Resources/views/flash/dbtest.blade.php create mode 100644 modules/Installer/Resources/views/install/dbtest.blade.php create mode 100644 modules/Updater/Config/config.php rename modules/{Installer/Http/Controllers/UpdaterController.php => Updater/Http/Controllers/UpdateController.php} (65%) create mode 100644 modules/Updater/Providers/UpdateServiceProvider.php create mode 100644 modules/Updater/Resources/views/app.blade.php create mode 100644 modules/Updater/Resources/views/flash/check_error.blade.php create mode 100644 modules/Updater/Resources/views/flash/message.blade.php create mode 100644 modules/Updater/Resources/views/index-start.blade.php create mode 100644 modules/Updater/Resources/views/steps/step1-no-update.blade.php create mode 100644 modules/Updater/Resources/views/steps/step1-update-available.blade.php create mode 100644 modules/Updater/Resources/views/steps/step2-migrations-done.blade.php create mode 100644 modules/Updater/Resources/views/steps/step3-update-complete.blade.php create mode 100644 modules/Updater/composer.json create mode 100644 modules/Updater/module.json delete mode 100644 resources/views/mail/admin/pirep/submitted.blade.php delete mode 100644 resources/views/mail/admin/user/registered.blade.php delete mode 100644 resources/views/mail/pirep/accepted.blade.php delete mode 100644 resources/views/mail/pirep/rejected.blade.php delete mode 100644 resources/views/mail/user/new_login_details.blade.php delete mode 100644 resources/views/mail/user/pending.blade.php delete mode 100644 resources/views/mail/user/registered.blade.php delete mode 100644 resources/views/mail/user/rejected.blade.php create mode 100644 resources/views/notifications/mail/admin/pirep/submitted.blade.php create mode 100644 resources/views/notifications/mail/admin/user/registered.blade.php create mode 100644 resources/views/notifications/mail/news/news.blade.php create mode 100644 resources/views/notifications/mail/pirep/accepted.blade.php create mode 100644 resources/views/notifications/mail/pirep/rejected.blade.php create mode 100644 resources/views/notifications/mail/user/new_login_details.blade.php create mode 100644 resources/views/notifications/mail/user/pending.blade.php create mode 100644 resources/views/notifications/mail/user/registered.blade.php create mode 100644 resources/views/notifications/mail/user/rejected.blade.php create mode 100644 resources/views/system/acars/config.blade.php create mode 100644 tests/data/aircraft-update.csv diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..22d0d82f --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +vendor diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a0a1336e..598328cd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. +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 diff --git a/.travis.yml b/.travis.yml index 9f5dd13f..e919cc66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,11 @@ language: php php: - '7.2' - '7.3' + - '7.4' -matrix: - include: - - php: '7.2' - - php: '7.3' - fast_finish: true +env: + - DB=mysql + - DB=mariadb cache: # Cache lives for 10 min @@ -24,7 +23,12 @@ cache: services: - mysql +addons: + mariadb: '10.2' + install: + - php --version + - mysql --version - composer install --dev --no-interaction --verbose - cp .travis/env.travis.php env.php - cp .travis/phpunit.travis.xml phpunit.xml @@ -40,8 +44,83 @@ script: after_failure: - cat storage/logs/*.log +# Refer to: https://github.com/doctrine/dbal/blob/master/.travis.yml#L39 jobs: 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 script: skip diff --git a/.travis/deploy_script.sh b/.travis/deploy_script.sh index a7541f25..652471cd 100755 --- a/.travis/deploy_script.sh +++ b/.travis/deploy_script.sh @@ -2,139 +2,131 @@ if [ "$TRAVIS" = "true" ]; then - cd $TRAVIS_BUILD_DIR + cd $TRAVIS_BUILD_DIR - if test "$TRAVIS_TAG"; then - PKG_NAME=$TRAVIS_TAG - else - echo "On branch $TRAVIS_BRANCH" + if test "$TRAVIS_TAG"; then + PKG_NAME=$TRAVIS_TAG + VERSION=$TRAVIS_TAG - if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then - echo "Not on valid branch, exiting" - exit 0; - fi; + # Pass in the tag as the version to write out + php artisan phpvms:version --write $VERSION + else + echo "On branch $TRAVIS_BRANCH" - BASE_VERSION=$(php artisan phpvms:version --base-only) - PKG_NAME=${BASE_VERSION}-${TRAVIS_BRANCH} + if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then + echo "Not on valid branch, exiting" + exit 0 fi - FILE_NAME="phpvms-$PKG_NAME" - TAR_NAME="$FILE_NAME.tar.gz" - echo "Writing $TAR_NAME" + # Write the version out but place the branch ID in there + # This is only for the dev branch + 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 + PKG_NAME=${BASE_VERSION} + + # Don't pass in a version here, just write out the latest hash + php artisan phpvms:version --write >VERSION VERSION=$(cat VERSION) - echo "Version: $VERSION" + fi - echo "Cleaning files" + echo "Version: $VERSION" + echo "Package name: $TAR_NAME" - rm -rf vendor - composer install --no-dev --prefer-dist --no-interaction --verbose + FILE_NAME="phpvms-$PKG_NAME" + TAR_NAME="$FILE_NAME.tar.gz" - # Clean up the dependencies to remove some of the dev packages -# declare -a remove_packages=( -# 'barryvdh/laravel-ide-helper' -# '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 + echo "Cleaning files" - # Leftover individual files to delete - declare -a remove_files=( - .git - .github - .sass-cache - .idea - .travis - docker - tests - _ide_helper.php - .dpl - .editorconfig - .eslintignore - .eslintrc - .php_cs - .php_cs.cache - .phpstorm.meta.php - .styleci.yml - .phpunit.result.cache - env.php - intellij_style.xml - config.php - docker-compose.yml - Makefile - phpcs.xml - phpunit.xml - phpvms.iml - Procfile - phpstan.neon - node_modules - composer.phar - vendor/willdurand/geocoder/tests - ) + rm -rf vendor + composer install --no-dev --prefer-dist --no-interaction --verbose - for file in "${remove_files[@]}" - do - rm -rf $file - done + # Leftover individual files to delete + declare -a remove_files=( + .git + .github + .sass-cache + .idea + .travis + docker + _ide_helper.php + .dockerignore + .dpl + .editorconfig + .eslintignore + .eslintrc + .php_cs + .php_cs.cache + .phpstorm.meta.php + .styleci.yml + .phpunit.result.cache + env.php + intellij_style.xml + config.php + docker-compose.yml + Makefile + phpcs.xml + phpunit.xml + phpvms.iml + Procfile + phpstan.neon + node_modules + composer.phar + vendor/willdurand/geocoder/tests + ) - find ./vendor -type d -name ".git" -print0 | xargs rm -rf - find . -type d -name "sass-cache" -print0 | xargs rm -rf + for file in "${remove_files[@]}"; do + rm -rf $file + done - # clear any app specific stuff that might have been loaded in - find storage/app -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name public -not -name import -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/app/public/avatars -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/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 {} + + find ./vendor -type d -name ".git" -print0 | xargs rm -rf + find . -type d -name "sass-cache" -print0 | xargs rm -rf - 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 + # clear any app specific stuff that might have been loaded in + find bootstrap/cache -mindepth 1 -maxdepth 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/app/public -mindepth 1 -maxdepth 1 -not -name '.gitignore' -not -name avatars -not -name uploads -print0 -exec rm -rf {} + + find storage/app/public/avatars -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/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 {} + - # Regenerate the autoloader and classes - composer dump-autoload - 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" - cd /tmp - tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms - sha256sum $TAR_NAME > "$TAR_NAME.sha256" + # Regenerate the autoloader and classes + composer dump-autoload + make clean - echo "Uploading to S3" - mkdir -p $TRAVIS_BUILD_DIR/build - cd $TRAVIS_BUILD_DIR/build + cd /tmp + tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms + sha256sum $TAR_NAME >"$TAR_NAME.sha256" - mv "/tmp/$TAR_NAME" "/tmp/$TAR_NAME.sha256" . - artifacts upload --target-paths "/" $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 + echo "Uploading to S3" + mkdir -p $TRAVIS_BUILD_DIR/build + cd $TRAVIS_BUILD_DIR/build - # 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" - cp "$TRAVIS_BUILD_DIR/VERSION" release_version - artifacts upload --target-paths "/" release_version - else - echo "Uploading ${TRAVIS_BRANCH}_version file" - cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version - artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version - fi + mv "/tmp/$TAR_NAME" "/tmp/$TAR_NAME.sha256" . + artifacts upload --target-paths "/" $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 - 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 + # 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" + cp "$TRAVIS_BUILD_DIR/VERSION" release_version + artifacts upload --target-paths "/" release_version + else + echo "Uploading ${TRAVIS_BRANCH}_version file" + cp $TRAVIS_BUILD_DIR/VERSION ${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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8460bfb7 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 83e23777..dce22ee5 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ clean: @php artisan view:clear @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/views/ -mindepth 1 -not -name '.gitignore' -print0 | xargs -0 rm -rf diff --git a/app/Bootstrap/LoadConfiguration.php b/app/Bootstrap/LoadConfiguration.php index 76782c77..9f76daab 100644 --- a/app/Bootstrap/LoadConfiguration.php +++ b/app/Bootstrap/LoadConfiguration.php @@ -5,13 +5,11 @@ namespace App\Bootstrap; use Illuminate\Contracts\Config\Repository as RepositoryContract; use Illuminate\Contracts\Foundation\Application; -/** - * Class 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\Config\Repository $repository diff --git a/app/Console/Commands/CreateConfigs.php b/app/Console/Commands/CreateConfigs.php new file mode 100644 index 00000000..3d3a1813 --- /dev/null +++ b/app/Console/Commands/CreateConfigs.php @@ -0,0 +1,95 @@ +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!'); + } +} diff --git a/app/Console/Commands/CreateDatabase.php b/app/Console/Commands/CreateDatabase.php index 03402c82..aa99a9cc 100644 --- a/app/Console/Commands/CreateDatabase.php +++ b/app/Console/Commands/CreateDatabase.php @@ -2,13 +2,14 @@ namespace App\Console\Commands; +use App\Console\Services\Database; use App\Contracts\Command; use Illuminate\Support\Facades\Log; use Tivie\OS\Detector; class CreateDatabase extends Command { - protected $signature = 'database:create {--reset} {--conn=?}'; + protected $signature = 'database:create {--reset} {--migrate} {--conn=?}'; protected $description = 'Create a database'; protected $os; @@ -36,8 +37,7 @@ class CreateDatabase extends Command $user = config($dbkey.'username'); $pass = config($dbkey.'password'); - $dbSvc = new \App\Console\Services\Database(); - + $dbSvc = new Database(); $dsn = $dbSvc->createDsn($host, $port); Log::info('Connection string: '.$dsn); diff --git a/app/Console/Commands/PirepExport.php b/app/Console/Commands/PirepExport.php new file mode 100644 index 00000000..637079b5 --- /dev/null +++ b/app/Console/Commands/PirepExport.php @@ -0,0 +1,52 @@ +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; + } +} diff --git a/app/Console/Commands/Version.php b/app/Console/Commands/Version.php index 623c5426..e4b4a3b6 100644 --- a/app/Console/Commands/Version.php +++ b/app/Console/Commands/Version.php @@ -8,7 +8,7 @@ use Symfony\Component\Yaml\Yaml; class Version extends Command { - protected $signature = 'phpvms:version {--write} {--base-only}'; + protected $signature = 'phpvms:version {--write} {--base-only} {--write-full-version} {version?}'; private $versionSvc; @@ -26,11 +26,33 @@ class Version extends Command */ public function handle() { - // Write the updated build number out to the file if ($this->option('write')) { + // Write the updated build number out to the file $version_file = config_path('version.yml'); $cfg = Yaml::parse(file_get_contents($version_file)); + + // If a version is being passed in, the update the build, etc data against this + 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->getBuildId($cfg); + $cfg['current']['commit'] = $build_number; $cfg['build']['number'] = $build_number; file_put_contents($version_file, Yaml::dump($cfg, 4, 2)); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index ddd6eb6d..cbf1ab25 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -42,7 +42,6 @@ class Kernel extends ConsoleKernel */ protected function commands(): void { - require app_path('Http/Routes/console.php'); $this->load(__DIR__.'/Commands'); $this->load(__DIR__.'/Cron'); } diff --git a/app/Console/Services/Importer.php b/app/Console/Services/Importer.php deleted file mode 100644 index 1d727bc2..00000000 --- a/app/Console/Services/Importer.php +++ /dev/null @@ -1,704 +0,0 @@ -log = new ConsoleOutput(); - - // The db credentials - $this->creds = array_merge([ - 'host' => '127.0.0.1', - 'port' => 3306, - 'name' => '', - 'user' => '', - 'pass' => '', - 'table_prefix' => '', - ], $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(''.$message.''); - } - - /** - * @param $message - */ - protected function error($message) - { - $this->log->writeln(''.$message.''); - } - - /** - * @param string|array $message - */ - protected function info($message) - { - if (\is_array($message)) { - /* @noinspection ForgottenDebugOutputInspection */ - print_r($message); - } else { - $this->log->writeln(''.$message.''); - } - } - - /** - * 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; - } - - if ($state === $phpvms_classic_states['INACTIVE']) { - // TODO: Make an inactive state? - return UserState::REJECTED; - } - - if ($state === $phpvms_classic_states['BANNED']) { - return UserState::SUSPENDED; - } - - if ($state === $phpvms_classic_states['ON_LEAVE']) { - return UserState::ON_LEAVE; - } - - $this->error('Unknown status: '.$state); - return UserState::ACTIVE; - } -} diff --git a/app/Contracts/Award.php b/app/Contracts/Award.php index d30732c8..36c382e2 100644 --- a/app/Contracts/Award.php +++ b/app/Contracts/Award.php @@ -6,7 +6,8 @@ use App\Facades\Utils; use App\Models\Award as AwardModel; use App\Models\User; use App\Models\UserAward; -use Log; +use Exception; +use Illuminate\Support\Facades\Log; /** * Base class for the Awards, you need to extend this, and implement: @@ -38,12 +39,6 @@ abstract class Award protected $award; protected $user; - /** - * AwardInterface constructor. - * - * @param AwardModel $award - * @param User $user - */ public function __construct(AwardModel $award = null, User $user = null) { $this->award = $award; @@ -73,7 +68,7 @@ abstract class Award * * @return bool|UserAward */ - final protected function addAward() + protected function addAward() { $w = [ 'user_id' => $this->user->id, @@ -90,7 +85,7 @@ abstract class Award try { $award->save(); - } catch (\Exception $e) { + } catch (Exception $e) { Log::error( 'Error saving award: '.$e->getMessage(), $e->getTrace() diff --git a/app/Contracts/Controller.php b/app/Contracts/Controller.php index 2acc5a69..a11dc93a 100755 --- a/app/Contracts/Controller.php +++ b/app/Contracts/Controller.php @@ -12,7 +12,9 @@ use Illuminate\Http\Request; */ 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 diff --git a/app/Contracts/Listener.php b/app/Contracts/Listener.php index 7ce6f8a6..9245d044 100644 --- a/app/Contracts/Listener.php +++ b/app/Contracts/Listener.php @@ -2,9 +2,21 @@ namespace App\Contracts; -/** - * Class Listener - */ +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); + } + } } diff --git a/app/Contracts/Middleware.php b/app/Contracts/Middleware.php new file mode 100644 index 00000000..3fc76130 --- /dev/null +++ b/app/Contracts/Middleware.php @@ -0,0 +1,11 @@ +units); + return $this->offsetGet($offset) !== null; } /** @@ -87,7 +86,16 @@ class Unit implements ArrayAccess */ public function offsetGet($offset) { - return round($this->instance->toUnit($offset), 2); + try { + $value = $this->instance->toUnit($offset); + if (!$value) { + return; + } + } catch (UnknownUnitOfMeasure $e) { + return; + } + + return round($value, 2); } /** @@ -116,6 +124,6 @@ class Unit implements ArrayAccess */ public function __toString() { - return (string) $this->units[$this->unit]; + return (string) $this->offsetGet($this->unit); } } diff --git a/app/Cron/Hourly/RemoveExpiredLiveFlights.php b/app/Cron/Hourly/RemoveExpiredLiveFlights.php index 859fa47d..22df9398 100644 --- a/app/Cron/Hourly/RemoveExpiredLiveFlights.php +++ b/app/Cron/Hourly/RemoveExpiredLiveFlights.php @@ -4,6 +4,7 @@ namespace App\Cron\Hourly; use App\Contracts\Listener; use App\Events\CronHourly; +use App\Models\Enums\PirepState; use App\Models\Pirep; use Carbon\Carbon; @@ -13,7 +14,7 @@ use Carbon\Carbon; 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 * @@ -26,7 +27,7 @@ class RemoveExpiredLiveFlights extends Listener } $date = Carbon::now()->subHours(setting('acars.live_time')); - Pirep::whereDate('created_at', '<', $date) + Pirep::whereDate('updated_at', '<', $date) ->where('state', PirepState::IN_PROGRESS) ->delete(); } diff --git a/app/Database/factories/AirportFactory.php b/app/Database/factories/AirportFactory.php index 90d2baf0..f015a1b7 100644 --- a/app/Database/factories/AirportFactory.php +++ b/app/Database/factories/AirportFactory.php @@ -8,7 +8,7 @@ use Faker\Generator as Faker; if (!function_exists('createFactoryICAO')) { function createFactoryICAO(): string { - $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $max = strlen($characters) - 1; $string = ''; 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 */ $factory->define(App\Models\Airport::class, function (Faker $faker) { - $used = []; - return [ - 'id' => function () use ($used) { - do { - $string = createFactoryICAO(); - } while (in_array($string, $used, true)); + $usedIcaos = []; - return $string; + return [ + 'id' => function () use ($usedIcaos) { + do { + $airport = createFactoryICAO(); + } while (in_array($airport, $usedIcaos, true)); + + return $airport; }, 'icao' => function (array $apt) { return $apt['id']; diff --git a/app/Database/migrations/2019_07_16_141152_users_add_pilot_id.php b/app/Database/migrations/2019_07_16_141152_users_add_pilot_id.php index 29ad73a4..caad035c 100644 --- a/app/Database/migrations/2019_07_16_141152_users_add_pilot_id.php +++ b/app/Database/migrations/2019_07_16_141152_users_add_pilot_id.php @@ -28,28 +28,6 @@ class UsersAddPilotId extends Migration // Migrate the current pilot IDs DB::update('UPDATE `users` SET `pilot_id`=`id`'); - - // Drop the old ID column and add a new one - /*Schema::table('users', function (Blueprint $table) { - $table->dropPrimary('users_id_primary'); - $table->dropColumn('id'); - $table->string('id', Model::ID_MAX_LENGTH)->primary(); - }); - - // Update the users to use the `pilot_id` (so we don't need to migrate data from other tables) - $users = DB::table('users')->get(['id']); - foreach ($users as $user) { - $user->id = $user->pilot_id; - $user->save(); - }*/ - - // role_user - // permission_user - // sessions - // pireps - // bids - // news - // user_awards } /** diff --git a/app/Database/seeds/dev/sample.yml b/app/Database/seeds/dev/sample.yml index 2edc9e58..4af24ff5 100644 --- a/app/Database/seeds/dev/sample.yml +++ b/app/Database/seeds/dev/sample.yml @@ -20,7 +20,7 @@ awards: name: Pilot 50 flights description: When a pilot has 50 flights, give this award image_url: - ref_model: App\Awards\PilotFlightAwards + ref_model: Modules\Awards\Awards\PilotFlightAwards ref_model_params: 50 created_at: now updated_at: now @@ -307,10 +307,10 @@ flights: dpt_airport_id: MKJP arr_airport_id: MWCR flight_time: 70 - flight_type: J - dpt_time: 0800 - arr_time: 0900 - route: MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3 + flight_type: 'J' + dpt_time: '0800' + arr_time: '0900' + route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3' created_at: NOW updated_at: NOW diff --git a/app/Database/seeds/dev/users.yml b/app/Database/seeds/dev/users.yml index 36f5ae46..1500528b 100644 --- a/app/Database/seeds/dev/users.yml +++ b/app/Database/seeds/dev/users.yml @@ -21,10 +21,10 @@ users: updated_at: now - id: 2 pilot_id: 2 - name: Carla Walters - email: carla.walters68@example.com - password: admin - api_key: testuserapikey1 + name: Test User + email: user@phpvms.net + password: user + api_key: testuserapikey airline_id: 1 rank_id: 1 home_airport_id: KJFK @@ -34,7 +34,7 @@ users: transfer_time: 360 created_at: now updated_at: now - state: 0 + state: 1 opt_in: 1 toc_accepted: 1 - id: 3 diff --git a/app/Database/seeds/permissions.yml b/app/Database/seeds/permissions.yml index a1fd89f6..26561458 100644 --- a/app/Database/seeds/permissions.yml +++ b/app/Database/seeds/permissions.yml @@ -1,7 +1,7 @@ # All of the different permissions that can be assigned to roles --- - name: admin-access - display_name: Admin Access + display_name: Admin Panel description: Access the admin panel - name: airlines display_name: Airlines @@ -24,6 +24,9 @@ - name: fares display_name: Fares description: Create/edit fares +- name: files + display_name: Files + description: Manage the files available - name: finances display_name: Finances description: Create/view finance related items diff --git a/app/Database/seeds/settings.yml b/app/Database/seeds/settings.yml index 9b58b44f..9ba00020 100644 --- a/app/Database/seeds/settings.yml +++ b/app/Database/seeds/settings.yml @@ -222,3 +222,17 @@ options: '' type: boolean description: 'Count transfer hours in calculations, like ranks and the total hours' +- key: notifications.discord_api_key + name: Discord API token + group: notifications + value: '' + options: '' + type: text + description: Discord API token for notifications +- key: 'notifications.discord_public_channel_id' + name: 'Discord Public Channel ID' + group: 'notifications' + value: '' + options: '' + type: 'text' + description: 'Discord public channel ID for broadcasat notifications' diff --git a/app/Events/BaseEvent.php b/app/Events/BaseEvent.php new file mode 100644 index 00000000..71bcddc2 --- /dev/null +++ b/app/Events/BaseEvent.php @@ -0,0 +1,14 @@ +news = $news; + } +} diff --git a/app/Events/PirepAccepted.php b/app/Events/PirepAccepted.php index 988a377f..7619d721 100644 --- a/app/Events/PirepAccepted.php +++ b/app/Events/PirepAccepted.php @@ -3,24 +3,11 @@ namespace App\Events; use App\Models\Pirep; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class PirepAccepted - */ -class PirepAccepted +class PirepAccepted extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $pirep; - /** - * PirepAccepted constructor. - * - * @param Pirep $pirep - */ public function __construct(Pirep $pirep) { $this->pirep = $pirep; diff --git a/app/Events/PirepFiled.php b/app/Events/PirepFiled.php index 560b0ca6..b9f6a3e6 100644 --- a/app/Events/PirepFiled.php +++ b/app/Events/PirepFiled.php @@ -3,13 +3,9 @@ namespace App\Events; use App\Models\Pirep; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -class PirepFiled +class PirepFiled extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; public $pirep; public function __construct(Pirep $pirep) diff --git a/app/Events/PirepRejected.php b/app/Events/PirepRejected.php index 66e421ce..1d78e1eb 100644 --- a/app/Events/PirepRejected.php +++ b/app/Events/PirepRejected.php @@ -3,24 +3,11 @@ namespace App\Events; use App\Models\Pirep; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class PirepRejected - */ -class PirepRejected +class PirepRejected extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $pirep; - /** - * PirepRejected constructor. - * - * @param Pirep $pirep - */ public function __construct(Pirep $pirep) { $this->pirep = $pirep; diff --git a/app/Events/TestEvent.php b/app/Events/TestEvent.php index f5781047..27cb623e 100644 --- a/app/Events/TestEvent.php +++ b/app/Events/TestEvent.php @@ -3,24 +3,11 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class TestEvent - */ -class TestEvent +class TestEvent extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $user; - /** - * Create a new event instance. - * - * @param User $user - */ public function __construct(User $user) { $this->user = $user; diff --git a/app/Events/UserAccepted.php b/app/Events/UserAccepted.php index 21de3f70..738188d8 100644 --- a/app/Events/UserAccepted.php +++ b/app/Events/UserAccepted.php @@ -3,24 +3,11 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class UserAccepted - */ -class UserAccepted +class UserAccepted extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $user; - /** - * UserAccepted constructor. - * - * @param User $user - */ public function __construct(User $user) { $this->user = $user; diff --git a/app/Events/UserRegistered.php b/app/Events/UserRegistered.php index f2c501b2..7bf622f7 100644 --- a/app/Events/UserRegistered.php +++ b/app/Events/UserRegistered.php @@ -3,24 +3,11 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class UserRegistered - */ -class UserRegistered +class UserRegistered extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $user; - /** - * UserRegistered constructor. - * - * @param User $user - */ public function __construct(User $user) { $this->user = $user; diff --git a/app/Events/UserStateChanged.php b/app/Events/UserStateChanged.php index 4d686dc1..34291ae2 100644 --- a/app/Events/UserStateChanged.php +++ b/app/Events/UserStateChanged.php @@ -3,26 +3,15 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; /** * Event triggered when a user's state changes */ -class UserStateChanged +class UserStateChanged extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $old_state; public $user; - /** - * UserStateChanged constructor. - * - * @param User $user - * @param $old_state - */ public function __construct(User $user, $old_state) { $this->old_state = $old_state; diff --git a/app/Events/UserStatsChanged.php b/app/Events/UserStatsChanged.php index 075a9156..211efcd5 100644 --- a/app/Events/UserStatsChanged.php +++ b/app/Events/UserStatsChanged.php @@ -3,26 +3,18 @@ namespace App\Events; use App\Models\User; -use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Foundation\Events\Dispatchable; -use Illuminate\Queue\SerializesModels; -/** - * Class UserStatsChanged - */ -class UserStatsChanged +class UserStatsChanged extends BaseEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - public $stat_name; public $old_value; public $user; /* * When a user's stats change. Stats changed match the field name: - * airport - * flights - * rank + * airport + * flights + * rank */ public function __construct(User $user, $stat_name, $old_value) { diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index cfff05e4..ced89cc0 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -30,8 +30,8 @@ class Handler extends ExceptionHandler * A list of the exception types that should not be reported. */ protected $dontReport = [ - AuthenticationException::class, - AuthorizationException::class, + //AuthenticationException::class, + //AuthorizationException::class, AbstractHttpException::class, IlluminateValidationException::class, ModelNotFoundException::class, @@ -50,36 +50,7 @@ class Handler extends ExceptionHandler public function render($request, Exception $exception) { if ($request->is('api/*')) { - Log::error('API Error', $exception->getTrace()); - - if ($exception instanceof AbstractHttpException) { - return $exception->getResponse(); - } - - /* - * Not of the HttpException abstract class. Map these into - */ - - if ($exception instanceof ModelNotFoundException || - $exception instanceof NotFoundHttpException) { - $error = new AssetNotFound($exception); - return $error->getResponse(); - } - - // Custom exceptions should be extending HttpException - if ($exception instanceof SymfonyHttpException) { - $error = new SymfonyException($exception); - return $error->getResponse(); - } - - // Create the detailed errors from the validation errors - if ($exception instanceof IlluminateValidationException) { - $error = new ValidationException($exception); - return $error->getResponse(); - } - - $error = new GenericExceptionAbstract($exception); - return $error->getResponse(); + return $this->handleApiError($request, $exception); } if ($exception instanceof AbstractHttpException @@ -90,6 +61,51 @@ class Handler extends ExceptionHandler return parent::render($request, $exception); } + /** + * Handle errors in the API + * + * @param $request + * @param \Exception $exception + * + * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response + */ + private function handleApiError($request, Exception $exception) + { + Log::error('API Error', $exception->getTrace()); + + if ($exception instanceof AbstractHttpException) { + return $exception->getResponse(); + } + + /* + * Not of the HttpException abstract class. Map these into + */ + + if ($exception instanceof ModelNotFoundException || $exception instanceof NotFoundHttpException) { + $error = new AssetNotFound($exception); + + return $error->getResponse(); + } + + // Custom exceptions should be extending HttpException + if ($exception instanceof SymfonyHttpException) { + $error = new SymfonyException($exception); + + return $error->getResponse(); + } + + // Create the detailed errors from the validation errors + if ($exception instanceof IlluminateValidationException) { + $error = new ValidationException($exception); + + return $error->getResponse(); + } + + $error = new GenericExceptionAbstract($exception); + + return $error->getResponse(); + } + /** * Convert an authentication exception into an unauthenticated response. * diff --git a/app/Facades/Utils.php b/app/Facades/Utils.php index c077c819..8a9973e0 100644 --- a/app/Facades/Utils.php +++ b/app/Facades/Utils.php @@ -5,9 +5,6 @@ namespace App\Facades; use GuzzleHttp\Client; use Illuminate\Support\Facades\Facade; -/** - * Class Utils - */ class Utils extends Facade { /** diff --git a/app/Http/Controllers/Admin/AircraftController.php b/app/Http/Controllers/Admin/AircraftController.php index 12e08494..db7660ae 100644 --- a/app/Http/Controllers/Admin/AircraftController.php +++ b/app/Http/Controllers/Admin/AircraftController.php @@ -14,10 +14,10 @@ use App\Repositories\AircraftRepository; use App\Repositories\AirportRepository; use App\Services\ExportService; use App\Services\ImportService; -use Flash; use Illuminate\Http\Request; -use Log; -use Storage; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; +use Laracasts\Flash\Flash; /** * Class AircraftController diff --git a/app/Http/Controllers/Admin/AirportController.php b/app/Http/Controllers/Admin/AirportController.php index 3129e5c6..4d5c0d21 100644 --- a/app/Http/Controllers/Admin/AirportController.php +++ b/app/Http/Controllers/Admin/AirportController.php @@ -13,15 +13,11 @@ use App\Repositories\Criteria\WhereCriteria; use App\Services\ExportService; use App\Services\ImportService; use App\Support\Timezonelist; -use Flash; use Illuminate\Http\Request; -use Log; -use Response; -use Storage; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; +use Laracasts\Flash\Flash; -/** - * Class AirportController - */ class AirportController extends Controller { private $airportRepo; @@ -46,7 +42,7 @@ class AirportController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -68,7 +64,7 @@ class AirportController extends Controller /** * Show the form for creating a new Airport. * - * @return Response + * @return mixed */ public function create() { @@ -84,7 +80,7 @@ class AirportController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreateAirportRequest $request) { @@ -102,7 +98,7 @@ class AirportController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -123,7 +119,7 @@ class AirportController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -148,7 +144,7 @@ class AirportController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateAirportRequest $request) { @@ -173,7 +169,7 @@ class AirportController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/AwardController.php b/app/Http/Controllers/Admin/AwardController.php index 235bcc5f..aa7357c6 100755 --- a/app/Http/Controllers/Admin/AwardController.php +++ b/app/Http/Controllers/Admin/AwardController.php @@ -7,10 +7,9 @@ use App\Http\Requests\CreateAwardRequest; use App\Http\Requests\UpdateAwardRequest; use App\Repositories\AwardRepository; use App\Services\AwardService; -use Flash; use Illuminate\Http\Request; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; class AwardController extends Controller { @@ -62,7 +61,7 @@ class AwardController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -76,8 +75,6 @@ class AwardController extends Controller /** * Show the form for creating a new Fare. - * - * @return Response */ public function create() { @@ -96,7 +93,7 @@ class AwardController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreateAwardRequest $request) { @@ -112,7 +109,7 @@ class AwardController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -133,7 +130,7 @@ class AwardController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -161,7 +158,7 @@ class AwardController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateAwardRequest $request) { @@ -183,7 +180,7 @@ class AwardController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/DashboardController.php b/app/Http/Controllers/Admin/DashboardController.php index 9d5a0fb7..510e443b 100644 --- a/app/Http/Controllers/Admin/DashboardController.php +++ b/app/Http/Controllers/Admin/DashboardController.php @@ -7,6 +7,8 @@ use App\Repositories\KvpRepository; use App\Repositories\NewsRepository; use App\Repositories\PirepRepository; use App\Repositories\UserRepository; +use App\Services\CronService; +use App\Services\NewsService; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Log; @@ -14,27 +16,35 @@ use Laracasts\Flash\Flash; class DashboardController extends Controller { + private $cronSvc; private $kvpRepo; private $newsRepo; + private $newsSvc; private $pirepRepo; private $userRepo; /** * DashboardController constructor. * + * @param CronService $cronSvc * @param KvpRepository $kvpRepo * @param NewsRepository $newsRepo + * @param NewsService $newsSvc * @param PirepRepository $pirepRepo * @param UserRepository $userRepo */ public function __construct( + CronService $cronSvc, KvpRepository $kvpRepo, NewsRepository $newsRepo, + NewsService $newsSvc, PirepRepository $pirepRepo, UserRepository $userRepo ) { + $this->cronSvc = $cronSvc; $this->kvpRepo = $kvpRepo; $this->newsRepo = $newsRepo; + $this->newsSvc = $newsSvc; $this->pirepRepo = $pirepRepo; $this->userRepo = $userRepo; } @@ -74,9 +84,10 @@ class DashboardController extends Controller $this->checkNewVersion(); return view('admin.dashboard.index', [ - 'news' => $this->newsRepo->getLatest(), - 'pending_pireps' => $this->pirepRepo->getPendingCount(), - 'pending_users' => $this->userRepo->getPendingCount(), + 'news' => $this->newsRepo->getLatest(), + 'pending_pireps' => $this->pirepRepo->getPendingCount(), + 'pending_users' => $this->userRepo->getPendingCount(), + 'cron_problem_exists' => $this->cronSvc->cronProblemExists(), ]); } @@ -93,10 +104,10 @@ class DashboardController extends Controller $attrs = $request->post(); $attrs['user_id'] = Auth::user()->id; - $this->newsRepo->create($attrs); + $this->newsSvc->addNews($attrs); } elseif ($request->isMethod('delete')) { - $news_id = $request->input('news_id'); - $this->newsRepo->delete($news_id); + $id = $request->input('news_id'); + $this->newsSvc->deleteNews($id); } return view('admin.dashboard.news', [ diff --git a/app/Http/Controllers/Admin/ExpenseController.php b/app/Http/Controllers/Admin/ExpenseController.php index 7f586e92..184c5ca9 100644 --- a/app/Http/Controllers/Admin/ExpenseController.php +++ b/app/Http/Controllers/Admin/ExpenseController.php @@ -10,16 +10,12 @@ use App\Repositories\AirlineRepository; use App\Repositories\ExpenseRepository; use App\Services\ExportService; use App\Services\ImportService; -use Flash; use Illuminate\Http\Request; -use Log; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -use Storage; -/** - * Class ExpenseController - */ class ExpenseController extends Controller { private $airlineRepo; @@ -122,7 +118,7 @@ class ExpenseController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -149,7 +145,7 @@ class ExpenseController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, Request $request) { @@ -173,7 +169,7 @@ class ExpenseController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/FareController.php b/app/Http/Controllers/Admin/FareController.php index f8892221..23216f0c 100644 --- a/app/Http/Controllers/Admin/FareController.php +++ b/app/Http/Controllers/Admin/FareController.php @@ -9,16 +9,12 @@ use App\Http\Requests\UpdateFareRequest; use App\Repositories\FareRepository; use App\Services\ExportService; use App\Services\ImportService; -use Flash; use Illuminate\Http\Request; -use Log; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -use Storage; -/** - * Class FareController - */ class FareController extends Controller { private $fareRepo; @@ -45,7 +41,7 @@ class FareController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -58,8 +54,6 @@ class FareController extends Controller /** * Show the form for creating a new Fare. - * - * @return Response */ public function create() { @@ -73,7 +67,7 @@ class FareController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreateFareRequest $request) { @@ -89,7 +83,7 @@ class FareController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -107,7 +101,7 @@ class FareController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -128,7 +122,7 @@ class FareController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateFareRequest $request) { @@ -149,7 +143,7 @@ class FareController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/FileController.php b/app/Http/Controllers/Admin/FileController.php index a91d216a..ad767a1e 100644 --- a/app/Http/Controllers/Admin/FileController.php +++ b/app/Http/Controllers/Admin/FileController.php @@ -8,12 +8,8 @@ use App\Services\FileService; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Validator; -use Illuminate\Validation\Rule; use Laracasts\Flash\Flash; -/** - * Class FileController - */ class FileController extends Controller { private $fileSvc; diff --git a/app/Http/Controllers/Admin/FinanceController.php b/app/Http/Controllers/Admin/FinanceController.php index dddca324..04c5798b 100644 --- a/app/Http/Controllers/Admin/FinanceController.php +++ b/app/Http/Controllers/Admin/FinanceController.php @@ -10,9 +10,6 @@ use App\Services\FinanceService; use App\Support\Dates; use Illuminate\Http\Request; -/** - * Class FinanceController - */ class FinanceController extends Controller { private $airlineRepo; @@ -43,25 +40,14 @@ class FinanceController extends Controller public function index(Request $request) { $month = $request->query('month', date('Y-m')); - $between = Dates::getMonthBoundary($month); + $transaction_groups = $this->financeSvc->getAllAirlineTransactionsBetween($month); - $first_journal = Journal::where(['type' => JournalType::AIRLINE]) + $first_journal = Journal::select(['created_at']) + ->where(['type' => JournalType::AIRLINE]) ->orderBy('created_at', 'asc') ->limit(1) ->first(); - $transaction_groups = []; - $airlines = $this->airlineRepo->orderBy('icao')->all(); - - // group by the airline - foreach ($airlines as $airline) { - $transaction_groups[] = $this->financeSvc->getAirlineTransactionsBetween( - $airline, - $between[0], - $between[1] - ); - } - return view('admin.finances.index', [ 'current_month' => $month, 'months_list' => Dates::getMonthsList($first_journal->created_at), diff --git a/app/Http/Controllers/Admin/FlightController.php b/app/Http/Controllers/Admin/FlightController.php index 28a5eb72..0cef3c46 100644 --- a/app/Http/Controllers/Admin/FlightController.php +++ b/app/Http/Controllers/Admin/FlightController.php @@ -23,6 +23,7 @@ use App\Services\ImportService; use App\Support\Units\Time; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; use Laracasts\Flash\Flash; /** diff --git a/app/Http/Controllers/Admin/FlightFieldController.php b/app/Http/Controllers/Admin/FlightFieldController.php index b2d99488..1dbba942 100644 --- a/app/Http/Controllers/Admin/FlightFieldController.php +++ b/app/Http/Controllers/Admin/FlightFieldController.php @@ -4,14 +4,10 @@ namespace App\Http\Controllers\Admin; use App\Contracts\Controller; use App\Repositories\FlightFieldRepository; -use Flash; use Illuminate\Http\Request; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -/** - * Class FlightFieldController - */ class FlightFieldController extends Controller { private $flightFieldRepo; @@ -34,7 +30,7 @@ class FlightFieldController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -48,8 +44,6 @@ class FlightFieldController extends Controller /** * Show the form for creating a new FlightField. - * - * @return Response */ public function create() { @@ -63,7 +57,7 @@ class FlightFieldController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(Request $request) { @@ -81,7 +75,7 @@ class FlightFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -102,7 +96,7 @@ class FlightFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -126,7 +120,7 @@ class FlightFieldController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + * @return mixed */ public function update($id, Request $request) { @@ -150,7 +144,7 @@ class FlightFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/MaintenanceController.php b/app/Http/Controllers/Admin/MaintenanceController.php index 033500b4..92264e2d 100644 --- a/app/Http/Controllers/Admin/MaintenanceController.php +++ b/app/Http/Controllers/Admin/MaintenanceController.php @@ -19,15 +19,8 @@ class MaintenanceController extends Controller public function index() { - // Generate the cron path. Replace php-fpm with just php - $cron_path = [ - '* * * * *', - $this->cronSvc->getCronPath(), - '>> /dev/null 2>&1', - ]; - return view('admin.maintenance.index', [ - 'cron_path' => implode(' ', $cron_path), + 'cron_path' => $this->cronSvc->getCronExecString(), 'cron_problem_exists' => $this->cronSvc->cronProblemExists(), ]); } @@ -49,6 +42,7 @@ class MaintenanceController extends Controller $calls[] = 'config:cache'; $calls[] = 'cache:clear'; $calls[] = 'route:cache'; + $calls[] = 'clear-compiled'; } // If we want to clear only the views but keep everything else diff --git a/app/Http/Controllers/Admin/PirepController.php b/app/Http/Controllers/Admin/PirepController.php index 1549a96c..ac12a15a 100644 --- a/app/Http/Controllers/Admin/PirepController.php +++ b/app/Http/Controllers/Admin/PirepController.php @@ -21,16 +21,12 @@ use App\Services\FareService; use App\Services\PirepService; use App\Services\UserService; use App\Support\Units\Time; -use Flash; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -use Log; +use Illuminate\Support\Facades\Log; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -/** - * Class PirepController - */ class PirepController extends Controller { private $airportRepo; @@ -170,7 +166,7 @@ class PirepController extends Controller * * @param Request $request * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function fares(Request $request) { @@ -192,7 +188,7 @@ class PirepController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function index(Request $request) { @@ -218,7 +214,7 @@ class PirepController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function pending(Request $request) { @@ -238,7 +234,7 @@ class PirepController extends Controller /** * Show the form for creating a new Pirep. * - * @return Response + * @return mixed */ public function create() { @@ -279,7 +275,7 @@ class PirepController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -302,7 +298,7 @@ class PirepController extends Controller * * @throws \InvalidArgumentException * - * @return Response + * @return mixed */ public function edit($id) { @@ -388,7 +384,7 @@ class PirepController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/PirepFieldController.php b/app/Http/Controllers/Admin/PirepFieldController.php index aedc5469..b70a234f 100644 --- a/app/Http/Controllers/Admin/PirepFieldController.php +++ b/app/Http/Controllers/Admin/PirepFieldController.php @@ -6,14 +6,10 @@ use App\Contracts\Controller; use App\Http\Requests\CreatePirepFieldRequest; use App\Http\Requests\UpdatePirepFieldRequest; use App\Repositories\PirepFieldRepository; -use Flash; use Illuminate\Http\Request; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -/** - * Class PirepFieldController - */ class PirepFieldController extends Controller { private $pirepFieldRepo; @@ -36,7 +32,7 @@ class PirepFieldController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -51,7 +47,7 @@ class PirepFieldController extends Controller /** * Show the form for creating a new PirepField. * - * @return Response + * @return mixed */ public function create() { @@ -65,7 +61,7 @@ class PirepFieldController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreatePirepFieldRequest $request) { @@ -85,7 +81,7 @@ class PirepFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -107,7 +103,7 @@ class PirepFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -158,7 +154,7 @@ class PirepFieldController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/RankController.php b/app/Http/Controllers/Admin/RankController.php index d2529331..6f04e3c3 100644 --- a/app/Http/Controllers/Admin/RankController.php +++ b/app/Http/Controllers/Admin/RankController.php @@ -9,14 +9,10 @@ use App\Repositories\RankRepository; use App\Repositories\SubfleetRepository; use App\Services\FleetService; use Cache; -use Flash; use Illuminate\Http\Request; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -/** - * Class RankController - */ class RankController extends Controller { private $fleetSvc; @@ -67,7 +63,7 @@ class RankController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return mixed */ public function index(Request $request) { @@ -82,7 +78,7 @@ class RankController extends Controller /** * Show the form for creating a new Ranking. * - * @return Response + * @return mixed */ public function create() { @@ -96,7 +92,7 @@ class RankController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreateRankRequest $request) { @@ -115,7 +111,7 @@ class RankController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -137,7 +133,7 @@ class RankController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -165,7 +161,7 @@ class RankController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateRankRequest $request) { @@ -190,7 +186,7 @@ class RankController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Admin/RolesController.php b/app/Http/Controllers/Admin/RolesController.php index 00362ba0..b1c0f144 100644 --- a/app/Http/Controllers/Admin/RolesController.php +++ b/app/Http/Controllers/Admin/RolesController.php @@ -7,29 +7,33 @@ use App\Http\Requests\CreateRoleRequest; use App\Http\Requests\UpdateRoleRequest; use App\Repositories\PermissionsRepository; use App\Repositories\RoleRepository; -use Flash; +use App\Services\RoleService; use Illuminate\Http\Request; +use Illuminate\Http\Response; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -/** - * Class AirlinesController - */ class RolesController extends Controller { private $permsRepo; private $rolesRepo; + private $roleSvc; /** * AirlinesController constructor. * * @param PermissionsRepository $permsRepo * @param RoleRepository $rolesRepo + * @param $roleSvc */ - public function __construct(PermissionsRepository $permsRepo, RoleRepository $rolesRepo) - { + public function __construct( + PermissionsRepository $permsRepo, + RoleRepository $rolesRepo, + RoleService $roleSvc + ) { $this->permsRepo = $permsRepo; $this->rolesRepo = $rolesRepo; + $this->roleSvc = $roleSvc; } /** @@ -132,8 +136,6 @@ class RolesController extends Controller * @param int $id * @param UpdateRoleRequest $request * - * @throws \Prettus\Validator\Exceptions\ValidatorException - * * @return Response */ public function update($id, UpdateRoleRequest $request) @@ -145,14 +147,8 @@ class RolesController extends Controller return redirect(route('admin.roles.index')); } - $this->rolesRepo->update($request->all(), $id); - - // Update the permissions, filter out null/invalid values - $perms = collect($request->permissions)->filter(static function ($v, $k) { - return $v; - }); - - $role->permissions()->sync($perms); + $this->roleSvc->updateRole($role, $request->all()); + $this->roleSvc->setPermissionsForRole($role, $request->permissions); Flash::success('Roles updated successfully.'); return redirect(route('admin.roles.index')); diff --git a/app/Http/Controllers/Admin/SettingsController.php b/app/Http/Controllers/Admin/SettingsController.php index 11882b13..efd85b65 100644 --- a/app/Http/Controllers/Admin/SettingsController.php +++ b/app/Http/Controllers/Admin/SettingsController.php @@ -8,9 +8,6 @@ use Igaster\LaravelTheme\Facades\Theme; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; -/** - * Class SettingsController - */ class SettingsController extends Controller { /** diff --git a/app/Http/Controllers/Admin/SubfleetController.php b/app/Http/Controllers/Admin/SubfleetController.php index b36dfd11..8253980a 100644 --- a/app/Http/Controllers/Admin/SubfleetController.php +++ b/app/Http/Controllers/Admin/SubfleetController.php @@ -18,16 +18,12 @@ use App\Services\ExportService; use App\Services\FareService; use App\Services\FleetService; use App\Services\ImportService; -use Flash; use Illuminate\Http\Request; -use Log; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Storage; +use Laracasts\Flash\Flash; use Prettus\Repository\Criteria\RequestCriteria; -use Response; -use Storage; -/** - * Class SubfleetController - */ class SubfleetController extends Controller { private $aircraftRepo; @@ -115,7 +111,7 @@ class SubfleetController extends Controller * * @throws \Prettus\Repository\Exceptions\RepositoryException * - * @return Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index(Request $request) { @@ -129,8 +125,6 @@ class SubfleetController extends Controller /** * Show the form for creating a new Subfleet. - * - * @return Response */ public function create() { @@ -147,7 +141,7 @@ class SubfleetController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function store(CreateSubfleetRequest $request) { @@ -163,7 +157,7 @@ class SubfleetController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -186,7 +180,7 @@ class SubfleetController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -217,7 +211,7 @@ class SubfleetController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateSubfleetRequest $request) { @@ -239,7 +233,7 @@ class SubfleetController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { @@ -269,8 +263,6 @@ class SubfleetController extends Controller * * @param Request $request * - * @throws \League\Csv\CannotInsertRecord - * * @return \Symfony\Component\HttpFoundation\BinaryFileResponse */ public function export(Request $request) @@ -291,7 +283,7 @@ class SubfleetController extends Controller * * @throws \Illuminate\Validation\ValidationException * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function import(Request $request) { @@ -322,7 +314,7 @@ class SubfleetController extends Controller /** * @param Subfleet $subfleet * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ protected function return_ranks_view(?Subfleet $subfleet) { @@ -338,7 +330,7 @@ class SubfleetController extends Controller /** * @param Subfleet $subfleet * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ protected function return_fares_view(?Subfleet $subfleet) { @@ -357,7 +349,7 @@ class SubfleetController extends Controller * @param $id * @param Request $request * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function ranks($id, Request $request) { @@ -396,7 +388,7 @@ class SubfleetController extends Controller /** * @param Subfleet $subfleet * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ protected function return_expenses_view(?Subfleet $subfleet) { @@ -414,7 +406,7 @@ class SubfleetController extends Controller * * @throws \Exception * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function expenses($id, Request $request) { @@ -454,7 +446,7 @@ class SubfleetController extends Controller * @param $id * @param Request $request * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function fares($id, Request $request) { diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 148efbf9..0f669212 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -15,17 +15,13 @@ use App\Repositories\PirepRepository; use App\Repositories\UserRepository; use App\Services\UserService; use App\Support\Timezonelist; -use DB; -use Flash; -use Hash; use Illuminate\Http\Request; -use Log; +use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Hash; +use Illuminate\Support\Facades\Log; +use Laracasts\Flash\Flash; use Prettus\Repository\Exceptions\RepositoryException; -use Response; -/** - * Class UserController - */ class UserController extends Controller { private $airlineRepo; @@ -80,7 +76,7 @@ class UserController extends Controller /** * Show the form for creating a new User. * - * @return Response + * @return mixed */ public function create() { @@ -106,7 +102,7 @@ class UserController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function store(CreateUserRequest $request) { @@ -122,7 +118,7 @@ class UserController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function show($id) { @@ -158,7 +154,7 @@ class UserController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function edit($id) { @@ -202,7 +198,7 @@ class UserController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return Response + * @return mixed */ public function update($id, UpdateUserRequest $request) { @@ -247,9 +243,11 @@ class UserController extends Controller } // Delete all of the roles and then re-attach the valid ones - DB::table('role_user')->where('user_id', $id)->delete(); - foreach ($request->input('roles') as $key => $value) { - $user->attachRole($value); + if (!empty($request->input('roles'))) { + DB::table('role_user')->where('user_id', $id)->delete(); + foreach ($request->input('roles') as $key => $value) { + $user->attachRole($value); + } } Flash::success('User updated successfully.'); @@ -262,7 +260,7 @@ class UserController extends Controller * * @param int $id * - * @return Response + * @return mixed */ public function destroy($id) { diff --git a/app/Http/Controllers/Api/FlightController.php b/app/Http/Controllers/Api/FlightController.php index 12f21557..070d8176 100644 --- a/app/Http/Controllers/Api/FlightController.php +++ b/app/Http/Controllers/Api/FlightController.php @@ -13,9 +13,6 @@ use Illuminate\Support\Facades\Auth; use Prettus\Repository\Criteria\RequestCriteria; use Prettus\Repository\Exceptions\RepositoryException; -/** - * Class FlightController - */ class FlightController extends Controller { private $flightRepo; @@ -44,32 +41,7 @@ class FlightController extends Controller */ public function index(Request $request) { - /** - * @var $user \App\Models\User - */ - $user = Auth::user(); - - $where = [ - 'active' => true, - 'visible' => true, - ]; - - if (setting('pilots.restrict_to_company')) { - $where['airline_id'] = $user->airline_id; - } - if (setting('pilots.only_flights_from_current', false)) { - $where['dpt_airport_id'] = $user->curr_airport_id; - } - - $flights = $this->flightRepo - ->whereOrder($where, 'flight_number', 'asc') - ->paginate(); - - foreach ($flights as $flight) { - $this->flightSvc->filterSubfleets($user, $flight); - } - - return FlightResource::collection($flights); + return $this->search($request); } /** @@ -121,6 +93,7 @@ class FlightController extends Controller return response($e, 503); } + // TODO: Remove any flights here that a user doesn't have permissions to foreach ($flights as $flight) { $this->flightSvc->filterSubfleets(Auth::user(), $flight); } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 90d22a4d..ff52dfe7 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -17,9 +17,6 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Log; -/** - * Class RegisterController - */ class RegisterController extends Controller { use RegistersUsers; @@ -58,7 +55,7 @@ class RegisterController extends Controller /** * @throws \Exception * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + * @return mixed */ public function showRegistrationForm() { diff --git a/app/Http/Controllers/Frontend/FlightController.php b/app/Http/Controllers/Frontend/FlightController.php index 2533d7b6..4fe34a4c 100644 --- a/app/Http/Controllers/Frontend/FlightController.php +++ b/app/Http/Controllers/Frontend/FlightController.php @@ -8,50 +8,68 @@ use App\Repositories\AirlineRepository; use App\Repositories\AirportRepository; use App\Repositories\Criteria\WhereCriteria; use App\Repositories\FlightRepository; +use App\Repositories\SubfleetRepository; use App\Services\GeoService; use Flash; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -use Log; +use Illuminate\Support\Facades\Log; use Prettus\Repository\Criteria\RequestCriteria; use Prettus\Repository\Exceptions\RepositoryException; -/** - * Class FlightController - */ class FlightController extends Controller { private $airlineRepo; private $airportRepo; private $flightRepo; + private $subfleetRepo; private $geoSvc; /** * FlightController constructor. * - * @param AirlineRepository $airlineRepo - * @param AirportRepository $airportRepo - * @param FlightRepository $flightRepo - * @param GeoService $geoSvc + * @param AirlineRepository $airlineRepo + * @param AirportRepository $airportRepo + * @param FlightRepository $flightRepo + * @param GeoService $geoSvc + * @param SubfleetRepository $subfleetRepo */ public function __construct( AirlineRepository $airlineRepo, AirportRepository $airportRepo, FlightRepository $flightRepo, - GeoService $geoSvc + GeoService $geoSvc, + SubfleetRepository $subfleetRepo ) { $this->airlineRepo = $airlineRepo; $this->airportRepo = $airportRepo; $this->flightRepo = $flightRepo; $this->geoSvc = $geoSvc; + $this->subfleetRepo = $subfleetRepo; } /** * @param Request $request * + * @throws \Prettus\Repository\Exceptions\RepositoryException + * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index(Request $request) + { + return $this->search($request); + } + + /** + * Make a search request using the Repository search + * + * @param Request $request + * + * @throws \Prettus\Repository\Exceptions\RepositoryException + * + * @return mixed + */ + public function search(Request $request) { $where = [ 'active' => true, @@ -67,14 +85,17 @@ class FlightController extends Controller $where['dpt_airport_id'] = Auth::user()->curr_airport_id; } + $this->flightRepo->resetCriteria(); + try { + $this->flightRepo->searchCriteria($request); $this->flightRepo->pushCriteria(new WhereCriteria($request, $where)); $this->flightRepo->pushCriteria(new RequestCriteria($request)); } catch (RepositoryException $e) { Log::emergency($e); } - $flights = $this->flightRepo + $flights = $this->flightRepo->searchCriteria($request) ->with(['dpt_airport', 'arr_airport', 'airline']) ->orderBy('flight_number', 'asc') ->orderBy('route_leg', 'asc') @@ -84,10 +105,15 @@ class FlightController extends Controller ->pluck('flight_id')->toArray(); return view('flights.index', [ - 'airlines' => $this->airlineRepo->selectBoxList(true), - 'airports' => $this->airportRepo->selectBoxList(true), - 'flights' => $flights, - 'saved' => $saved_flights, + 'airlines' => $this->airlineRepo->selectBoxList(true), + 'airports' => $this->airportRepo->selectBoxList(true), + 'flights' => $flights, + 'saved' => $saved_flights, + 'subfleets' => $this->subfleetRepo->selectBoxList(true), + 'flight_number' => $request->input('flight_number'), + 'arr_icao' => $request->input('arr_icao'), + 'dep_icao' => $request->input('dep_icao'), + 'subfleet_id' => $request->input('subfleet_id'), ]); } @@ -114,62 +140,12 @@ class FlightController extends Controller ]); } - /** - * Make a search request using the Repository search - * - * @param Request $request - * - * @throws \Prettus\Repository\Exceptions\RepositoryException - * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - */ - public function search(Request $request) - { - $where = [ - 'active' => true, - 'visible' => true, - ]; - - if (setting('pilots.restrict_to_company')) { - $where['airline_id'] = Auth::user()->airline_id; - } - - // default restrictions on the flights shown. Handle search differently - if (setting('pilots.only_flights_from_current')) { - $where['dpt_airport_id'] = Auth::user()->curr_airport_id; - } - - $this->flightRepo->resetCriteria(); - - try { - $this->flightRepo->pushCriteria(new WhereCriteria($request, $where)); - } catch (RepositoryException $e) { - Log::emergency($e); - } - - $flights = $this->flightRepo->searchCriteria($request) - ->with(['dpt_airport', 'arr_airport', 'airline']) - ->orderBy('flight_number', 'asc') - ->orderBy('route_leg', 'asc') - ->paginate(); - - $saved_flights = Bid::where('user_id', Auth::id()) - ->pluck('flight_id')->toArray(); - - return view('flights.index', [ - 'airlines' => $this->airlineRepo->selectBoxList(true), - 'airports' => $this->airportRepo->selectBoxList(true), - 'flights' => $flights, - 'saved' => $saved_flights, - ]); - } - /** * Show the flight information page * * @param $id * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View + * @return mixed */ public function show($id) { diff --git a/app/Http/Controllers/Frontend/PirepController.php b/app/Http/Controllers/Frontend/PirepController.php index 2ab1113e..249c4ae5 100644 --- a/app/Http/Controllers/Frontend/PirepController.php +++ b/app/Http/Controllers/Frontend/PirepController.php @@ -21,6 +21,7 @@ use App\Services\FareService; use App\Services\GeoService; use App\Services\PirepService; use App\Services\UserService; +use App\Support\Units\Fuel; use App\Support\Units\Time; use Carbon\Carbon; use Illuminate\Http\Request; @@ -325,8 +326,13 @@ class PirepController extends Controller $minutes = (int) $request->input('minutes', 0); $pirep->flight_time = Utils::hoursToMinutes($hours) + $minutes; + // Set the correct fuel units + $pirep->block_fuel = new Fuel((float) $request->input('block_fuel'), setting('units.fuel')); + $pirep->fuel_used = new Fuel((float) $request->input('fuel_used'), setting('units.fuel')); + // Put the time that this is currently submitted $attrs['submitted_at'] = Carbon::now('UTC'); + $pirep->submitted_at = Carbon::now('UTC'); $pirep = $this->pirepSvc->create($pirep); $this->saveCustomFields($pirep, $request); diff --git a/app/Http/Controllers/Frontend/ProfileController.php b/app/Http/Controllers/Frontend/ProfileController.php index f8f24429..2ef5f421 100644 --- a/app/Http/Controllers/Frontend/ProfileController.php +++ b/app/Http/Controllers/Frontend/ProfileController.php @@ -18,10 +18,8 @@ use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Validator; use Intervention\Image\Facades\Image; use Laracasts\Flash\Flash; +use Nwidart\Modules\Facades\Module; -/** - * Class ProfileController - */ class ProfileController extends Controller { private $airlineRepo; @@ -45,6 +43,21 @@ class ProfileController extends Controller $this->userRepo = $userRepo; } + /** + * Return whether the vmsACARS module is enabled or not + */ + private function acarsEnabled(): bool + { + // Is the ACARS module enabled? + $acars_enabled = false; + $acars = Module::find('VMSACARS'); + if ($acars) { + $acars_enabled = $acars->isEnabled(); + } + + return $acars_enabled; + } + /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ @@ -57,6 +70,7 @@ class ProfileController extends Controller } return view('profile.index', [ + 'acars' => $this->acarsEnabled(), 'user' => Auth::user(), 'airports' => $airports, ]); @@ -119,7 +133,7 @@ class ProfileController extends Controller * * @throws \Prettus\Validator\Exceptions\ValidatorException * - * @return $this + * @return mixed */ public function update(Request $request) { @@ -200,4 +214,24 @@ class ProfileController extends Controller return redirect(route('frontend.profile.index')); } + + /** + * Generate the ACARS config and send it to download + * + * @param \Illuminate\Http\Request $request + * + * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response + */ + public function acars(Request $request) + { + $user = Auth::user(); + $config = view('system.acars.config', ['user' => $user])->render(); + + return response($config)->withHeaders([ + 'Content-Type' => 'text/xml', + 'Content-Length' => strlen($config), + 'Cache-Control' => 'no-store, no-cache', + 'Content-Disposition' => 'attachment; filename="settings.xml', + ]); + } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 4718cc62..4fc5cadb 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -8,9 +8,7 @@ use App\Http\Middleware\InstalledCheck; use App\Http\Middleware\JsonResponse; use App\Http\Middleware\RedirectIfAuthenticated; use App\Http\Middleware\UpdatePending; -use App\Http\Middleware\VerifyCsrfToken; use Illuminate\Auth\Middleware\Authenticate; -use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth; use Illuminate\Auth\Middleware\Authorize; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Foundation\Http\Kernel as HttpKernel; @@ -42,16 +40,14 @@ class Kernel extends HttpKernel AddQueuedCookiesToResponse::class, StartSession::class, ShareErrorsFromSession::class, - VerifyCsrfToken::class, + // VerifyCsrfToken::class, SubstituteBindings::class, - //\Spatie\Pjax\Middleware\FilterIfPjax::class, ], ]; protected $routeMiddleware = [ 'api.auth' => ApiAuth::class, 'auth' => Authenticate::class, - 'auth.basic' => AuthenticateWithBasicAuth::class, 'bindings' => SubstituteBindings::class, 'can' => Authorize::class, 'guest' => RedirectIfAuthenticated::class, diff --git a/app/Http/Middleware/ApiAuth.php b/app/Http/Middleware/ApiAuth.php index 5064e8b8..acbd24bc 100644 --- a/app/Http/Middleware/ApiAuth.php +++ b/app/Http/Middleware/ApiAuth.php @@ -5,12 +5,14 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use App\Models\Enums\UserState; use App\Models\User; -use Auth; use Closure; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; -class ApiAuth +class ApiAuth implements Middleware { /** * Handle an incoming request. @@ -20,7 +22,7 @@ class ApiAuth * * @return mixed */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { // Check if Authorization header is in place $api_key = $request->header('x-api-key', null); diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 15a20c00..c1f35f47 100755 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -2,9 +2,10 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter; -class EncryptCookies extends BaseEncrypter +class EncryptCookies extends BaseEncrypter implements Middleware { /** * The names of the cookies that should not be encrypted. diff --git a/app/Http/Middleware/InstalledCheck.php b/app/Http/Middleware/InstalledCheck.php index b4627c4d..d139baf1 100644 --- a/app/Http/Middleware/InstalledCheck.php +++ b/app/Http/Middleware/InstalledCheck.php @@ -5,17 +5,18 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Closure; use Illuminate\Http\Request; -class InstalledCheck +/** + * Check the app.key to see whether we're installed or not + * + * If the default key is set and we're not in any of the installer routes + * show the message that we need to be installed + */ +class InstalledCheck implements Middleware { - /** - * Check the app.key to see whether we're installed or not - * - * If the default key is set and we're not in any of the installer routes - * show the message that we need to be installed - */ public function handle(Request $request, Closure $next) { if (config('app.key') === 'base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY=' diff --git a/app/Http/Middleware/JsonResponse.php b/app/Http/Middleware/JsonResponse.php index 5ec02757..53b3f17d 100644 --- a/app/Http/Middleware/JsonResponse.php +++ b/app/Http/Middleware/JsonResponse.php @@ -5,11 +5,13 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Closure; +use Illuminate\Http\Request; -class JsonResponse +class JsonResponse implements Middleware { - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { $response = $next($request); $response->headers->set('Content-Type', 'application/json'); diff --git a/app/Http/Middleware/MeasureExecutionTime.php b/app/Http/Middleware/MeasureExecutionTime.php index 59139ce0..9b4b1673 100644 --- a/app/Http/Middleware/MeasureExecutionTime.php +++ b/app/Http/Middleware/MeasureExecutionTime.php @@ -5,19 +5,13 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Closure; +use Illuminate\Http\Request; -class MeasureExecutionTime +class MeasureExecutionTime implements Middleware { - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * - * @return mixed - */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { // Get the response $response = $next($request); @@ -31,8 +25,8 @@ class MeasureExecutionTime // I assume you're using valid json in your responses // Then I manipulate them below $content = json_decode($response->getContent(), true) + [ - 'execution_time' => $executionTime, - ]; + 'execution_time' => $executionTime, + ]; // Change the content of your response $response->setData($content); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index abb8423b..386ff05e 100755 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,21 +2,14 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Closure; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -class RedirectIfAuthenticated +class RedirectIfAuthenticated implements Middleware { - /** - * Handle an incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @param string|null $guard - * - * @return mixed - */ - public function handle($request, Closure $next, $guard = null) + public function handle(Request $request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect('/'); diff --git a/app/Http/Middleware/SetActiveTheme.php b/app/Http/Middleware/SetActiveTheme.php index e6c872ed..c549fbd1 100644 --- a/app/Http/Middleware/SetActiveTheme.php +++ b/app/Http/Middleware/SetActiveTheme.php @@ -2,17 +2,26 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Closure; use Igaster\LaravelTheme\Facades\Theme; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\Log; /** * Read the current theme from the settings (set in admin), and set it */ -class SetActiveTheme +class SetActiveTheme implements Middleware { - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { - $theme = setting('general.theme'); + try { + $theme = setting('general.theme'); + } catch (\Exception $e) { + Log::error($e->getMessage()); + $theme = 'default'; + } + if (!empty($theme)) { Theme::set($theme); } diff --git a/app/Http/Middleware/UpdatePending.php b/app/Http/Middleware/UpdatePending.php index 18d3f5ec..50eb8183 100644 --- a/app/Http/Middleware/UpdatePending.php +++ b/app/Http/Middleware/UpdatePending.php @@ -2,13 +2,15 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use App\Services\Installer\InstallerService; use Closure; +use Illuminate\Http\Request; /** * Determine if an update is pending by checking in with the Installer service */ -class UpdatePending +class UpdatePending implements Middleware { private $installerSvc; @@ -17,13 +19,7 @@ class UpdatePending $this->installerSvc = $installerSvc; } - /** - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * - * @return mixed - */ - public function handle($request, Closure $next) + public function handle(Request $request, Closure $next) { if ($this->installerSvc->isUpgradePending()) { return redirect('/update/step1'); diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 9c26fd50..9046b104 100755 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -2,9 +2,10 @@ namespace App\Http\Middleware; +use App\Contracts\Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; -class VerifyCsrfToken extends BaseVerifier +class VerifyCsrfToken extends BaseVerifier implements Middleware { /** * The URIs that should be excluded from CSRF verification. diff --git a/app/Http/Requests/Acars/CommentRequest.php b/app/Http/Requests/Acars/CommentRequest.php index 380ad66c..35164a9c 100644 --- a/app/Http/Requests/Acars/CommentRequest.php +++ b/app/Http/Requests/Acars/CommentRequest.php @@ -10,7 +10,7 @@ class CommentRequest extends FormRequest { $rules = [ 'comment' => 'required', - 'created_at' => 'nullable|date', + 'created_at' => 'sometimes|date', ]; return $rules; diff --git a/app/Http/Requests/Acars/EventRequest.php b/app/Http/Requests/Acars/EventRequest.php index 3d49e9b6..b0b01136 100644 --- a/app/Http/Requests/Acars/EventRequest.php +++ b/app/Http/Requests/Acars/EventRequest.php @@ -19,9 +19,9 @@ class EventRequest extends FormRequest $rules = [ 'events' => 'required|array', 'events.*.event' => 'required', - 'events.*.lat' => 'nullable|numeric', - 'events.*.lon' => 'nullable|numeric', - 'events.*.created_at' => 'nullable|date', + 'events.*.lat' => 'sometimes|numeric', + 'events.*.lon' => 'sometimes|numeric', + 'events.*.created_at' => 'sometimes|date', ]; return $rules; diff --git a/app/Http/Requests/Acars/FileRequest.php b/app/Http/Requests/Acars/FileRequest.php index 725961b5..63d9f12c 100644 --- a/app/Http/Requests/Acars/FileRequest.php +++ b/app/Http/Requests/Acars/FileRequest.php @@ -20,28 +20,28 @@ class FileRequest extends FormRequest 'distance' => 'required|numeric', 'flight_time' => 'required|integer', 'fuel_used' => 'required|numeric', - 'block_time' => 'nullable|integer', - 'airline_id' => 'nullable|exists:airlines,id', - 'aircraft_id' => 'nullable|exists:aircraft,id', - 'flight_number' => 'nullable', - 'flight_type' => 'nullable', - 'dpt_airport_id' => 'nullable', - 'arr_airport_id' => 'nullable', - 'route_code' => 'nullable', - 'route_leg' => 'nullable', - 'planned_distance' => 'nullable|numeric', - 'planned_flight_time' => 'nullable|integer', - 'level' => 'nullable|numeric', - 'zfw' => 'nullable|numeric', - 'block_fuel' => 'nullable|numeric', - 'route' => 'nullable', - 'notes' => 'nullable', - 'source_name' => 'nullable', - 'score' => 'nullable|integer', - 'landing_rate' => 'nullable|numeric', - 'block_off_time' => 'nullable|date', - 'block_on_time' => 'nullable|date', - 'created_at' => 'nullable|date', + 'block_time' => 'sometimes|integer', + 'airline_id' => 'sometimes|exists:airlines,id', + 'aircraft_id' => 'sometimes|exists:aircraft,id', + 'flight_number' => 'sometimes', + 'flight_type' => 'sometimes', + 'dpt_airport_id' => 'sometimes|size:4', + 'arr_airport_id' => 'sometimes|size:4', + 'route_code' => 'sometimes', + 'route_leg' => 'sometimes', + 'planned_distance' => 'sometimes|numeric', + 'planned_flight_time' => 'sometimes|integer', + 'level' => 'sometimes|numeric', + 'zfw' => 'sometimes|numeric', + 'block_fuel' => 'sometimes|numeric', + 'route' => 'sometimes', + 'notes' => 'sometimes', + 'source_name' => 'sometimes', + 'score' => 'sometimes|integer', + 'landing_rate' => 'sometimes|numeric', + 'block_off_time' => 'sometimes|date', + 'block_on_time' => 'sometimes|date', + 'created_at' => 'sometimes|date', // See if the fare objects are included and formatted properly 'fares' => 'nullable|array', diff --git a/app/Http/Requests/Acars/LogRequest.php b/app/Http/Requests/Acars/LogRequest.php index bc179cf5..daaef0e0 100644 --- a/app/Http/Requests/Acars/LogRequest.php +++ b/app/Http/Requests/Acars/LogRequest.php @@ -19,9 +19,9 @@ class LogRequest extends FormRequest $rules = [ 'logs' => 'required|array', 'logs.*.log' => 'required', - 'logs.*.lat' => 'nullable|numeric', - 'logs.*.lon' => 'nullable|numeric', - 'logs.*.created_at' => 'nullable|date', + 'logs.*.lat' => 'sometimes|numeric', + 'logs.*.lon' => 'sometimes|numeric', + 'logs.*.created_at' => 'sometimes|date', ]; return $rules; diff --git a/app/Http/Requests/Acars/PositionRequest.php b/app/Http/Requests/Acars/PositionRequest.php index 977371ac..89d79acf 100644 --- a/app/Http/Requests/Acars/PositionRequest.php +++ b/app/Http/Requests/Acars/PositionRequest.php @@ -23,18 +23,18 @@ class PositionRequest extends FormRequest 'positions' => 'required|array', 'positions.*.lat' => 'required|numeric', 'positions.*.lon' => 'required|numeric', - 'positions.*.status' => 'nullable', - 'positions.*.altitude' => 'nullable|numeric', - 'positions.*.heading' => 'nullable|numeric|between:0,360', - 'positions.*.vs' => 'nullable', - 'positions.*.gs' => 'nullable', - 'positions.*.transponder' => 'nullable', - 'positions.*.autopilot' => 'nullable', - 'positions.*.fuel' => 'nullable|numeric', - 'positions.*.fuel_flow' => 'nullable|numeric', - 'positions.*.log' => 'nullable', - 'positions.*.sim_time' => 'nullable|date', - 'positions.*.created_at' => 'nullable|date', + 'positions.*.status' => 'sometimes', + 'positions.*.altitude' => 'sometimes|numeric', + 'positions.*.heading' => 'sometimes|numeric|between:0,360', + 'positions.*.vs' => 'sometimes', + 'positions.*.gs' => 'sometimes', + 'positions.*.transponder' => 'sometimes', + 'positions.*.autopilot' => 'sometimes', + 'positions.*.fuel' => 'sometimes|numeric', + 'positions.*.fuel_flow' => 'sometimes|numeric', + 'positions.*.log' => 'sometimes|nullable', + 'positions.*.sim_time' => 'sometimes|date', + 'positions.*.created_at' => 'sometimes|date', ]; return $rules; diff --git a/app/Http/Requests/Acars/PrefileRequest.php b/app/Http/Requests/Acars/PrefileRequest.php index fae3aa5f..e69e4eb1 100644 --- a/app/Http/Requests/Acars/PrefileRequest.php +++ b/app/Http/Requests/Acars/PrefileRequest.php @@ -11,30 +11,30 @@ class PrefileRequest extends FormRequest $rules = [ 'airline_id' => 'required|exists:airlines,id', 'aircraft_id' => 'required|exists:aircraft,id', + 'flight_id' => 'sometimes|exists:flights,id', 'flight_number' => 'required', - 'dpt_airport_id' => 'required', - 'arr_airport_id' => 'required', - 'flight_id' => 'nullable', + 'dpt_airport_id' => 'required|size:4', + 'arr_airport_id' => 'required|size:4', 'source_name' => 'required', - 'alt_airport_id' => 'nullable', - 'status' => 'nullable', + 'alt_airport_id' => 'sometimes|size:4', + 'status' => 'sometimes', 'level' => 'nullable|numeric', - 'flight_type' => 'nullable', - 'route_code' => 'nullable', - 'route_leg' => 'nullable', - 'distance' => 'nullable|numeric', - 'block_time' => 'nullable|integer', - 'flight_time' => 'nullable|integer', - 'planned_distance' => 'nullable|numeric', - 'planned_flight_time' => 'nullable|integer', - 'zfw' => 'nullable|numeric', - 'block_fuel' => 'nullable|numeric', + 'flight_type' => 'sometimes', + 'route_code' => 'sometimes', + 'route_leg' => 'sometimes', + 'distance' => 'sometimes|numeric', + 'block_time' => 'sometimes|integer', + 'flight_time' => 'sometimes|integer', + 'planned_distance' => 'sometimes|numeric', + 'planned_flight_time' => 'sometimes|integer', + 'zfw' => 'sometimes|numeric', + 'block_fuel' => 'sometimes|numeric', 'route' => 'nullable', 'notes' => 'nullable', - 'score' => 'nullable|integer', - 'block_off_time' => 'nullable|date', - 'block_on_time' => 'nullable|date', - 'created_at' => 'nullable|date', + 'score' => 'sometimes|integer', + 'block_off_time' => 'sometimes|date', + 'block_on_time' => 'sometimes|date', + 'created_at' => 'sometimes|date', // See if the fare objects are included and formatted properly 'fares' => 'nullable|array', diff --git a/app/Http/Requests/Acars/RouteRequest.php b/app/Http/Requests/Acars/RouteRequest.php index 84a7439c..bc61e813 100644 --- a/app/Http/Requests/Acars/RouteRequest.php +++ b/app/Http/Requests/Acars/RouteRequest.php @@ -20,7 +20,7 @@ class RouteRequest extends FormRequest 'route' => 'required|array', 'route.*.name' => 'required', 'route.*.order' => 'required|int', - 'route.*.nav_type' => 'nullable|int', + 'route.*.nav_type' => 'sometimes|int', 'route.*.lat' => 'required|numeric', 'route.*.lon' => 'required|numeric', ]; diff --git a/app/Http/Requests/Acars/UpdateRequest.php b/app/Http/Requests/Acars/UpdateRequest.php index 67d4c87d..945684b2 100644 --- a/app/Http/Requests/Acars/UpdateRequest.php +++ b/app/Http/Requests/Acars/UpdateRequest.php @@ -19,29 +19,30 @@ class UpdateRequest extends FormRequest $rules = [ 'airline_id' => 'nullable|exists:airlines,id', 'aircraft_id' => 'nullable|exists:aircraft,id', - 'flight_number' => 'nullable', - 'dpt_airport_id' => 'nullable', - 'arr_airport_id' => 'nullable', + 'flight_id' => 'sometimes|nullable|exists:flights,id', + 'flight_number' => 'sometimes|required', + 'dpt_airport_id' => 'sometimes|required|size:4', + 'arr_airport_id' => 'sometimes|required|size:4', 'route_code' => 'nullable', 'route_leg' => 'nullable', - 'distance' => 'nullable|numeric', - 'planned_distance' => 'nullable|numeric', - 'block_time' => 'nullable|integer', - 'flight_time' => 'nullable|integer', + 'distance' => 'sometimes|numeric', + 'planned_distance' => 'sometimes|numeric', + 'block_time' => 'sometimes|integer', + 'flight_time' => 'sometimes|integer', 'flight_type' => 'nullable', - 'planned_flight_time' => 'nullable|integer', - 'level' => 'nullable|numeric', - 'zfw' => 'nullable|numeric', - 'fuel_used' => 'nullable|numeric', - 'block_fuel' => 'nullable|numeric', - 'route' => 'nullable', - 'notes' => 'nullable', - 'source_name' => 'nullable|max:25', - 'landing_rate' => 'nullable|numeric', - 'block_off_time' => 'nullable', - 'block_on_time' => 'nullable', - 'created_at' => 'nullable', - 'status' => 'nullable', + 'planned_flight_time' => 'sometimes|integer', + 'level' => 'sometimes|numeric', + 'zfw' => 'sometimes|numeric', + 'fuel_used' => 'sometimes|numeric', + 'block_fuel' => 'sometimes|numeric', + 'route' => 'sometimes|nullable', + 'notes' => 'sometimes|nullable', + 'source_name' => 'sometimes|max:25', + 'landing_rate' => 'sometimes|numeric', + 'block_off_time' => 'sometimes|date', + 'block_on_time' => 'sometimes|date', + 'created_at' => 'sometimes|date', + 'status' => 'sometimes', 'score' => 'nullable|integer', // See if the fare objects are included and formatted properly diff --git a/app/Http/Routes/admin.php b/app/Http/Routes/admin.php index f0f83c75..976fe799 100644 --- a/app/Http/Routes/admin.php +++ b/app/Http/Routes/admin.php @@ -2,101 +2,214 @@ /** * Admin Routes */ -Route::group([ - 'namespace' => 'Admin', 'prefix' => 'admin', 'as' => 'admin.', - 'middleware' => ['ability:admin,admin-access'], -], static function () { - // CRUD for airlines - Route::resource('airlines', 'AirlinesController'); +use Illuminate\Support\Facades\Route; - // CRUD for roles - Route::resource('roles', 'RolesController'); +Route::group( + [ + 'namespace' => 'Admin', + 'prefix' => 'admin', + 'as' => 'admin.', + 'middleware' => ['auth', 'ability:admin,admin-access'], + ], + static function () { + // CRUD for airlines + Route::resource('airlines', 'AirlinesController')->middleware('ability:admin,airlines'); - Route::get('airports/export', 'AirportController@export')->name('airports.export'); - Route::match(['get', 'post', 'put'], 'airports/fuel', 'AirportController@fuel'); - Route::match(['get', 'post'], 'airports/import', 'AirportController@import')->name('airports.import'); - Route::match(['get', 'post', 'put', 'delete'], 'airports/{id}/expenses', 'AirportController@expenses'); - Route::resource('airports', 'AirportController'); + // CRUD for roles + Route::resource('roles', 'RolesController')->middleware('role:admin'); - // Awards - Route::resource('awards', 'AwardController'); + Route::get('airports/export', 'AirportController@export') + ->name('airports.export') + ->middleware('ability:admin,airports'); - // aircraft and fare associations - Route::get('aircraft/export', 'AircraftController@export')->name('aircraft.export'); - Route::match(['get', 'post'], 'aircraft/import', 'AircraftController@import')->name('aircraft.import'); - Route::match(['get', 'post', 'put', 'delete'], 'aircraft/{id}/expenses', 'AircraftController@expenses'); - Route::resource('aircraft', 'AircraftController'); + Route::match(['get', 'post', 'put'], 'airports/fuel', 'AirportController@fuel') + ->middleware('ability:admin,airports'); - // expenses - Route::get('expenses/export', 'ExpenseController@export')->name('expenses.export'); - Route::match(['get', 'post'], 'expenses/import', 'ExpenseController@import')->name('expenses.import'); - Route::resource('expenses', 'ExpenseController'); + Route::match(['get', 'post'], 'airports/import', 'AirportController@import') + ->name('airports.import')->middleware('ability:admin,airports'); - // fares - Route::get('fares/export', 'FareController@export')->name('fares.export'); - Route::match(['get', 'post'], 'fares/import', 'FareController@import')->name('fares.import'); - Route::resource('fares', 'FareController'); + Route::match( + ['get', 'post', 'put', 'delete'], + 'airports/{id}/expenses', + 'AirportController@expenses' + )->middleware('ability:admin,airports'); - // files - Route::post('files', 'FileController@store')->name('files.store'); - Route::delete('files/{id}', 'FileController@destroy')->name('files.delete'); + Route::resource('airports', 'AirportController')->middleware('ability:admin,airports'); - // finances - Route::resource('finances', 'FinanceController'); + // Awards + Route::resource('awards', 'AwardController')->middleware('ability:admin,awards'); - // flights and aircraft associations - Route::get('flights/export', 'FlightController@export')->name('flights.export'); - Route::match(['get', 'post'], 'flights/import', 'FlightController@import')->name('flights.import'); - Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fares', 'FlightController@fares'); - Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/fields', 'FlightController@field_values'); - Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/subfleets', 'FlightController@subfleets'); - Route::resource('flights', 'FlightController'); + // aircraft and fare associations + Route::get('aircraft/export', 'AircraftController@export') + ->name('aircraft.export') + ->middleware('ability:admin,aircraft'); - Route::resource('flightfields', 'FlightFieldController'); + Route::match(['get', 'post'], 'aircraft/import', 'AircraftController@import') + ->name('aircraft.import')->middleware('ability:admin,aircraft'); - // pirep related routes - Route::get('pireps/fares', 'PirepController@fares'); - Route::get('pireps/pending', 'PirepController@pending'); - Route::resource('pireps', 'PirepController'); - Route::match(['get', 'post', 'delete'], 'pireps/{id}/comments', 'PirepController@comments'); - Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status')->name('pirep.status'); + Route::match( + ['get', 'post', 'put', 'delete'], + 'aircraft/{id}/expenses', + 'AircraftController@expenses' + )->middleware('ability:admin,aircraft'); - Route::resource('pirepfields', 'PirepFieldController'); + Route::resource('aircraft', 'AircraftController')->middleware('ability:admin,aircraft'); - // rankings - Route::resource('ranks', 'RankController'); - Route::match(['get', 'post', 'put', 'delete'], 'ranks/{id}/subfleets', 'RankController@subfleets'); + // expenses + Route::get('expenses/export', 'ExpenseController@export') + ->name('expenses.export') + ->middleware('ability:admin,finances'); - // settings - Route::match(['get'], 'settings', 'SettingsController@index'); - Route::match(['post', 'put'], 'settings', 'SettingsController@update')->name('settings.update'); + Route::match(['get', 'post'], 'expenses/import', 'ExpenseController@import') + ->name('expenses.import') + ->middleware('ability:admin,finances'); - // maintenance - Route::match(['get'], 'maintenance', 'MaintenanceController@index')->name('maintenance.index'); - Route::match(['post'], 'maintenance', 'MaintenanceController@cache')->name('maintenance.cache'); + Route::resource('expenses', 'ExpenseController')->middleware('ability:admin,finances'); - // subfleet - Route::get('subfleets/export', 'SubfleetController@export')->name('subfleets.export'); - Route::match(['get', 'post'], 'subfleets/import', 'SubfleetController@import')->name('subfleets.import'); - Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/expenses', 'SubfleetController@expenses'); - Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/fares', 'SubfleetController@fares'); - Route::match(['get', 'post', 'put', 'delete'], 'subfleets/{id}/ranks', 'SubfleetController@ranks'); - Route::resource('subfleets', 'SubfleetController'); + // fares + Route::get('fares/export', 'FareController@export') + ->name('fares.export') + ->middleware('ability:admin,finances'); - Route::resource('users', 'UserController'); - Route::get( - 'users/{id}/regen_apikey', - 'UserController@regen_apikey' - )->name('users.regen_apikey'); + Route::match(['get', 'post'], 'fares/import', 'FareController@import') + ->name('fares.import')->middleware('ability:admin,finances'); - // defaults - Route::get('', ['uses' => 'DashboardController@index'])->middleware('update_pending'); - Route::get('/', ['uses' => 'DashboardController@index'])->middleware('update_pending'); + Route::resource('fares', 'FareController')->middleware('ability:admin,finances'); - Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']); - Route::match( - ['get', 'post', 'delete'], - 'dashboard/news', - ['uses' => 'DashboardController@news'] - )->name('dashboard.news'); -}); + // files + Route::post('files', 'FileController@store') + ->name('files.store') + ->middleware('ability:admin,files'); + + Route::delete('files/{id}', 'FileController@destroy') + ->name('files.delete') + ->middleware('ability:admin,files'); + + // finances + Route::resource('finances', 'FinanceController')->middleware('ability:admin,finances'); + + // flights and aircraft associations + Route::get('flights/export', 'FlightController@export') + ->name('flights.export') + ->middleware('ability:admin,flights'); + + Route::match(['get', 'post'], 'flights/import', 'FlightController@import') + ->name('flights.import') + ->middleware('ability:admin,flights'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'flights/{id}/fares', + 'FlightController@fares' + )->middleware('ability:admin,flights'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'flights/{id}/fields', + 'FlightController@field_values' + )->middleware('ability:admin,flights'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'flights/{id}/subfleets', + 'FlightController@subfleets' + )->middleware('ability:admin,flights'); + + Route::resource('flights', 'FlightController') + ->middleware('ability:admin,flights'); + + Route::resource('flightfields', 'FlightFieldController') + ->middleware('ability:admin,flights'); + + // pirep related routes + Route::get('pireps/fares', 'PirepController@fares')->middleware('ability:admin,pireps'); + Route::get('pireps/pending', 'PirepController@pending')->middleware('ability:admin,pireps'); + Route::resource('pireps', 'PirepController')->middleware('ability:admin,pireps'); + + Route::match(['get', 'post', 'delete'], 'pireps/{id}/comments', 'PirepController@comments') + ->middleware('ability:admin,pireps'); + + Route::match(['post', 'put'], 'pireps/{id}/status', 'PirepController@status') + ->name('pirep.status') + ->middleware('ability:admin,pireps'); + + Route::resource('pirepfields', 'PirepFieldController') + ->middleware('ability:admin,pireps'); + + // rankings + Route::resource('ranks', 'RankController')->middleware('ability:admin,ranks'); + Route::match( + ['get', 'post', 'put', 'delete'], + 'ranks/{id}/subfleets', + 'RankController@subfleets' + )->middleware('ability:admin,ranks'); + + // settings + Route::match(['get'], 'settings', 'SettingsController@index') + ->middleware('ability:admin,settings'); + + Route::match(['post', 'put'], 'settings', 'SettingsController@update') + ->name('settings.update') + ->middleware('ability:admin,settings'); + + // maintenance + Route::match(['get'], 'maintenance', 'MaintenanceController@index') + ->name('maintenance.index') + ->middleware('ability:admin,maintenance'); + + Route::match(['post'], 'maintenance', 'MaintenanceController@cache') + ->name('maintenance.cache') + ->middleware('ability:admin,maintenance'); + + // subfleet + Route::get('subfleets/export', 'SubfleetController@export') + ->name('subfleets.export') + ->middleware('ability:admin,fleet'); + + Route::match(['get', 'post'], 'subfleets/import', 'SubfleetController@import') + ->name('subfleets.import') + ->middleware('ability:admin,fleet'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'subfleets/{id}/expenses', + 'SubfleetController@expenses' + )->middleware('ability:admin,fleet'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'subfleets/{id}/fares', + 'SubfleetController@fares' + )->middleware('ability:admin,fleet'); + + Route::match( + ['get', 'post', 'put', 'delete'], + 'subfleets/{id}/ranks', + 'SubfleetController@ranks' + )->middleware('ability:admin,fleet'); + + Route::resource('subfleets', 'SubfleetController')->middleware('ability:admin,fleet'); + + Route::resource('users', 'UserController')->middleware('ability:admin,users'); + Route::get( + 'users/{id}/regen_apikey', + 'UserController@regen_apikey' + )->name('users.regen_apikey')->middleware('ability:admin,users'); + + // defaults + Route::get('', ['uses' => 'DashboardController@index']) + ->middleware('update_pending', 'ability:admin,admin-access'); + + Route::get('/', ['uses' => 'DashboardController@index']) + ->middleware('update_pending', 'ability:admin,admin-access'); + + Route::get('dashboard', ['uses' => 'DashboardController@index', 'name' => 'dashboard']) + ->middleware('update_pending', 'ability:admin,admin-access'); + + Route::match( + ['get', 'post', 'delete'], + 'dashboard/news', + ['uses' => 'DashboardController@news'] + )->name('dashboard.news')->middleware('update_pending', 'ability:admin,admin-access'); + } +); diff --git a/app/Http/Routes/api.php b/app/Http/Routes/api.php index 6da61a84..4069059f 100755 --- a/app/Http/Routes/api.php +++ b/app/Http/Routes/api.php @@ -3,6 +3,8 @@ /** * Public routes */ +use Illuminate\Support\Facades\Route; + Route::group([], function () { Route::get('acars', 'AcarsController@live_flights'); Route::get('acars/geojson', 'AcarsController@pireps_geojson'); @@ -43,6 +45,8 @@ Route::group(['middleware' => ['api.auth']], function () { * ACARS related */ Route::post('pireps/prefile', 'PirepController@prefile'); + Route::post('pireps/{pirep_id}', 'PirepController@update'); + Route::patch('pireps/{pirep_id}', 'PirepController@update'); Route::post('pireps/{pirep_id}/update', 'PirepController@update'); Route::post('pireps/{pirep_id}/file', 'PirepController@file'); Route::post('pireps/{pirep_id}/comments', 'PirepController@comments_post'); diff --git a/app/Http/Routes/console.php b/app/Http/Routes/console.php deleted file mode 100755 index eea1a865..00000000 --- a/app/Http/Routes/console.php +++ /dev/null @@ -1,18 +0,0 @@ -comment(Inspiring::quote()); -}); diff --git a/app/Http/Routes/web.php b/app/Http/Routes/web.php index a10e3e89..2c9782da 100755 --- a/app/Http/Routes/web.php +++ b/app/Http/Routes/web.php @@ -4,6 +4,8 @@ * User doesn't need to be logged in for these */ use App\Http\Middleware\SetActiveTheme; +use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Route; Route::group([ 'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.', @@ -11,8 +13,9 @@ Route::group([ ], function () { Route::get('/', 'HomeController@index')->name('home'); Route::get('r/{id}', 'PirepController@show')->name('pirep.show.public'); - Route::get('p/{id}', 'ProfileController@show')->name('profile.show.public'); + Route::get('pireps/{id}', 'PirepController@show')->name('pireps.show'); + Route::get('p/{id}', 'ProfileController@show')->name('profile.show.public'); Route::get('users', 'UserController@index')->name('users.index'); Route::get('pilots', 'UserController@index')->name('pilots.index'); @@ -24,7 +27,7 @@ Route::group([ */ Route::group([ 'namespace' => 'Frontend', 'prefix' => '', 'as' => 'frontend.', - 'middleware' => ['role:admin|user', SetActiveTheme::class], + 'middleware' => ['auth', SetActiveTheme::class], ], function () { Route::resource('dashboard', 'DashboardController'); @@ -38,12 +41,16 @@ Route::group([ Route::get('flights/search', 'FlightController@search')->name('flights.search'); Route::resource('flights', 'FlightController'); + Route::resource('pireps', 'PirepController', [ + 'except' => ['show'], + ]); + Route::get('pireps/fares', 'PirepController@fares'); - Route::resource('pireps', 'PirepController'); Route::post('pireps/{id}/submit', 'PirepController@submit')->name('pireps.submit'); - Route::get('profile/regen_apikey', 'ProfileController@regen_apikey') - ->name('profile.regen_apikey'); + Route::get('profile/acars', 'ProfileController@acars')->name('profile.acars'); + Route::get('profile/regen_apikey', 'ProfileController@regen_apikey')->name('profile.regen_apikey'); + Route::resource('profile', 'ProfileController'); }); diff --git a/app/Listeners/BidEvents.php b/app/Listeners/BidEventHandler.php similarity index 57% rename from app/Listeners/BidEvents.php rename to app/Listeners/BidEventHandler.php index 2aed462d..fff8affa 100644 --- a/app/Listeners/BidEvents.php +++ b/app/Listeners/BidEventHandler.php @@ -4,14 +4,19 @@ namespace App\Listeners; use App\Contracts\Listener; use App\Events\PirepAccepted; +use App\Events\PirepRejected; use App\Services\BidService; -use Illuminate\Contracts\Events\Dispatcher; /** * Do stuff with bids - like if a PIREP is accepted, then remove the bid */ -class BidEvents extends Listener +class BidEventHandler extends Listener { + public static $callbacks = [ + PirepAccepted::class => 'onPirepAccept', + PirepRejected::class => 'onPirepReject', + ]; + private $bidSvc; public function __construct(BidService $bidSvc) @@ -19,17 +24,6 @@ class BidEvents extends Listener $this->bidSvc = $bidSvc; } - /** - * @param $events - */ - public function subscribe(Dispatcher $events): void - { - $events->listen( - PirepAccepted::class, - 'App\Listeners\BidEvents@onPirepAccept' - ); - } - /** * When a PIREP is accepted, remove any bids * @@ -43,4 +37,18 @@ class BidEvents extends Listener { $this->bidSvc->removeBidForPirep($event->pirep); } + + /** + * When a PIREP is accepted, remove any bids + * + * @param PirepRejected $event + * + * @throws \UnexpectedValueException + * @throws \InvalidArgumentException + * @throws \Exception + */ + public function onPirepReject(PirepRejected $event): void + { + $this->bidSvc->removeBidForPirep($event->pirep); + } } diff --git a/app/Listeners/ExpenseListener.php b/app/Listeners/ExpenseListener.php index 3329839a..3de6c596 100644 --- a/app/Listeners/ExpenseListener.php +++ b/app/Listeners/ExpenseListener.php @@ -5,9 +5,6 @@ namespace App\Listeners; use App\Contracts\Listener; use App\Events\Expenses; -/** - * Class ExpenseListener - */ class ExpenseListener extends Listener { /** diff --git a/app/Listeners/FinanceEvents.php b/app/Listeners/FinanceEventHandler.php similarity index 65% rename from app/Listeners/FinanceEvents.php rename to app/Listeners/FinanceEventHandler.php index 61548cd2..a3549bcb 100644 --- a/app/Listeners/FinanceEvents.php +++ b/app/Listeners/FinanceEventHandler.php @@ -6,41 +6,23 @@ use App\Contracts\Listener; use App\Events\PirepAccepted; use App\Events\PirepRejected; use App\Services\Finance\PirepFinanceService; -use Illuminate\Contracts\Events\Dispatcher; /** * Subscribe for events that we do some financial processing for * This includes when a PIREP is accepted, or rejected */ -class FinanceEvents extends Listener +class FinanceEventHandler extends Listener { private $financeSvc; - /** - * FinanceEvents constructor. - * - * @param PirepFinanceService $financeSvc - */ - public function __construct( - PirepFinanceService $financeSvc - ) { - $this->financeSvc = $financeSvc; - } + public static $callbacks = [ + PirepAccepted::class => 'onPirepAccept', + PirepRejected::class => 'onPirepReject', + ]; - /** - * @param $events - */ - public function subscribe(Dispatcher $events): void + public function __construct(PirepFinanceService $financeSvc) { - $events->listen( - PirepAccepted::class, - 'App\Listeners\FinanceEvents@onPirepAccept' - ); - - $events->listen( - PirepRejected::class, - 'App\Listeners\FinanceEvents@onPirepReject' - ); + $this->financeSvc = $financeSvc; } /** diff --git a/app/Listeners/SetUserActive.php b/app/Listeners/UserStateListener.php similarity index 93% rename from app/Listeners/SetUserActive.php rename to app/Listeners/UserStateListener.php index 2a484bf9..4937746f 100644 --- a/app/Listeners/SetUserActive.php +++ b/app/Listeners/UserStateListener.php @@ -7,7 +7,7 @@ use App\Events\PirepFiled; use App\Events\UserStateChanged; use App\Models\Enums\UserState; -class SetUserActive extends Listener +class UserStateListener extends Listener { public function handle(PirepFiled $event): void { diff --git a/app/Models/Aircraft.php b/app/Models/Aircraft.php index d8bfd8cf..d73bd05f 100644 --- a/app/Models/Aircraft.php +++ b/app/Models/Aircraft.php @@ -6,6 +6,7 @@ use App\Contracts\Model; use App\Models\Enums\AircraftStatus; use App\Models\Traits\ExpensableTrait; use App\Models\Traits\FilesTrait; +use Carbon\Carbon; /** * @property int id diff --git a/app/Models/Airport.php b/app/Models/Airport.php index b4d9b7d7..4562e090 100644 --- a/app/Models/Airport.php +++ b/app/Models/Airport.php @@ -66,10 +66,10 @@ class Airport extends Model * Validation rules */ public static $rules = [ - 'icao' => 'required', - 'iata' => 'nullable', + 'icao' => 'required|size:4', + 'iata' => 'sometimes|nullable', 'name' => 'required', - 'location' => 'nullable', + 'location' => 'sometimes', 'lat' => 'required|numeric', 'lon' => 'required|numeric', 'ground_handling_cost' => 'nullable|numeric', diff --git a/app/Models/File.php b/app/Models/File.php index 774dfb74..5887d4cb 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -67,7 +67,7 @@ class File extends Model * * @return string */ - public function getFilenameAttribute() :string + public function getFilenameAttribute(): string { if (!$this->pathinfo) { $this->pathinfo = pathinfo($this->path); diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 13457a65..4fccc4ef 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -93,8 +93,8 @@ class Flight extends Model 'flight_number' => 'required', 'route_code' => 'nullable', 'route_leg' => 'nullable', - 'dpt_airport_id' => 'required', - 'arr_airport_id' => 'required', + 'dpt_airport_id' => 'required|size:4|exists:airports,id', + 'arr_airport_id' => 'required|size:4|exists:airports,id', 'level' => 'nullable', ]; diff --git a/app/Models/Journal.php b/app/Models/Journal.php index 506c6b1e..bc4d8182 100644 --- a/app/Models/Journal.php +++ b/app/Models/Journal.php @@ -11,7 +11,7 @@ use App\Support\Money; use Carbon\Carbon; /** - * Class Journal + * Holds various journals, depending on the morphed_type and morphed_id columns * * @property mixed id * @property Money $balance diff --git a/app/Models/News.php b/app/Models/News.php index f34259d0..644b5a87 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -4,6 +4,10 @@ namespace App\Models; use App\Contracts\Model; +/** + * @property string subject + * @property string body + */ class News extends Model { public $table = 'news'; diff --git a/app/Models/Permission.php b/app/Models/Permission.php index beaa2e89..94a893e9 100644 --- a/app/Models/Permission.php +++ b/app/Models/Permission.php @@ -4,6 +4,9 @@ namespace App\Models; use Laratrust\Models\LaratrustPermission; +/** + * @method static firstOrCreate(array $array, array $array1) + */ class Permission extends LaratrustPermission { } diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index d032ec28..90d013d3 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -126,8 +126,8 @@ class Pirep extends Model 'flight_number' => 'required', 'dpt_airport_id' => 'required', 'arr_airport_id' => 'required', - 'block_fuel' => 'required|numeric', - 'fuel_used' => 'required|numeric', + 'block_fuel' => 'sometimes|numeric', + 'fuel_used' => 'sometimes|numeric', 'level' => 'nullable|numeric', 'notes' => 'nullable', 'route' => 'nullable', @@ -260,16 +260,17 @@ class Pirep extends Model */ public function getProgressPercentAttribute() { - $upper_bound = $this->distance['nmi']; + $distance = $this->distance; + + $upper_bound = $distance; if ($this->planned_distance) { - $upper_bound = $this->planned_distance['nmi']; + $upper_bound = $this->planned_distance; } - if (!$upper_bound) { - $upper_bound = 1; - } + $upper_bound = empty($upper_bound) ? 1 : $upper_bound; + $distance = empty($distance) ? $upper_bound : $distance; - return round(($this->distance['nmi'] / $upper_bound) * 100, 0); + return round(($distance / $upper_bound) * 100, 0); } /** @@ -419,7 +420,16 @@ class Pirep extends Model public function arr_airport() { - return $this->belongsTo(Airport::class, 'arr_airport_id'); + return $this->belongsTo(Airport::class, 'arr_airport_id') + ->withDefault(function ($model) { + if (!empty($this->attributes['arr_airport_id'])) { + $model->id = $this->attributes['arr_airport_id']; + $model->icao = $this->attributes['arr_airport_id']; + $model->name = $this->attributes['arr_airport_id']; + } + + return $model; + }); } public function alt_airport() @@ -429,7 +439,16 @@ class Pirep extends Model public function dpt_airport() { - return $this->belongsTo(Airport::class, 'dpt_airport_id'); + return $this->belongsTo(Airport::class, 'dpt_airport_id') + ->withDefault(function ($model) { + if (!empty($this->attributes['dpt_airport_id'])) { + $model->id = $this->attributes['dpt_airport_id']; + $model->icao = $this->attributes['dpt_airport_id']; + $model->name = $this->attributes['dpt_airport_id']; + } + + return $model; + }); } public function comments() diff --git a/app/Models/Role.php b/app/Models/Role.php index 176165d7..f2684a38 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -5,7 +5,7 @@ namespace App\Models; use Laratrust\Models\LaratrustRole; /** - * @method static where(string $string, $group) + * @mixin \Illuminate\Database\Eloquent\Builder */ class Role extends LaratrustRole { diff --git a/app/Models/User.php b/app/Models/User.php index 69a1f67d..fe10797a 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -34,6 +34,8 @@ use Laratrust\Traits\LaratrustUserTrait; * @property int state * @property bool opt_in * @property string last_pirep_id + * + * @mixin \Illuminate\Database\Eloquent\Builder * @mixin \Illuminate\Notifications\Notifiable * @mixin \Laratrust\Traits\LaratrustUserTrait */ @@ -144,7 +146,7 @@ class User extends Authenticatable } return new File([ - 'path' => $this->attributes['avatar'], + 'path' => $this->attributes['avatar'], ]); } diff --git a/app/Notifications/Admin/UserRegistered.php b/app/Notifications/Admin/UserRegistered.php deleted file mode 100644 index 091db41c..00000000 --- a/app/Notifications/Admin/UserRegistered.php +++ /dev/null @@ -1,61 +0,0 @@ -user = $user; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address')) - ->markdown('mail.admin.user.registered') - ->subject('A new user registered') - ->with(['user' => $this->user]); - } - - public function toArray($notifiable) - { - return [ - 'user_id' => $this->user->id, - ]; - } -} diff --git a/app/Notifications/BaseNotification.php b/app/Notifications/BaseNotification.php new file mode 100644 index 00000000..3b68b31c --- /dev/null +++ b/app/Notifications/BaseNotification.php @@ -0,0 +1,41 @@ +channels = $notif_config[$klass]; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * + * @return array + */ + public function via($notifiable) + { + return $this->channels; + } +} diff --git a/app/Notifications/Channels/MailChannel.php b/app/Notifications/Channels/MailChannel.php new file mode 100644 index 00000000..3cb150b0 --- /dev/null +++ b/app/Notifications/Channels/MailChannel.php @@ -0,0 +1,41 @@ +mailSubject = $subject; + $this->mailTemplate = $template; + $this->mailTemplateArgs = $args; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage()) + ->from(config('mail.from.address', 'no-reply@phpvms.net')) + ->subject($this->mailSubject) + ->markdown($this->mailTemplate, $this->mailTemplateArgs); + } +} diff --git a/app/Listeners/NotificationEvents.php b/app/Notifications/EventHandler.php similarity index 60% rename from app/Listeners/NotificationEvents.php rename to app/Notifications/EventHandler.php index 192d87de..f1fa94a0 100644 --- a/app/Listeners/NotificationEvents.php +++ b/app/Notifications/EventHandler.php @@ -1,8 +1,9 @@ 'onPirepAccepted', + PirepFiled::class => 'onPirepFile', + PirepRejected::class => 'onPirepRejected', + UserRegistered::class => 'onUserRegister', + UserStateChanged::class => 'onUserStateChange', + ]; + + public function __construct() { - $events->listen(UserRegistered::class, 'App\Listeners\NotificationEvents@onUserRegister'); - $events->listen(UserStateChanged::class, 'App\Listeners\NotificationEvents@onUserStateChange'); - $events->listen(PirepFiled::class, 'App\Listeners\NotificationEvents@onPirepFile'); - $events->listen(PirepAccepted::class, 'App\Listeners\NotificationEvents@onPirepAccepted'); - $events->listen(PirepRejected::class, 'App\Listeners\NotificationEvents@onPirepRejected'); + static::$broadcastNotifyable = app(Broadcast::class); } /** @@ -43,7 +50,7 @@ class NotificationEvents extends Listener try { Notification::send($admin_users, $notification); - } catch (\Exception $e) { + } catch (Exception $e) { Log::emergency('Error emailing admins, malformed email='.$e->getMessage()); } } @@ -56,7 +63,23 @@ class NotificationEvents extends Listener { try { $user->notify($notification); - } catch (\Exception $e) { + } catch (Exception $e) { + Log::emergency('Error emailing admins, malformed email='.$e->getMessage()); + } + } + + /** + * Send a notification to all users + * + * @param $notification + */ + protected function notifyAllUsers($notification) + { + $users = User::all()->get(); + + try { + Notification::send($users, $notification); + } catch (Exception $e) { Log::emergency('Error emailing admins, malformed email='.$e->getMessage()); } } @@ -70,21 +93,20 @@ class NotificationEvents extends Listener { Log::info('NotificationEvents::onUserRegister: ' .$event->user->ident.' is ' - .UserState::label($event->user->state) - .', sending active email'); + .UserState::label($event->user->state).', sending active email'); /* * Send all of the admins a notification that a new user registered */ - $this->notifyAdmins(new \App\Notifications\Admin\UserRegistered($event->user)); + $this->notifyAdmins(new Messages\AdminUserRegistered($event->user)); /* * Send the user a confirmation email */ if ($event->user->state === UserState::ACTIVE) { - $this->notifyUser($event->user, new \App\Notifications\UserRegistered($event->user)); + $this->notifyUser($event->user, new Messages\UserRegistered($event->user)); } elseif ($event->user->state === UserState::PENDING) { - $this->notifyUser($event->user, new \App\Notifications\UserPending($event->user)); + $this->notifyUser($event->user, new UserPending($event->user)); } } @@ -99,9 +121,9 @@ class NotificationEvents extends Listener if ($event->old_state === UserState::PENDING) { if ($event->user->state === UserState::ACTIVE) { - $this->notifyUser($event->user, new \App\Notifications\UserRegistered($event->user)); + $this->notifyUser($event->user, new Messages\UserRegistered($event->user)); } elseif ($event->user->state === UserState::REJECTED) { - $this->notifyUser($event->user, new \App\Notifications\UserRejected($event->user)); + $this->notifyUser($event->user, new UserRejected($event->user)); } } elseif ($event->old_state === UserState::ACTIVE) { Log::info('User state change from active to ??'); @@ -127,7 +149,7 @@ class NotificationEvents extends Listener public function onPirepAccepted(PirepAccepted $event): void { Log::info('NotificationEvents::onPirepAccepted: '.$event->pirep->id.' accepted'); - $this->notifyUser($event->pirep->user, new \App\Notifications\PirepAccepted($event->pirep)); + $this->notifyUser($event->pirep->user, new Messages\PirepAccepted($event->pirep)); } /** @@ -138,6 +160,17 @@ class NotificationEvents extends Listener public function onPirepRejected(PirepRejected $event): void { Log::info('NotificationEvents::onPirepRejected: '.$event->pirep->id.' rejected'); - $this->notifyUser($event->pirep->user, new \App\Notifications\PirepRejected($event->pirep)); + $this->notifyUser($event->pirep->user, new Messages\PirepRejected($event->pirep)); + } + + /** + * Notify all users of a news event + * + * @param \App\Events\NewsAdded $event + */ + public function onNewsAdded(NewsAdded $event): void + { + Log::info('NotificationEvents::onNewsAdded'); + $this->notifyAllUsers(new Messages\NewsAdded($event->news)); } } diff --git a/app/Notifications/Messages/AdminUserRegistered.php b/app/Notifications/Messages/AdminUserRegistered.php new file mode 100644 index 00000000..a007641b --- /dev/null +++ b/app/Notifications/Messages/AdminUserRegistered.php @@ -0,0 +1,38 @@ +user = $user; + $this->setMailable( + 'A new user registered', + 'notifications.mail.admin.user.registered', + ['user' => $user] + ); + } + + public function toArray($notifiable) + { + return [ + 'user_id' => $this->user->id, + ]; + } +} diff --git a/app/Notifications/Messages/NewsAdded.php b/app/Notifications/Messages/NewsAdded.php new file mode 100644 index 00000000..38ae343d --- /dev/null +++ b/app/Notifications/Messages/NewsAdded.php @@ -0,0 +1,40 @@ +news = $news; + $this->setMailable( + $news->subject, + 'notifications.mail.news', + ['news' => $news] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'news_id' => $this->news->id, + ]; + } +} diff --git a/app/Notifications/Messages/PirepAccepted.php b/app/Notifications/Messages/PirepAccepted.php new file mode 100644 index 00000000..70979621 --- /dev/null +++ b/app/Notifications/Messages/PirepAccepted.php @@ -0,0 +1,50 @@ +pirep = $pirep; + + $this->setMailable( + 'PIREP Accepted!', + 'notifications.mail.pirep.accepted', + ['pirep' => $this->pirep] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'pirep_id' => $this->pirep->id, + 'user_id' => $this->pirep->user_id, + ]; + } +} diff --git a/app/Notifications/Messages/PirepRejected.php b/app/Notifications/Messages/PirepRejected.php new file mode 100644 index 00000000..6c5ade9b --- /dev/null +++ b/app/Notifications/Messages/PirepRejected.php @@ -0,0 +1,47 @@ +pirep = $pirep; + + $this->setMailable( + 'PIREP Rejected!', + 'notifications.mail.pirep.rejected', + ['pirep' => $this->pirep] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'pirep_id' => $this->pirep->id, + 'user_id' => $this->pirep->user_id, + ]; + } +} diff --git a/app/Notifications/Messages/PirepSubmitted.php b/app/Notifications/Messages/PirepSubmitted.php new file mode 100644 index 00000000..bcceedff --- /dev/null +++ b/app/Notifications/Messages/PirepSubmitted.php @@ -0,0 +1,47 @@ +pirep = $pirep; + + $this->setMailable( + 'New PIREP Submitted', + 'notifications.mail.admin.pirep.submitted', + ['pirep' => $this->pirep] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'pirep_id' => $this->pirep->id, + 'user_id' => $this->pirep->user_id, + ]; + } +} diff --git a/app/Notifications/Messages/UserPending.php b/app/Notifications/Messages/UserPending.php new file mode 100644 index 00000000..000eb393 --- /dev/null +++ b/app/Notifications/Messages/UserPending.php @@ -0,0 +1,42 @@ +user = $user; + + $this->setMailable( + 'Your registration is pending', + 'notifications.mail.user.pending', + ['user' => $this->user] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'user_id' => $this->user->id, + ]; + } +} diff --git a/app/Notifications/Messages/UserRegistered.php b/app/Notifications/Messages/UserRegistered.php new file mode 100644 index 00000000..0c766a44 --- /dev/null +++ b/app/Notifications/Messages/UserRegistered.php @@ -0,0 +1,39 @@ +user = $user; + + $this->setMailable( + 'Welcome to '.config('app.name').'!', + 'notifications.mail.user.registered', + ['user' => $this->user] + ); + } + + public function toArray($notifiable) + { + return [ + 'user_id' => $this->user->id, + ]; + } +} diff --git a/app/Notifications/Messages/UserRejected.php b/app/Notifications/Messages/UserRejected.php new file mode 100644 index 00000000..8c4b8079 --- /dev/null +++ b/app/Notifications/Messages/UserRejected.php @@ -0,0 +1,44 @@ +user = $user; + + $this->setMailable( + 'Your registration has been denied', + 'notifications.mail.user.rejected', + ['user' => $this->user] + ); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * + * @return array + */ + public function toArray($notifiable) + { + return [ + 'user_id' => $this->user->id, + ]; + } +} diff --git a/app/Notifications/Backups.php b/app/Notifications/Notifiables/Backups.php similarity index 90% rename from app/Notifications/Backups.php rename to app/Notifications/Notifiables/Backups.php index f5f0668a..788ec97a 100644 --- a/app/Notifications/Backups.php +++ b/app/Notifications/Notifiables/Backups.php @@ -1,6 +1,6 @@ notify($eventclass); + */ +class Broadcast +{ + use Notifiable; + + /** + * Routing for Discord - the public channel ID that's used + */ + public function routeNotificationForDiscord() + { + return setting('notifications.discord_public_channel_id'); + } +} diff --git a/app/Notifications/PirepAccepted.php b/app/Notifications/PirepAccepted.php deleted file mode 100644 index 14479fb0..00000000 --- a/app/Notifications/PirepAccepted.php +++ /dev/null @@ -1,68 +0,0 @@ -pirep = $pirep; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('PIREP Accepted!') - ->markdown('mail.pirep.accepted', ['pirep' => $this->pirep]); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) - { - return [ - 'pirep_id' => $this->pirep->id, - 'user_id' => $this->pirep->user_id, - ]; - } -} diff --git a/app/Notifications/PirepRejected.php b/app/Notifications/PirepRejected.php deleted file mode 100644 index 6242f867..00000000 --- a/app/Notifications/PirepRejected.php +++ /dev/null @@ -1,68 +0,0 @@ -pirep = $pirep; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('PIREP Rejected!') - ->markdown('mail.pirep.rejected', ['pirep' => $this->pirep]); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) - { - return [ - 'pirep_id' => $this->pirep->id, - 'user_id' => $this->pirep->user_id, - ]; - } -} diff --git a/app/Notifications/PirepSubmitted.php b/app/Notifications/PirepSubmitted.php deleted file mode 100644 index 251000c8..00000000 --- a/app/Notifications/PirepSubmitted.php +++ /dev/null @@ -1,68 +0,0 @@ -pirep = $pirep; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('New PIREP Submitted') - ->markdown('mail.admin.pirep.submitted', ['pirep' => $this->pirep]); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) - { - return [ - 'pirep_id' => $this->pirep->id, - 'user_id' => $this->pirep->user_id, - ]; - } -} diff --git a/app/Notifications/UserPending.php b/app/Notifications/UserPending.php deleted file mode 100644 index 0d9e762b..00000000 --- a/app/Notifications/UserPending.php +++ /dev/null @@ -1,65 +0,0 @@ -user = $user; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('Your registration is pending') - ->markdown('mail.user.pending', ['user' => $this->user]); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) - { - return [ - 'user_id' => $this->user->id, - ]; - } -} diff --git a/app/Notifications/UserRegistered.php b/app/Notifications/UserRegistered.php deleted file mode 100644 index b32a9adf..00000000 --- a/app/Notifications/UserRegistered.php +++ /dev/null @@ -1,60 +0,0 @@ -user = $user; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('Welcome to '.config('app.name').'!') - ->markdown('mail.user.registered', ['user' => $this->user]); - } - - public function toArray($notifiable) - { - return [ - 'user_id' => $this->user->id, - ]; - } -} diff --git a/app/Notifications/UserRejected.php b/app/Notifications/UserRejected.php deleted file mode 100644 index 187144aa..00000000 --- a/app/Notifications/UserRejected.php +++ /dev/null @@ -1,65 +0,0 @@ -user = $user; - } - - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - * - * @param mixed $notifiable - * - * @return \Illuminate\Notifications\Messages\MailMessage - */ - public function toMail($notifiable) - { - return (new MailMessage()) - ->from(config('mail.from.address', 'no-reply@phpvms.net')) - ->subject('Your registration has been denied') - ->markdown('mail.user.rejected', ['user' => $this->user]); - } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * - * @return array - */ - public function toArray($notifiable) - { - return [ - 'user_id' => $this->user->id, - ]; - } -} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 08de6322..2605280a 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -25,9 +25,10 @@ use App\Models\Subfleet; use App\Models\User; use App\Repositories\SettingRepository; use App\Services\ModuleService; +use App\Support\Utils; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; -use View; class AppServiceProvider extends ServiceProvider { @@ -66,14 +67,20 @@ class AppServiceProvider extends ServiceProvider */ public function register(): void { - // Only dev environment stuff - if ($this->app->environment() === 'dev') { - // Only load the IDE helper if it's included. This lets use distribute the - // package without any dev dependencies + // Only load the IDE helper if it's included and enabled + if (config('app.debug') === true) { /* @noinspection NestedPositiveIfStatementsInspection */ + /* @noinspection PhpFullyQualifiedNameUsageInspection */ if (class_exists(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class)) { + /* @noinspection PhpFullyQualifiedNameUsageInspection */ $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); } + + if (config('app.debug_toolbar') === true) { + Utils::enableDebugToolbar(); + } else { + Utils::disableDebugToolbar(); + } } } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index f2758991..6accec41 100755 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -6,11 +6,11 @@ use App\Events\Expenses; use App\Events\PirepFiled; use App\Events\UserStatsChanged; use App\Listeners\AwardListener; -use App\Listeners\BidEvents; +use App\Listeners\BidEventHandler; use App\Listeners\ExpenseListener; -use App\Listeners\FinanceEvents; -use App\Listeners\NotificationEvents; -use App\Listeners\SetUserActive; +use App\Listeners\FinanceEventHandler; +use App\Listeners\UserStateListener; +use App\Notifications\EventHandler; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; @@ -23,7 +23,7 @@ class EventServiceProvider extends ServiceProvider ], PirepFiled::class => [ - SetUserActive::class, + UserStateListener::class, ], Registered::class => [ @@ -36,8 +36,8 @@ class EventServiceProvider extends ServiceProvider ]; protected $subscribe = [ - BidEvents::class, - FinanceEvents::class, - NotificationEvents::class, + BidEventHandler::class, + FinanceEventHandler::class, + EventHandler::class, ]; } diff --git a/app/Repositories/AirlineRepository.php b/app/Repositories/AirlineRepository.php index d4581871..896a8123 100644 --- a/app/Repositories/AirlineRepository.php +++ b/app/Repositories/AirlineRepository.php @@ -7,9 +7,6 @@ use App\Models\Airline; use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Traits\CacheableRepository; -/** - * Class AirlineRepository - */ class AirlineRepository extends Repository implements CacheableInterface { use CacheableRepository; diff --git a/app/Repositories/AirportRepository.php b/app/Repositories/AirportRepository.php index 4f7b3c47..22d6a364 100644 --- a/app/Repositories/AirportRepository.php +++ b/app/Repositories/AirportRepository.php @@ -7,9 +7,6 @@ use App\Models\Airport; use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Traits\CacheableRepository; -/** - * Class AirportRepository - */ class AirportRepository extends Repository implements CacheableInterface { use CacheableRepository; @@ -27,8 +24,8 @@ class AirportRepository extends Repository implements CacheableInterface /** * Return the list of airports formatted for a select box * - * @param mixed $add_blank - * @param mixed $only_hubs + * @param bool $add_blank + * @param bool $only_hubs * * @return array */ diff --git a/app/Repositories/Criteria/WhereCriteria.php b/app/Repositories/Criteria/WhereCriteria.php index 906b4f99..5c63a41f 100644 --- a/app/Repositories/Criteria/WhereCriteria.php +++ b/app/Repositories/Criteria/WhereCriteria.php @@ -4,6 +4,7 @@ namespace App\Repositories\Criteria; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Http\Request; use Prettus\Repository\Contracts\CriteriaInterface; use Prettus\Repository\Contracts\RepositoryInterface; @@ -17,17 +18,20 @@ class WhereCriteria implements CriteriaInterface */ protected $request; protected $where; + protected $relations; /** * Create a new Where search. * - * @param $request - * @param $where + * @param Request $request + * @param array $where + * @param array [$relations] Any whereHas (key = table name, value = array of criterea */ - public function __construct($request, $where) + public function __construct(Request $request, $where, $relations = []) { $this->request = $request; $this->where = $where; + $this->relations = $relations; } /** @@ -46,6 +50,17 @@ class WhereCriteria implements CriteriaInterface $model = $model->where($this->where); } + // See if any relationships need to be included in this WHERE + if ($this->relations) { + foreach ($this->relations as $relation => $criterea) { + $model = $model + ->with($relation) + ->whereHas($relation, function (Builder $query) use ($criterea) { + $query->where($criterea); + }); + } + } + return $model; } } diff --git a/app/Repositories/FlightRepository.php b/app/Repositories/FlightRepository.php index 0a5223ef..36a7f62b 100644 --- a/app/Repositories/FlightRepository.php +++ b/app/Repositories/FlightRepository.php @@ -74,6 +74,7 @@ class FlightRepository extends Repository implements CacheableInterface public function searchCriteria(Request $request, bool $only_active = true): self { $where = []; + $relations = []; if ($only_active === true) { $where['active'] = $only_active; @@ -81,40 +82,55 @@ class FlightRepository extends Repository implements CacheableInterface } if ($request->filled('flight_id')) { - $where['id'] = $request->flight_id; + $where['id'] = $request->input('flight_id'); } if ($request->filled('airline_id')) { - $where['airline_id'] = $request->airline_id; + $where['airline_id'] = $request->input('airline_id'); } if ($request->filled('flight_number')) { - $where['flight_number'] = $request->flight_number; + $where['flight_number'] = $request->input('flight_number'); } if ($request->filled('route_code')) { - $where['route_code'] = $request->route_code; + $where['route_code'] = $request->input('route_code'); + } + + if ($request->filled('dpt_airport_id')) { + $where['dpt_airport_id'] = strtoupper($request->input('dpt_airport_id')); } if ($request->filled('dep_icao')) { - $where['dpt_airport_id'] = $request->dep_icao; + $where['dpt_airport_id'] = strtoupper($request->input('dep_icao')); + } + + if ($request->filled('arr_airport_id')) { + $where['arr_airport_id'] = strtoupper($request->input('arr_airport_id')); } if ($request->filled('arr_icao')) { - $where['arr_airport_id'] = $request->arr_icao; + $where['arr_airport_id'] = strtoupper($request->input('arr_icao')); } // Distance, greater than if ($request->filled('dgt')) { - $where[] = ['distance', '>=', $request->dgt]; + $where[] = ['distance', '>=', $request->input('dgt')]; } // Distance, less than if ($request->filled('dlt')) { - $where[] = ['distance', '<=', $request->dlt]; + $where[] = ['distance', '<=', $request->input('dlt')]; } - $this->pushCriteria(new WhereCriteria($request, $where)); + // Do a special query for finding the child subfleets + if ($request->filled('subfleet_id')) { + $relations['subfleets'] = [ + 'subfleets.id' => $request->input('subfleet_id'), + ]; + } + + $this->pushCriteria(new WhereCriteria($request, $where, $relations)); return $this; } diff --git a/app/Repositories/SubfleetRepository.php b/app/Repositories/SubfleetRepository.php index 774e4a17..16a9d210 100644 --- a/app/Repositories/SubfleetRepository.php +++ b/app/Repositories/SubfleetRepository.php @@ -7,9 +7,6 @@ use App\Models\Subfleet; use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Traits\CacheableRepository; -/** - * Class SubfleetRepository - */ class SubfleetRepository extends Repository implements CacheableInterface { use CacheableRepository; @@ -26,4 +23,27 @@ class SubfleetRepository extends Repository implements CacheableInterface { return Subfleet::class; } + + /** + * Return the list of aircraft formatted for a select box + * + * @param bool $add_blank + * + * @return array + */ + public function selectBoxList($add_blank = false): array + { + $retval = []; + $items = $this->all(); + + if ($add_blank) { + $retval[''] = ''; + } + + foreach ($items as $i) { + $retval[$i->id] = $i->name; + } + + return $retval; + } } diff --git a/app/Services/AwardService.php b/app/Services/AwardService.php index 6fad9316..302fd9b4 100644 --- a/app/Services/AwardService.php +++ b/app/Services/AwardService.php @@ -4,6 +4,7 @@ namespace App\Services; use App\Contracts\Service; use App\Support\ClassLoader; +use function get_class; use Nwidart\Modules\Facades\Module; class AwardService extends Service @@ -18,9 +19,9 @@ class AwardService extends Service $awards = []; $formatted_awards = []; - // Find the awards in the app/Awards directory - $classes = ClassLoader::getClassesInPath(app_path('/Awards')); - $awards = array_merge($awards, $classes); + // Find the awards in the modules/Awards directory +// $classes = ClassLoader::getClassesInPath(module_path('Awards')); +// $awards = array_merge($awards, $classes); // Look throughout all the other modules, in the module/{MODULE}/Awards directory foreach (Module::all() as $module) { @@ -33,7 +34,7 @@ class AwardService extends Service } foreach ($awards as $award) { - $formatted_awards[\get_class($award)] = $award; + $formatted_awards[get_class($award)] = $award; } return $formatted_awards; diff --git a/app/Services/CronService.php b/app/Services/CronService.php index c6de36bf..fd1c98fd 100644 --- a/app/Services/CronService.php +++ b/app/Services/CronService.php @@ -8,6 +8,7 @@ use DateTime; use DateTimeZone; use Exception; use Illuminate\Support\Facades\Log; +use Symfony\Component\Process\PhpExecutableFinder; class CronService extends Service { @@ -26,22 +27,39 @@ class CronService extends Service */ public function getCronPath(): string { + $finder = new PhpExecutableFinder(); + $php_path = $finder->find(false); + $path = [ 'cd '.base_path(), '&&', - str_replace('-fpm', '', PHP_BINARY), + str_replace('-fpm', '', $php_path), 'artisan schedule:run', ]; return implode(' ', $path); } + /** + * Show an example cron command that runs every minute + * + * @return string + */ + public function getCronExecString(): string + { + return implode(' ', [ + '* * * * *', + $this->getCronPath(), + '>> /dev/null 2>&1', + ]); + } + /** * Update the last time the cron was run in the kvp repo */ public function updateLastRunTime() { - $dt = new DateTime('now', DateTimeZone::UTC); + $dt = new DateTime('now', new DateTimeZone('UTC')); $this->kvpRepo->save('cron_last_run', $dt->format(DateTime::ISO8601)); } @@ -60,7 +78,7 @@ class CronService extends Service try { $dt = DateTime::createFromFormat(DateTime::ISO8601, $last_run); - $dt_now = new DateTime('now', DateTimeZone::UTC); + $dt_now = new DateTime('now', new DateTimeZone('UTC')); } catch (Exception $e) { Log::error('Error checking for cron problem: '.$e->getMessage()); return true; diff --git a/app/Services/FareService.php b/app/Services/FareService.php index 00bbade7..34f28c54 100644 --- a/app/Services/FareService.php +++ b/app/Services/FareService.php @@ -34,7 +34,14 @@ class FareService extends Service $flight_fares = $this->getForFlight($flight); } + if (empty($subfleet)) { + return $flight_fares; + } + $subfleet_fares = $this->getForSubfleet($subfleet); + if (empty($subfleet_fares) || $subfleet_fares->count() === 0) { + return $flight_fares; + } // Go through all of the fares assigned by the subfleet // See if any of the same fares are assigned to the flight @@ -60,7 +67,7 @@ class FareService extends Service protected function getFares($fare) { if (filled($fare->pivot->price)) { - if (substr_count($fare->pivot->price, '%', -1)) { + if (strpos($fare->pivot->price, '%', -1) !== false) { $fare->price = Math::addPercent($fare->price, $fare->pivot->price); } else { $fare->price = $fare->pivot->price; @@ -68,7 +75,7 @@ class FareService extends Service } if (filled($fare->pivot->cost)) { - if (substr_count($fare->pivot->cost, '%', -1)) { + if (strpos($fare->pivot->cost, '%', -1) !== false) { $fare->cost = Math::addPercent($fare->cost, $fare->pivot->cost); } else { $fare->cost = $fare->pivot->cost; @@ -76,7 +83,7 @@ class FareService extends Service } if (filled($fare->pivot->capacity)) { - if (substr_count($fare->pivot->capacity, '%', -1)) { + if (strpos($fare->pivot->capacity, '%', -1) !== false) { $fare->capacity = Math::addPercent($fare->capacity, $fare->pivot->capacity); } else { $fare->capacity = $fare->pivot->capacity; diff --git a/app/Services/Finance/PirepFinanceService.php b/app/Services/Finance/PirepFinanceService.php index a34985d3..2cd99bbc 100644 --- a/app/Services/Finance/PirepFinanceService.php +++ b/app/Services/Finance/PirepFinanceService.php @@ -11,17 +11,16 @@ use App\Models\Pirep; use App\Repositories\ExpenseRepository; use App\Repositories\JournalRepository; use App\Services\FareService; +use App\Services\FinanceService; use App\Support\Math; use App\Support\Money; use Illuminate\Support\Facades\Log; -/** - * Class FinanceService - */ class PirepFinanceService extends Service { private $expenseRepo; private $fareSvc; + private $financeSvc; private $journalRepo; /** @@ -30,15 +29,18 @@ class PirepFinanceService extends Service * @param ExpenseRepository $expenseRepo * @param FareService $fareSvc * @param JournalRepository $journalRepo + * @param FinanceService $financeSvc */ public function __construct( ExpenseRepository $expenseRepo, FareService $fareSvc, + FinanceService $financeSvc, JournalRepository $journalRepo ) { $this->expenseRepo = $expenseRepo; $this->fareSvc = $fareSvc; $this->journalRepo = $journalRepo; + $this->financeSvc = $financeSvc; } /** @@ -149,13 +151,11 @@ class PirepFinanceService extends Service Log::info('Finance: Fuel cost, (fuel='.$fuel_used.', cost='.$ap->fuel_jeta_cost.') D=' .$debit->getAmount()); - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $pirep->airline->journal, - null, $debit, $pirep, 'Fuel Cost ('.$ap->fuel_jeta_cost.'/'.config('phpvms.internal_units.fuel').')', - null, 'Fuel', 'fuel' ); @@ -194,13 +194,11 @@ class PirepFinanceService extends Service $debit = Money::createFromAmount($cost_per_min * $block_time); Log::info('Finance: Subfleet Block Hourly, D='.$debit->getAmount()); - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $pirep->airline->journal, - null, $debit, $pirep, 'Subfleet '.$sf->type.': Block Time Cost', - null, 'Subfleet '.$sf->type, 'subfleet' ); @@ -265,13 +263,11 @@ class PirepFinanceService extends Service $journal = $pirep->user->journal; } - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $journal, - null, $debit, $pirep, $memo, - null, $transaction_group, strtolower($klass) ); @@ -320,13 +316,11 @@ class PirepFinanceService extends Service $debit = Money::createFromAmount($expense->amount); - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $pirep->airline->journal, - null, $debit, $pirep, 'Expense: '.$expense->name, - null, $expense->transaction_group ?? 'Expenses', 'expense' ); @@ -347,13 +341,12 @@ class PirepFinanceService extends Service { $ground_handling_cost = $this->getGroundHandlingCost($pirep); Log::info('Finance: PIREP: '.$pirep->id.'; ground handling: '.$ground_handling_cost); - $this->journalRepo->post( + + $this->financeSvc->debitFromJournal( $pirep->airline->journal, - null, Money::createFromAmount($ground_handling_cost), $pirep, 'Ground Handling', - null, 'Ground Handling', 'ground_handling' ); @@ -378,24 +371,20 @@ class PirepFinanceService extends Service Log::info('Finance: PIREP: '.$pirep->id .'; pilot pay: '.$pilot_pay_rate.', total: '.$pilot_pay); - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $pirep->airline->journal, - null, $pilot_pay, $pirep, $memo, - null, 'Pilot Pay', 'pilot_pay' ); - $this->journalRepo->post( + $this->financeSvc->creditToJournal( $pirep->user->journal, $pilot_pay, - null, $pirep, $memo, - null, 'Pilot Pay', 'pilot_pay' ); diff --git a/app/Services/Finance/RecurringFinanceService.php b/app/Services/Finance/RecurringFinanceService.php index ed5edf33..d5044f0a 100644 --- a/app/Services/Finance/RecurringFinanceService.php +++ b/app/Services/Finance/RecurringFinanceService.php @@ -8,23 +8,22 @@ use App\Models\Enums\ExpenseType; use App\Models\Expense; use App\Models\JournalTransaction; use App\Repositories\JournalRepository; +use App\Services\FinanceService; use App\Support\Money; -use Log; +use Carbon\Carbon; +use Illuminate\Support\Facades\Log; /** * Process all of the daily expenses and charge them */ class RecurringFinanceService extends Service { + private $financeSvc; private $journalRepo; - /** - * RecurringFinanceService constructor. - * - * @param JournalRepository $journalRepo - */ - public function __construct(JournalRepository $journalRepo) + public function __construct(JournalRepository $journalRepo, FinanceService $financeSvc) { + $this->financeSvc = $financeSvc; $this->journalRepo = $journalRepo; } @@ -87,10 +86,8 @@ class RecurringFinanceService extends Service /** * Run all of the daily expense/financials * - * @param int $type + * @param string $type * - * @throws \UnexpectedValueException - * @throws \InvalidArgumentException * @throws \Prettus\Validator\Exceptions\ValidatorException */ public function processExpenses($type = ExpenseType::DAILY): void @@ -101,7 +98,7 @@ class RecurringFinanceService extends Service if ($type === ExpenseType::DAILY) { $tag = 'expenses_daily'; } elseif ($type === ExpenseType::MONTHLY) { - $tag === 'expenses_monthly'; + $tag = 'expenses_monthly'; } /** @@ -122,7 +119,7 @@ class RecurringFinanceService extends Service ]; $found = JournalTransaction::where($w) - ->whereDate('post_date', '=', \Carbon::now('UTC')->toDateString()) + ->whereDate('post_date', '=', Carbon::now('UTC')->toDateString()) ->count(['id']); if ($found > 0) { @@ -132,13 +129,11 @@ class RecurringFinanceService extends Service [$memo, $ta_group] = $this->getMemoAndGroup($expense); - $this->journalRepo->post( + $this->financeSvc->debitFromJournal( $journal, - null, Money::createFromAmount($amount), $expense, $memo, - null, $ta_group, $tag ); diff --git a/app/Services/FinanceService.php b/app/Services/FinanceService.php index 4ad60c1a..13372431 100644 --- a/app/Services/FinanceService.php +++ b/app/Services/FinanceService.php @@ -4,11 +4,125 @@ namespace App\Services; use App\Contracts\Service; use App\Models\Airline; +use App\Models\Journal; use App\Models\JournalTransaction; +use App\Repositories\AirlineRepository; +use App\Repositories\JournalRepository; +use App\Support\Dates; use App\Support\Money; class FinanceService extends Service { + private $airlineRepo; + private $journalRepo; + + public function __construct( + AirlineRepository $airlineRepo, + JournalRepository $journalRepo + ) { + $this->airlineRepo = $airlineRepo; + $this->journalRepo = $journalRepo; + } + + /** + * Credit some amount to a given journal + * E.g, some amount for expenses or ground handling fees, etc. Example, to pay a user a dollar + * for a pirep: + * + * creditToJournal($user->journal, new Money(1000), $pirep, 'Payment', 'pirep', 'payment'); + * + * @param \App\Models\Journal $journal + * @param Money $amount + * @param \Illuminate\Database\Eloquent\Model $reference + * @param string $memo + * @param string $transaction_group + * @param string|array $tag + * + * @throws \Prettus\Validator\Exceptions\ValidatorException + * + * @return mixed + */ + public function creditToJournal( + Journal $journal, + Money $amount, + $reference, + $memo, + $transaction_group, + $tag + ) { + return $this->journalRepo->post( + $journal, + $amount, + null, + $reference, + $memo, + null, + $transaction_group, + $tag + ); + } + + /** + * Charge some expense for a given PIREP to the airline its file against + * E.g, some amount for expenses or ground handling fees, etc. + * + * @param \App\Models\Journal $journal + * @param Money $amount + * @param \Illuminate\Database\Eloquent\Model $reference + * @param string $memo + * @param string $transaction_group + * @param string|array $tag + * + * @throws \Prettus\Validator\Exceptions\ValidatorException + * + * @return mixed + */ + public function debitFromJournal( + Journal $journal, + Money $amount, + $reference, + $memo, + $transaction_group, + $tag + ) { + return $this->journalRepo->post( + $journal, + null, + $amount, + $reference, + $memo, + null, + $transaction_group, + $tag + ); + } + + /** + * Get all of the transactions for every airline in a given month + * + * @param string $month In Y-m format + * + * @return array + */ + public function getAllAirlineTransactionsBetween($month): array + { + $between = Dates::getMonthBoundary($month); + + $transaction_groups = []; + $airlines = $this->airlineRepo->orderBy('icao')->all(); + + // group by the airline + foreach ($airlines as $airline) { + $transaction_groups[] = $this->getAirlineTransactionsBetween( + $airline, + $between[0], + $between[1] + ); + } + + return $transaction_groups; + } + /** * Get all of the transactions for an airline between two given dates. Returns an array * with `credits`, `debits` and `transactions` fields, where transactions contains the diff --git a/app/Services/GeoService.php b/app/Services/GeoService.php index 41a43f95..b6a8c796 100644 --- a/app/Services/GeoService.php +++ b/app/Services/GeoService.php @@ -221,20 +221,12 @@ class GeoService extends Service ]); } - /* - * @var $point \App\Models\Acars - */ - /*foreach ($pirep->acars as $point) { - $route->addPoint($point->lat, $point->lon, [ - 'pirep_id' => $pirep->id, - 'alt' => $point->altitude, - ]); - }*/ - return [ + // If there is a position update from ACARS, show where it is + // Otherwise, just assume it's at the arrival airport currently 'position' => [ - 'lat' => $pirep->position->lat, - 'lon' => $pirep->position->lon, + 'lat' => optional($pirep->position)->lat ?? $pirep->arr_airport->lat, + 'lon' => optional($pirep->position)->lon ?? $pirep->arr_airport->lon, ], 'line' => $route->getLine(), 'points' => $route->getPoints(), @@ -299,17 +291,17 @@ class GeoService extends Service $route = new GeoJson(); //# Departure Airport - $route->addPoint($flight->dpt_airport->lat, $flight->dpt_airport->lon, [ - 'name' => $flight->dpt_airport->icao, - 'popup' => $flight->dpt_airport->full_name, + $route->addPoint(optional($flight->dpt_airport)->lat, optional($flight->dpt_airport)->lon, [ + 'name' => $flight->dpt_airport_id, + 'popup' => optional($flight->dpt_airport)->full_name ?? $flight->dpt_airport_id, 'icon' => 'airport', ]); if ($flight->route) { $all_route_points = $this->getCoordsFromRoute( - $flight->dpt_airport->icao, - $flight->arr_airport->icao, - [$flight->dpt_airport->lat, $flight->dpt_airport->lon], + $flight->dpt_airport_id, + $flight->arr_airport_id, + [optional($flight->dpt_airport)->lat, optional($flight->dpt_airport)->lon], $flight->route ); @@ -323,9 +315,9 @@ class GeoService extends Service } } - $route->addPoint($flight->arr_airport->lat, $flight->arr_airport->lon, [ - 'name' => $flight->arr_airport->icao, - 'popup' => $flight->arr_airport->full_name, + $route->addPoint(optional($flight->arr_airport)->lat, optional($flight->arr_airport)->lon, [ + 'name' => $flight->arr_airport_id, + 'popup' => optional($flight->arr_airport)->full_name ?? $flight->arr_airport_id, 'icon' => 'airport', ]); @@ -350,9 +342,9 @@ class GeoService extends Service /* * PLANNED ROUTE */ - $planned->addPoint($pirep->dpt_airport->lat, $pirep->dpt_airport->lon, [ - 'name' => $pirep->dpt_airport->icao, - 'popup' => $pirep->dpt_airport->full_name, + $planned->addPoint(optional($pirep->dpt_airport)->lat, optional($pirep->dpt_airport)->lon, [ + 'name' => $pirep->dpt_airport_id, + 'popup' => optional($pirep->dpt_airport)->full_name ?? $pirep->dpt_airport_id, ]); $planned_route = $this->acarsRepo->forPirep($pirep->id, AcarsType::ROUTE); @@ -363,9 +355,9 @@ class GeoService extends Service ]); } - $planned->addPoint($pirep->arr_airport->lat, $pirep->arr_airport->lon, [ - 'name' => $pirep->arr_airport->icao, - 'popup' => $pirep->arr_airport->full_name, + $planned->addPoint(optional($pirep->arr_airport)->lat, optional($pirep->arr_airport)->lon, [ + 'name' => $pirep->arr_airport_id, + 'popup' => optional($pirep->arr_airport)->full_name ?? $pirep->arr_airport_id, 'icon' => 'airport', ]); @@ -382,9 +374,8 @@ class GeoService extends Service } return [ - 'planned_rte_points' => $planned->getPoints(), - 'planned_rte_line' => $planned->getLine(), - + 'planned_rte_points' => $planned->getPoints(), + 'planned_rte_line' => $planned->getLine(), 'actual_route_points' => $actual->getPoints(), 'actual_route_line' => $actual->getLine(), ]; diff --git a/app/Services/ImportExport/AircraftImporter.php b/app/Services/ImportExport/AircraftImporter.php index f90e833c..d062483c 100644 --- a/app/Services/ImportExport/AircraftImporter.php +++ b/app/Services/ImportExport/AircraftImporter.php @@ -4,6 +4,7 @@ namespace App\Services\ImportExport; use App\Contracts\ImportExport; use App\Models\Aircraft; +use App\Models\Airline; use App\Models\Enums\AircraftState; use App\Models\Enums\AircraftStatus; use App\Models\Subfleet; @@ -32,7 +33,8 @@ class AircraftImporter extends ImportExport ]; /** - * Find the subfleet specified, or just create it on the fly + * Find the subfleet specified, or just create it on the fly and attach it to the + * first airline that's been found * * @param $type * @@ -40,11 +42,12 @@ class AircraftImporter extends ImportExport */ protected function getSubfleet($type) { - $subfleet = Subfleet::firstOrCreate([ + return Subfleet::firstOrCreate([ 'type' => $type, - ], ['name' => $type]); - - return $subfleet; + ], [ + 'name' => $type, + 'airline_id' => Airline::where('active', true)->first()->id, + ]); } /** @@ -69,7 +72,7 @@ class AircraftImporter extends ImportExport // Set a default status $row['status'] = trim($row['status']); - if ($row['status'] === null || $row['status'] === '') { + if (empty($row['status'])) { $row['status'] = AircraftStatus::ACTIVE; } @@ -77,12 +80,10 @@ class AircraftImporter extends ImportExport $row['state'] = AircraftState::PARKED; // Try to add or update - $aircraft = Aircraft::firstOrNew([ - 'registration' => $row['registration'], - ], $row); - try { - $aircraft->save(); + Aircraft::updateOrCreate([ + 'registration' => $row['registration'], + ], $row); } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; diff --git a/app/Services/ImportExport/AirportImporter.php b/app/Services/ImportExport/AirportImporter.php index 8af821ad..7fbefe6a 100644 --- a/app/Services/ImportExport/AirportImporter.php +++ b/app/Services/ImportExport/AirportImporter.php @@ -45,12 +45,10 @@ class AirportImporter extends ImportExport $row['id'] = $row['icao']; $row['hub'] = get_truth_state($row['hub']); - $airport = Airport::firstOrNew([ - 'id' => $row['icao'], - ], $row); - try { - $airport->save(); + $airport = Airport::updateOrCreate([ + 'id' => $row['icao'], + ], $row); } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; diff --git a/app/Services/ImportExport/ExpenseImporter.php b/app/Services/ImportExport/ExpenseImporter.php index 84d59ee9..ef619fea 100644 --- a/app/Services/ImportExport/ExpenseImporter.php +++ b/app/Services/ImportExport/ExpenseImporter.php @@ -7,7 +7,7 @@ use App\Models\Aircraft; use App\Models\Airport; use App\Models\Expense; use App\Models\Subfleet; -use Log; +use Illuminate\Support\Facades\Log; /** * Import expenses @@ -53,12 +53,10 @@ class ExpenseImporter extends ImportExport $row['active'] = true; } - $expense = Expense::firstOrNew([ - 'name' => $row['name'], - ], $row); - try { - $expense->save(); + $expense = Expense::updateOrCreate([ + 'name' => $row['name'], + ], $row); } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; diff --git a/app/Services/ImportExport/FareImporter.php b/app/Services/ImportExport/FareImporter.php index 32a25c65..d0ae46a2 100644 --- a/app/Services/ImportExport/FareImporter.php +++ b/app/Services/ImportExport/FareImporter.php @@ -36,13 +36,11 @@ class FareImporter extends ImportExport */ public function import(array $row, $index): bool { - // Try to add or update - $fare = Fare::firstOrNew([ - 'code' => $row['code'], - ], $row); - try { - $fare->save(); + // Try to add or update + $fare = Fare::updateOrCreate([ + 'code' => $row['code'], + ], $row); } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; diff --git a/app/Services/ImportExport/FlightImporter.php b/app/Services/ImportExport/FlightImporter.php index 6984101f..e9813748 100644 --- a/app/Services/ImportExport/FlightImporter.php +++ b/app/Services/ImportExport/FlightImporter.php @@ -3,7 +3,6 @@ namespace App\Services\ImportExport; use App\Contracts\ImportExport; -use App\Models\Airport; use App\Models\Enums\Days; use App\Models\Enums\FlightType; use App\Models\Fare; @@ -37,7 +36,7 @@ class FlightImporter extends ImportExport 'dpt_time' => 'nullable', 'arr_time' => 'nullable', 'level' => 'nullable|integer', - 'distance' => 'required|numeric', + 'distance' => 'nullable|numeric', 'flight_time' => 'required|integer', 'flight_type' => 'required|alpha', 'route' => 'nullable', @@ -112,7 +111,7 @@ class FlightImporter extends ImportExport // Check for a valid value $flight_type = $row['flight_type']; if (!array_key_exists($flight_type, FlightType::labels())) { - $flight_type = 'J'; + $flight_type = FlightType::SCHED_PAX; } $flight->setAttribute('flight_type', $flight_type); @@ -132,6 +131,14 @@ class FlightImporter extends ImportExport $this->processAirport($row['alt_airport']); } + // Check/calculate the distance + if (empty($row['distance'])) { + $row['distance'] = $this->airportSvc->calculateDistance( + $row['dpt_airport'], + $row['arr_airport'] + ); + } + $this->processSubfleets($flight, $row['subfleets']); $this->processFares($flight, $row['fares']); $this->processFields($flight, $row['fields']); @@ -209,7 +216,7 @@ class FlightImporter extends ImportExport $count = 0; $subfleets = $this->parseMultiColumnValues($col); foreach ($subfleets as $subfleet_type) { - $subfleet = Subfleet::firstOrCreate( + $subfleet = Subfleet::updateOrCreate( ['type' => $subfleet_type], ['name' => $subfleet_type] ); @@ -239,7 +246,7 @@ class FlightImporter extends ImportExport $fare_attributes = []; } - $fare = Fare::firstOrCreate(['code' => $fare_code], ['name' => $fare_code]); + $fare = Fare::updateOrCreate(['code' => $fare_code], ['name' => $fare_code]); $this->fareSvc->setForFlight($flight, $fare, $fare_attributes); } } diff --git a/app/Services/ImportExport/SubfleetImporter.php b/app/Services/ImportExport/SubfleetImporter.php index 2449fc4c..77d53f3d 100644 --- a/app/Services/ImportExport/SubfleetImporter.php +++ b/app/Services/ImportExport/SubfleetImporter.php @@ -48,12 +48,10 @@ class SubfleetImporter extends ImportExport $airline = $this->getAirline($row['airline']); $row['airline_id'] = $airline->id; - $subfleet = Subfleet::firstOrNew([ - 'type' => $row['type'], - ], $row); - try { - $subfleet->save(); + $subfleet = Subfleet::updateOrCreate([ + 'type' => $row['type'], + ], $row); } catch (\Exception $e) { $this->errorLog('Error in row '.$index.': '.$e->getMessage()); return false; @@ -80,7 +78,7 @@ class SubfleetImporter extends ImportExport $fare_attributes = []; } - $fare = Fare::firstOrCreate(['code' => $fare_code], ['name' => $fare_code]); + $fare = Fare::updateOrCreate(['code' => $fare_code], ['name' => $fare_code]); $this->fareSvc->setForSubfleet($subfleet, $fare, $fare_attributes); } } diff --git a/modules/Installer/Services/DatabaseService.php b/app/Services/Installer/DatabaseService.php similarity index 69% rename from modules/Installer/Services/DatabaseService.php rename to app/Services/Installer/DatabaseService.php index 64cd4915..57ddabfa 100644 --- a/modules/Installer/Services/DatabaseService.php +++ b/app/Services/Installer/DatabaseService.php @@ -1,9 +1,10 @@ @'.$host.':'.$port.';'.$name); - if ($driver === 'mysql') { - $dsn = "mysql:host=$host;port=$port;dbname=$name"; - Log::info('Connection string: '.$dsn); - - try { - $conn = new PDO($dsn, $user, $pass); - } catch (\PDOException $e) { - throw $e; - } - } - // TODO: Needs testing - elseif ($driver === 'postgres') { + if ($driver === 'postgres') { $dsn = "pgsql:host=$host;port=$port;dbname=$name"; try { @@ -44,8 +34,19 @@ class DatabaseService extends Service } catch (\PDOException $e) { throw $e; } + + return true; } + // Default MySQL + $dsn = "mysql:host=$host;port=$port;dbname=$name"; + Log::info('Connection string: '.$dsn); + + try { + $conn = new PDO($dsn, $user, $pass); + } catch (\PDOException $e) { + throw $e; + } return true; } @@ -59,8 +60,8 @@ class DatabaseService extends Service $output = ''; if (config('database.default') === 'sqlite') { - \Artisan::call('database:create'); - $output .= \Artisan::output(); + Artisan::call('database:create'); + $output .= Artisan::output(); } return trim($output); diff --git a/app/Services/Installer/InstallerService.php b/app/Services/Installer/InstallerService.php index 9cfdca31..dde48a75 100644 --- a/app/Services/Installer/InstallerService.php +++ b/app/Services/Installer/InstallerService.php @@ -3,6 +3,8 @@ namespace App\Services\Installer; use App\Contracts\Service; +use Illuminate\Support\Facades\Artisan; +use Nwidart\Modules\Facades\Module; class InstallerService extends Service { @@ -36,4 +38,33 @@ class InstallerService extends Service return false; } + + /** + * Clear whatever caches we can by calling Artisan + */ + public function clearCaches(): void + { + $commands = [ + 'clear-compiled', + 'cache:clear', + 'route:clear', + 'view:clear', + ]; + + foreach ($commands as $cmd) { + Artisan::call($cmd); + } + } + + /** + * Disable the installer and importer modules + */ + public function disableInstallerModules() + { + $module = Module::find('installer'); + $module->disable(); + + $module = Module::find('importer'); + $module->disable(); + } } diff --git a/app/Services/Installer/LoggerTrait.php b/app/Services/Installer/LoggerTrait.php new file mode 100644 index 00000000..872827ef --- /dev/null +++ b/app/Services/Installer/LoggerTrait.php @@ -0,0 +1,23 @@ +get(); $data = file_get_contents(database_path('/seeds/settings.yml')); $yml = Yaml::parse($data); @@ -228,7 +229,7 @@ class SeederService extends Service } $id = Setting::formatKey($setting['key']); - $row = DB::table('settings')->where('id', $id)->first(); + $row = $all_settings->firstWhere('id', $id); // Doesn't exist in the table, quit early and say there is stuff pending if (!$row) { @@ -236,6 +237,15 @@ class SeederService extends Service return true; } + // See if any of these column values have changed + foreach (['name', 'description'] as $column) { + $currVal = $row->{$column}; + $newVal = $setting[$column]; + if ($currVal !== $newVal) { + return true; + } + } + // See if any of the options have changed if ($row->type === 'select') { if ($row->options !== $setting['options']) { @@ -255,14 +265,23 @@ class SeederService extends Service */ private function permissionsSeedsPending(): bool { + $all_permissions = DB::table('permissions')->get(); + $data = file_get_contents(database_path('/seeds/permissions.yml')); $yml = Yaml::parse($data); foreach ($yml as $perm) { - $count = DB::table('permissions')->where('name', $perm['name'])->count('name'); - if ($count === 0) { + $row = $all_permissions->firstWhere('name', $perm['name']); + if (!$row) { return true; } + + // See if any of these column values have changed + foreach (['display_name', 'description'] as $column) { + if ($row->{$column} !== $perm[$column]) { + return true; + } + } } return false; diff --git a/app/Services/NewsService.php b/app/Services/NewsService.php new file mode 100644 index 00000000..17dd79e3 --- /dev/null +++ b/app/Services/NewsService.php @@ -0,0 +1,44 @@ +newsRepo = $newsRepo; + } + + /** + * Add a news item + * + * @param array $attrs + * + * @throws \Prettus\Validator\Exceptions\ValidatorException + * + * @return mixed + */ + public function addNews(array $attrs) + { + $news = $this->newsRepo->create($attrs); + event(new NewsAdded($news)); + + return $news; + } + + /** + * Delete something from the news items + * + * @param int $id ID of the news row to delete + */ + public function deleteNews($id) + { + $this->newsRepo->delete($id); + } +} diff --git a/app/Services/PirepService.php b/app/Services/PirepService.php index 0602087c..7684738b 100644 --- a/app/Services/PirepService.php +++ b/app/Services/PirepService.php @@ -269,10 +269,10 @@ class PirepService extends Service foreach ($field_values as $fv) { PirepFieldValue::updateOrCreate( ['pirep_id' => $pirep_id, - 'name' => $fv['name'], + 'name' => $fv['name'], ], - ['value' => $fv['value'], - 'source' => $fv['source'], + ['value' => $fv['value'], + 'source' => $fv['source'], ] ); } diff --git a/app/Services/RoleService.php b/app/Services/RoleService.php new file mode 100644 index 00000000..1b6c0058 --- /dev/null +++ b/app/Services/RoleService.php @@ -0,0 +1,47 @@ +roleRepo = $roleRepo; + } + + /** + * Update a role with the given attributes + * + * @param Role $role + * @param array $attrs + * + * @return Role + */ + public function updateRole(Role $role, array $attrs) + { + $role->update($attrs); + $role->save(); + + return $role; + } + + /** + * @param Role $role + * @param array $permissions + */ + public function setPermissionsForRole(Role $role, array $permissions) + { + // Update the permissions, filter out null/invalid values + $perms = collect($permissions)->filter(static function ($v, $k) { + return $v; + }); + + $role->permissions()->sync($perms); + } +} diff --git a/app/Services/UserService.php b/app/Services/UserService.php index bc233a7a..9d46c1ac 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -48,14 +48,14 @@ class UserService extends Service * Register a pilot. Also attaches the initial roles * required, and then triggers the UserRegistered event * - * @param User $user User model - * @param array $groups Additional groups to assign + * @param User $user User model + * @param array $roles List of "display_name" of groups to assign * * @throws \Exception * * @return mixed */ - public function createUser(User $user, array $groups = null) + public function createUser(User $user, array $roles = null) { // Determine if we want to auto accept if (setting('pilots.auto_accept') === true) { @@ -66,15 +66,10 @@ class UserService extends Service $user->save(); - // Attach the user roles - // $role = Role::where('name', 'user')->first(); - // $user->attachRole($role); - // Attach any additional roles - if (!empty($groups) && is_array($groups)) { - foreach ($groups as $group) { - $role = Role::where('name', $group)->first(); - $user->attachRole($role); + if (!empty($roles) && is_array($roles)) { + foreach ($roles as $role) { + $this->addUserToRole($user, $role); } } @@ -87,6 +82,32 @@ class UserService extends Service return $user; } + /** + * Add a user to a given role + * + * @param User $user + * @param string $roleName + * + * @return User + */ + public function addUserToRole(User $user, $roleName): User + { + $role = Role::where(['name' => $roleName])->first(); + $user->attachRole($role); + + return $user; + } + + /** + * Find and return the next available pilot ID (usually just the max+1) + * + * @return int + */ + public function getNextAvailablePilotId(): int + { + return (int) User::max('pilot_id') + 1; + } + /** * Find the next available pilot ID and set the current user's pilot_id to that +1 * Called from UserObserver right now after a record is created @@ -101,8 +122,7 @@ class UserService extends Service return $user; } - $max = (int) User::max('pilot_id'); - $user->pilot_id = $max + 1; + $user->pilot_id = $this->getNextAvailablePilotId(); $user->save(); Log::info('Set pilot ID for user '.$user->id.' to '.$user->pilot_id); @@ -348,8 +368,8 @@ class UserService extends Service 'state' => PirepState::ACCEPTED, ]; - $flight_count = Pirep::where($w)->count(); - $user->flights = $flight_count; + $pirep_count = Pirep::where($w)->count(); + $user->flights = $pirep_count; $flight_time = Pirep::where($w)->sum('flight_time'); $user->flight_time = $flight_time; @@ -359,7 +379,7 @@ class UserService extends Service // Recalc the rank $this->calculatePilotRank($user); - Log::info('User '.$user->ident.' updated; flight count='.$flight_count + Log::info('User '.$user->ident.' updated; pirep count='.$pirep_count .', rank='.$user->rank->name .', flight_time='.$user->flight_time.' minutes'); diff --git a/app/Services/VersionService.php b/app/Services/VersionService.php index c1789e49..26b39721 100644 --- a/app/Services/VersionService.php +++ b/app/Services/VersionService.php @@ -153,6 +153,12 @@ class VersionService extends Service $c = $cfg['current']; $version = "{$c['major']}.{$c['minor']}.{$c['patch']}"; + if ($c['prerelease'] !== '') { + $version .= "-{$c['prerelease']}"; + if ($c['buildmetadata'] !== '') { + $version .= ".{$c['buildmetadata']}"; + } + } if ($include_build) { // Get the current build id @@ -179,6 +185,8 @@ class VersionService extends Service $current_version = $this->cleanVersionString($current_version); } + // Replace "dev" with "alpha", since + $latest_version = $this->getLatestVersion(); // Convert to semver diff --git a/app/Support/Metar.php b/app/Support/Metar.php index c995eec0..21cfa874 100644 --- a/app/Support/Metar.php +++ b/app/Support/Metar.php @@ -520,13 +520,16 @@ class Metar implements \ArrayAccess } } } + // Finally determine if it's VFR or IFR conditions // https://www.aviationweather.gov/cva/help + $this->result['category'] = 'VFR'; + if (array_key_exists('cavok', $this->result) && $this->result['cavok']) { $this->result['category'] = 'VFR'; } else { /* @noinspection NestedPositiveIfStatementsInspection */ - if (array_key_exists('cloud_height', $this->result) && array_key_exists('visibility', $this->result)) { + if (array_key_exists('cloud_height', $this->result) && $this->result['cloud_height'] !== null) { if ($this->result['cloud_height']['ft'] > 3000 && $this->result['visibility']['nmi'] > 5) { $this->result['category'] = 'VFR'; } else { @@ -902,7 +905,7 @@ class Metar implements \ArrayAccess } $this->set_result_value('visibility', $visibility); - $this->set_result_value('visibility_report', $prefix.$visibility.$unit); + $this->set_result_value('visibility_report', $prefix.$visibility['m'].$unit); } return true; @@ -1086,7 +1089,7 @@ class Metar implements \ArrayAccess $observed['height'] = $this->createAltitude($found[5] * 100, 'feet'); // Cloud height - if (null === $this->result['cloud_height']['m'] || $observed['height']['m'] < $this->result['cloud_height']['m']) { + if (null === $this->result['cloud_height'] || $observed['height']['m'] < $this->result['cloud_height']['m']) { $this->set_result_value('cloud_height', $observed['height']); } diff --git a/app/Support/Units/Distance.php b/app/Support/Units/Distance.php index 4e7c4b83..8887be2b 100644 --- a/app/Support/Units/Distance.php +++ b/app/Support/Units/Distance.php @@ -8,6 +8,7 @@ use PhpUnitsOfMeasure\PhysicalQuantity\Length; class Distance extends Unit { public $responseUnits = [ + 'm', 'km', 'mi', 'nmi', diff --git a/app/Support/Utils.php b/app/Support/Utils.php new file mode 100644 index 00000000..6889e2bb --- /dev/null +++ b/app/Support/Utils.php @@ -0,0 +1,76 @@ +enable(); + } catch (BindingResolutionException $e) { + } + } + + /** + * Disable the debug toolbar + */ + public static function disableDebugToolbar() + { + try { + app('debugbar')->disable(); + } catch (BindingResolutionException $e) { + } + } + + /** + * Is the installer enabled? + * + * @return bool + */ + public static function installerEnabled() + { + /** @var \Nwidart\Modules\Module $installer */ + $installer = Module::find('installer'); + if (!$installer) { + return false; + } + + return $installer->isEnabled(); + } + + /** + * Get the domain from a URL + * + * @param string $url + * + * @return string + */ + public static function getRootDomain(string $url): string + { + if (!Str::contains($url, ['https://', 'http://'])) { + $url = 'http://'.$url; + } + + $domain = parse_url($url, PHP_URL_HOST); + $domain = explode('.', $domain); + $len = count($domain); + if ($len == 1) { + return $domain[0]; + } + + $domain = $domain[$len - 2].'.'.$domain[$len - 1]; + + return $domain; + } +} diff --git a/app/helpers.php b/app/helpers.php index 39e03138..379fcc37 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -4,6 +4,18 @@ use App\Exceptions\SettingNotFound; use Carbon\Carbon; use Illuminate\Contracts\View\Factory; +/* + * array_key_first only exists in PHP 7.3+ + */ +if (!function_exists('array_key_first')) { + function array_key_first(array $arr) + { + foreach ($arr as $key => $unused) { + return $key; + } + } +} + if (!function_exists('in_mask')) { /** * Return true/false if a value exists in a mask @@ -139,6 +151,8 @@ if (!function_exists('setting')) { * @param $key * @param mixed $default * + * @throws \Exception + * * @return mixed|null */ function setting($key, $default = null) @@ -149,6 +163,8 @@ if (!function_exists('setting')) { $value = $settingRepo->retrieve($key); } catch (SettingNotFound $e) { return $default; + } catch (Exception $e) { + return $default; } return $value; @@ -198,6 +214,21 @@ if (!function_exists('public_mix')) { } } +/** + * Wrap a call to url() and append the public folder before it + */ +if (!function_exists('public_url')) { + function public_url($path, array $parameters = []) + { + $publicBaseUrl = app()->publicUrlPath(); + $path = $publicBaseUrl.$path; + + $path = str_replace('//', '/', $path); + + return url($path, $parameters); + } +} + /* * Show a date/time in the proper timezone for a user */ diff --git a/composer.json b/composer.json index 9e77c32c..54b37336 100755 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "markrogoyski/math-php": "^0.38.0", "myclabs/deep-copy": "~1.9.0", "nabeel/vacentral": "~2.0", - "nwidart/laravel-modules": "~5.1", + "nwidart/laravel-modules": "^6.0", "php-units-of-measure/php-units-of-measure": "~2.1.0", "pragmarx/version": "0.2.*", "prettus/l5-repository": "~2.6.0", @@ -53,11 +53,11 @@ }, "require-dev": { "barryvdh/laravel-debugbar": "^3.0", - "barryvdh/laravel-ide-helper": "^2.0", + "barryvdh/laravel-ide-helper": "^2.6", "bpocallaghan/generators": "5.0.1", "codedungeon/phpunit-result-printer": "^0.13.0", "filp/whoops": "~2.0", - "fzaninotto/faker": "~1.8.0", + "fzaninotto/faker": "~1.9.0", "friendsofphp/php-cs-fixer": "^2.15", "mockery/mockery": "0.9.*", "nunomaduro/collision": "^3.0", diff --git a/composer.lock b/composer.lock index 8ca95243..93751f4d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "646a110be5a7dc5a530dd8f6f634a5de", + "content-hash": "7ab7801c9f860a11cf2eca809a84de43", "packages": [ { "name": "akaunting/money", - "version": "1.0.13", + "version": "1.0.14", "source": { "type": "git", "url": "https://github.com/akaunting/money.git", - "reference": "da302568d31122b200cbd215622cb0ae47131524" + "reference": "058b2256344ca5cb17aa1fecb574f5264a2444ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/akaunting/money/zipball/da302568d31122b200cbd215622cb0ae47131524", - "reference": "da302568d31122b200cbd215622cb0ae47131524", + "url": "https://api.github.com/repos/akaunting/money/zipball/058b2256344ca5cb17aa1fecb574f5264a2444ef", + "reference": "058b2256344ca5cb17aa1fecb574f5264a2444ef", "shasum": "" }, "require": { @@ -65,7 +65,7 @@ "laravel", "money" ], - "time": "2019-09-21T16:15:52+00:00" + "time": "2019-12-26T08:11:31+00:00" }, { "name": "anhskohbo/no-captcha", @@ -129,16 +129,16 @@ }, { "name": "appstract/laravel-opcache", - "version": "2.0.3", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/appstract/laravel-opcache.git", - "reference": "899ed38246f25da38b40a2eabaa6c9aa41903023" + "reference": "e512260bfd0eced3f533770b0a3b960f123d3172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appstract/laravel-opcache/zipball/899ed38246f25da38b40a2eabaa6c9aa41903023", - "reference": "899ed38246f25da38b40a2eabaa6c9aa41903023", + "url": "https://api.github.com/repos/appstract/laravel-opcache/zipball/e512260bfd0eced3f533770b0a3b960f123d3172", + "reference": "e512260bfd0eced3f533770b0a3b960f123d3172", "shasum": "" }, "require": { @@ -186,7 +186,7 @@ "laravel", "php" ], - "time": "2019-06-17T19:35:57+00:00" + "time": "2019-12-31T20:08:45+00:00" }, { "name": "appstract/lush-http", @@ -558,16 +558,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.4", + "version": "1.2.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" + "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/47fe531de31fca4a1b997f87308e7d7804348f7e", + "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e", "shasum": "" }, "require": { @@ -578,7 +578,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { @@ -610,7 +610,7 @@ "ssl", "tls" ], - "time": "2019-08-30T08:44:50+00:00" + "time": "2020-01-13T10:02:55+00:00" }, { "name": "composer/composer", @@ -694,24 +694,23 @@ }, { "name": "composer/semver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { @@ -752,7 +751,7 @@ "validation", "versioning" ], - "time": "2019-03-19T17:25:45+00:00" + "time": "2020-01-13T12:06:48+00:00" }, { "name": "composer/spdx-licenses", @@ -816,24 +815,24 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.3", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "reference": "cbe23383749496fe0f373345208b79568e4bc248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", + "reference": "cbe23383749496fe0f373345208b79568e4bc248", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0", + "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" }, "type": "library", "autoload": { @@ -851,25 +850,25 @@ "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Restarts a process without xdebug.", + "description": "Restarts a process without Xdebug.", "keywords": [ "Xdebug", "performance" ], - "time": "2019-05-27T17:52:04+00:00" + "time": "2019-11-06T16:40:04+00:00" }, { "name": "doctrine/cache", - "version": "v1.8.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "d4374ae95b36062d02ef310100ed33d78738d76c" + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/d4374ae95b36062d02ef310100ed33d78738d76c", - "reference": "d4374ae95b36062d02ef310100ed33d78738d76c", + "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", "shasum": "" }, "require": { @@ -880,7 +879,7 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^6.0", "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^7.0", "predis/predis": "~1.0" @@ -891,7 +890,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -925,26 +924,33 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "https://www.doctrine-project.org", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", "keywords": [ + "abstraction", + "apcu", "cache", - "caching" + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" ], - "time": "2019-10-28T09:31:32+00:00" + "time": "2019-11-29T15:36:20+00:00" }, { "name": "doctrine/dbal", - "version": "v2.9.2", + "version": "v2.9.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9" + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9", - "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/7345cd59edfa2036eb0fa4264b77ae2576842035", + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035", "shasum": "" }, "require": { @@ -984,6 +990,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -992,10 +1002,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -1013,20 +1019,20 @@ "php", "queryobject" ], - "time": "2018-12-31T03:27:51+00:00" + "time": "2019-11-02T22:19:34+00:00" }, { "name": "doctrine/event-manager", - "version": "v1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3" + "reference": "629572819973f13486371cb611386eb17851e85c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/a520bc093a0170feeb6b14e9d83f3a14452e64b3", - "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/629572819973f13486371cb611386eb17851e85c", + "reference": "629572819973f13486371cb611386eb17851e85c", "shasum": "" }, "require": { @@ -1036,7 +1042,7 @@ "doctrine/common": "<2.9@dev" }, "require-dev": { - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^6.0", "phpunit/phpunit": "^7.0" }, "type": "library", @@ -1055,6 +1061,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -1063,10 +1073,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -1080,27 +1086,29 @@ "email": "ocramius@gmail.com" } ], - "description": "Doctrine Event Manager component", + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", "homepage": "https://www.doctrine-project.org/projects/event-manager.html", "keywords": [ "event", - "eventdispatcher", - "eventmanager" + "event dispatcher", + "event manager", + "event system", + "events" ], - "time": "2018-06-11T11:59:03+00:00" + "time": "2019-11-10T09:48:07+00:00" }, { "name": "doctrine/inflector", - "version": "v1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a" + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", "shasum": "" }, "require": { @@ -1120,11 +1128,15 @@ "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } }, - "notification-url": "http://packagist.org/downloads/", + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -1133,10 +1145,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -1154,20 +1162,20 @@ "singularize", "string" ], - "time": "2018-01-09T20:05:19+00:00" + "time": "2019-10-30T19:59:35+00:00" }, { "name": "doctrine/lexer", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { @@ -1181,7 +1189,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1216,7 +1224,7 @@ "parser", "php" ], - "time": "2019-07-30T19:33:28+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "dragonmantank/cron-expression", @@ -1274,27 +1282,27 @@ }, { "name": "egulias/email-validator", - "version": "2.1.11", + "version": "2.1.15", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23" + "reference": "e834eea5306d85d67de5a05db5882911d5b29357" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/92dd169c32f6f55ba570c309d83f5209cefb5e23", - "reference": "92dd169c32f6f55ba570c309d83f5209cefb5e23", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e834eea5306d85d67de5a05db5882911d5b29357", + "reference": "e834eea5306d85d67de5a05db5882911d5b29357", "shasum": "" }, "require": { "doctrine/lexer": "^1.0.1", - "php": ">= 5.5" + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { - "dominicsayers/isemail": "dev-master", - "phpunit/phpunit": "^4.8.35||^5.7||^6.0", - "satooshi/php-coveralls": "^1.0.1", - "symfony/phpunit-bridge": "^4.4@dev" + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -1328,7 +1336,7 @@ "validation", "validator" ], - "time": "2019-08-13T17:33:27+00:00" + "time": "2020-01-20T21:40:59+00:00" }, { "name": "elcobvg/laravel-opcache", @@ -1387,64 +1395,18 @@ ], "time": "2018-10-08T04:02:08+00:00" }, - { - "name": "erusev/parsedown", - "version": "1.7.3", - "source": { - "type": "git", - "url": "https://github.com/erusev/parsedown.git", - "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/6d893938171a817f4e9bc9e86f2da1e370b7bcd7", - "reference": "6d893938171a817f4e9bc9e86f2da1e370b7bcd7", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35" - }, - "type": "library", - "autoload": { - "psr-0": { - "Parsedown": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Emanuil Rusev", - "email": "hello@erusev.com", - "homepage": "http://erusev.com" - } - ], - "description": "Parser for Markdown.", - "homepage": "http://parsedown.org", - "keywords": [ - "markdown", - "parser" - ], - "time": "2019-03-17T18:48:37+00:00" - }, { "name": "facade/flare-client-php", - "version": "1.1.1", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "608c2be3157b09f1868ca97ea4ddf3434ee83d63" + "reference": "24444ea0e1556f0a4b5fc8e61802caf72ae9a408" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/608c2be3157b09f1868ca97ea4ddf3434ee83d63", - "reference": "608c2be3157b09f1868ca97ea4ddf3434ee83d63", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/24444ea0e1556f0a4b5fc8e61802caf72ae9a408", + "reference": "24444ea0e1556f0a4b5fc8e61802caf72ae9a408", "shasum": "" }, "require": { @@ -1452,7 +1414,7 @@ "illuminate/pipeline": "~5.5|~5.6|~5.7|~5.8|^6.0", "php": "^7.1", "symfony/http-foundation": "~3.3|~4.1", - "symfony/var-dumper": "^3.4|^4.0" + "symfony/var-dumper": "^3.4|^4.0|^5.0" }, "require-dev": { "larapack/dd": "^1.1", @@ -1485,26 +1447,26 @@ "flare", "reporting" ], - "time": "2019-10-07T19:15:46+00:00" + "time": "2019-12-15T18:28:38+00:00" }, { "name": "facade/ignition", - "version": "1.11.2", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "862cbc2dfffa1fa28b47822a116e5b2e03b421db" + "reference": "37f094775814b68d0c6cc8b8ff3c3be243f20725" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/862cbc2dfffa1fa28b47822a116e5b2e03b421db", - "reference": "862cbc2dfffa1fa28b47822a116e5b2e03b421db", + "url": "https://api.github.com/repos/facade/ignition/zipball/37f094775814b68d0c6cc8b8ff3c3be243f20725", + "reference": "37f094775814b68d0c6cc8b8ff3c3be243f20725", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.1", + "facade/flare-client-php": "^1.3", "facade/ignition-contracts": "^1.0", "filp/whoops": "^2.4", "illuminate/support": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6.0", @@ -1525,7 +1487,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "v2.x-dev" }, "laravel": { "providers": [ @@ -1556,7 +1518,7 @@ "laravel", "page" ], - "time": "2019-10-13T10:42:06+00:00" + "time": "2020-01-21T17:46:02+00:00" }, { "name": "facade/ignition-contracts", @@ -1604,16 +1566,16 @@ }, { "name": "filp/whoops", - "version": "2.5.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "cde50e6720a39fdacb240159d3eea6865d51fd96" + "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/cde50e6720a39fdacb240159d3eea6865d51fd96", - "reference": "cde50e6720a39fdacb240159d3eea6865d51fd96", + "url": "https://api.github.com/repos/filp/whoops/zipball/fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", + "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", "shasum": "" }, "require": { @@ -1622,8 +1584,8 @@ }, "require-dev": { "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -1632,7 +1594,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1647,8 +1609,8 @@ "authors": [ { "name": "Filipe Dobreira", - "role": "Developer", - "homepage": "https://github.com/filp" + "homepage": "https://github.com/filp", + "role": "Developer" } ], "description": "php error handling for cool kids", @@ -1661,7 +1623,7 @@ "throwable", "whoops" ], - "time": "2019-08-07T09:00:00+00:00" + "time": "2020-01-15T10:00:00+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2367,26 +2329,27 @@ }, { "name": "laravel/framework", - "version": "v6.4.1", + "version": "v6.13.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "ebd8fcc038effa8c5f8791346c48047f7d0ed320" + "reference": "f0059760814b76fb5f98bb80628607c7560ebe58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/ebd8fcc038effa8c5f8791346c48047f7d0ed320", - "reference": "ebd8fcc038effa8c5f8791346c48047f7d0ed320", + "url": "https://api.github.com/repos/laravel/framework/zipball/f0059760814b76fb5f98bb80628607c7560ebe58", + "reference": "f0059760814b76fb5f98bb80628607c7560ebe58", "shasum": "" }, "require": { "doctrine/inflector": "^1.1", "dragonmantank/cron-expression": "^2.0", "egulias/email-validator": "^2.1.10", - "erusev/parsedown": "^1.7", "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", + "league/commonmark": "^1.1", + "league/commonmark-ext-table": "^2.1", "league/flysystem": "^1.0.8", "monolog/monolog": "^1.12|^2.0", "nesbot/carbon": "^2.0", @@ -2446,14 +2409,13 @@ "filp/whoops": "^2.4", "guzzlehttp/guzzle": "^6.3", "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "^1.2.3", + "mockery/mockery": "^1.3.1", "moontoast/math": "^1.1", "orchestra/testbench-core": "^4.0", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.3", + "phpunit/phpunit": "^7.5.15|^8.4|^9.0", "predis/predis": "^1.1.1", - "symfony/cache": "^4.3", - "true/punycode": "^2.1" + "symfony/cache": "^4.3.4" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.0).", @@ -2471,8 +2433,9 @@ "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0)", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", "symfony/cache": "Required to PSR-6 cache bridge (^4.3.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.2).", @@ -2509,7 +2472,7 @@ "framework", "laravel" ], - "time": "2019-10-29T14:30:39+00:00" + "time": "2020-01-28T21:44:01+00:00" }, { "name": "laravel/helpers", @@ -2632,6 +2595,142 @@ "homepage": "https://laravelcollective.com", "time": "2019-10-02T00:37:39+00:00" }, + { + "name": "league/commonmark", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "34cf4ddb3892c715ae785c880e6691d839cff88d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/34cf4ddb3892c715ae785c880e6691d839cff88d", + "reference": "34cf4ddb3892c715ae785c880e6691d839cff88d", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1" + }, + "replace": { + "colinodell/commonmark-php": "*" + }, + "require-dev": { + "cebe/markdown": "~1.0", + "commonmark/commonmark.js": "0.29.1", + "erusev/parsedown": "~1.0", + "ext-json": "*", + "michelf/php-markdown": "~1.4", + "mikehaertl/php-shellcommand": "^1.4", + "phpstan/phpstan-shim": "^0.11.5", + "phpunit/phpunit": "^7.5", + "scrutinizer/ocular": "^1.5", + "symfony/finder": "^4.2" + }, + "suggest": { + "league/commonmark-extras": "Library of useful extensions including smart punctuation" + }, + "bin": [ + "bin/commonmark" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "PHP Markdown parser based on the CommonMark spec", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "markdown", + "parser" + ], + "time": "2020-01-16T01:18:13+00:00" + }, + { + "name": "league/commonmark-ext-table", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark-ext-table.git", + "reference": "3228888ea69636e855efcf6636ff8e6316933fe7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark-ext-table/zipball/3228888ea69636e855efcf6636ff8e6316933fe7", + "reference": "3228888ea69636e855efcf6636ff8e6316933fe7", + "shasum": "" + }, + "require": { + "league/commonmark": "~0.19.3|^1.0", + "php": "^7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14", + "phpstan/phpstan": "~0.11", + "phpunit/phpunit": "^7.0|^8.0", + "symfony/var-dumper": "^4.0", + "vimeo/psalm": "^3.0" + }, + "type": "commonmark-extension", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\Ext\\Table\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Martin Hasoň", + "email": "martin.hason@gmail.com" + }, + { + "name": "Webuni s.r.o.", + "homepage": "https://www.webuni.cz" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Table extension for league/commonmark", + "homepage": "https://github.com/thephpleague/commonmark-ext-table", + "keywords": [ + "commonmark", + "extension", + "markdown", + "table" + ], + "time": "2019-09-26T13:28:33+00:00" + }, { "name": "league/csv", "version": "9.2.1", @@ -2701,16 +2800,16 @@ }, { "name": "league/flysystem", - "version": "1.0.57", + "version": "1.0.63", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8132daec326565036bc8e8d1876f77ec183a7bd6", + "reference": "8132daec326565036bc8e8d1876f77ec183a7bd6", "shasum": "" }, "require": { @@ -2781,7 +2880,7 @@ "sftp", "storage" ], - "time": "2019-10-16T21:01:05+00:00" + "time": "2020-01-04T16:30:31+00:00" }, { "name": "league/geotools", @@ -2859,16 +2958,16 @@ }, { "name": "league/iso3166", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/thephpleague/iso3166.git", - "reference": "f2dca0b179e3ea4486f8089d0f910716b2896033" + "reference": "aed3b32fc293afdf2c6c6a322c2408eb5d20804a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/iso3166/zipball/f2dca0b179e3ea4486f8089d0f910716b2896033", - "reference": "f2dca0b179e3ea4486f8089d0f910716b2896033", + "url": "https://api.github.com/repos/thephpleague/iso3166/zipball/aed3b32fc293afdf2c6c6a322c2408eb5d20804a", + "reference": "aed3b32fc293afdf2c6c6a322c2408eb5d20804a", "shasum": "" }, "require": { @@ -2909,7 +3008,7 @@ "iso", "library" ], - "time": "2019-10-23T06:57:59+00:00" + "time": "2020-01-29T07:08:12+00:00" }, { "name": "markrogoyski/math-php", @@ -2978,16 +3077,16 @@ }, { "name": "monolog/monolog", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "68545165e19249013afd1d6f7485aecff07a2d22" + "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/68545165e19249013afd1d6f7485aecff07a2d22", - "reference": "68545165e19249013afd1d6f7485aecff07a2d22", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c861fcba2ca29404dc9e617eedd9eff4616986b8", + "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8", "shasum": "" }, "require": { @@ -3055,20 +3154,20 @@ "logging", "psr-3" ], - "time": "2019-08-30T09:56:44+00:00" + "time": "2019-12-20T14:22:59+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -3103,20 +3202,20 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "nabeel/vacentral", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/nabeelio/vacentral-library.git", - "reference": "a6e9dcc0f20b729634d2a27651f5feba472d4937" + "reference": "af0d4f6db1bff455ce1eeaf1b544e2e26ffbdd81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nabeelio/vacentral-library/zipball/a6e9dcc0f20b729634d2a27651f5feba472d4937", - "reference": "a6e9dcc0f20b729634d2a27651f5feba472d4937", + "url": "https://api.github.com/repos/nabeelio/vacentral-library/zipball/af0d4f6db1bff455ce1eeaf1b544e2e26ffbdd81", + "reference": "af0d4f6db1bff455ce1eeaf1b544e2e26ffbdd81", "shasum": "" }, "require": { @@ -3140,31 +3239,31 @@ "license": [ "MIT" ], - "time": "2019-10-01T16:32:12+00:00" + "time": "2019-12-11T14:44:00+00:00" }, { "name": "nesbot/carbon", - "version": "2.25.3", + "version": "2.29.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d07636581795383e2fea2d711212d30f941f2039" + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d07636581795383e2fea2d711212d30f941f2039", - "reference": "d07636581795383e2fea2d711212d30f941f2039", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e509be5bf2d703390e69e14496d9a1168452b0a2", + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2", "shasum": "" }, "require": { "ext-json": "*", "php": "^7.1.8 || ^8.0", - "symfony/translation": "^3.4 || ^4.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", "kylekatarnls/multi-tester": "^1.1", - "phpmd/phpmd": "dev-php-7.1-compatibility", + "phpmd/phpmd": "^2.8", "phpstan/phpstan": "^0.11", "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" @@ -3174,6 +3273,9 @@ ], "type": "library", "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -3207,20 +3309,20 @@ "datetime", "time" ], - "time": "2019-10-20T11:05:44+00:00" + "time": "2020-01-21T09:36:43+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.5", + "version": "v4.3.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2" + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/b76bbc3c51f22c570648de48e8c2d941ed5e2cf2", - "reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", "shasum": "" }, "require": { @@ -3228,7 +3330,7 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "0.0.4", + "ircmaxell/php-yacc": "0.0.5", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, "bin": [ @@ -3237,7 +3339,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -3259,30 +3361,31 @@ "parser", "php" ], - "time": "2019-10-25T18:33:07+00:00" + "time": "2019-11-08T13:50:10+00:00" }, { "name": "nwidart/laravel-modules", - "version": "5.1.0", + "version": "6.2.0", "source": { "type": "git", "url": "https://github.com/nWidart/laravel-modules.git", - "reference": "d4edc3465d471644ca44b1b303803492609957cd" + "reference": "6dc702eeb5d025b4cd331bc394e47ccc43b68e89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/d4edc3465d471644ca44b1b303803492609957cd", - "reference": "d4edc3465d471644ca44b1b303803492609957cd", + "url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/6dc702eeb5d025b4cd331bc394e47ccc43b68e89", + "reference": "6dc702eeb5d025b4cd331bc394e47ccc43b68e89", "shasum": "" }, "require": { + "ext-json": "*", "php": ">=7.2" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.14", - "laravel/framework": "5.8.*", + "friendsofphp/php-cs-fixer": "^2.15", + "laravel/framework": "6.0.*", "mockery/mockery": "~1.0", - "orchestra/testbench": "^3.8", + "orchestra/testbench": "^4.0", "phpstan/phpstan": "^0.9.2", "phpunit/phpunit": "~7.0|~8.0", "spatie/phpunit-snapshot-assertions": "^2.1.0" @@ -3298,7 +3401,7 @@ } }, "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -3329,20 +3432,20 @@ "nwidart", "rad" ], - "time": "2019-09-05T09:41:08+00:00" + "time": "2019-11-12T18:38:48+00:00" }, { "name": "opis/closure", - "version": "3.4.1", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "e79f851749c3caa836d7ccc01ede5828feb762c7" + "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/e79f851749c3caa836d7ccc01ede5828feb762c7", - "reference": "e79f851749c3caa836d7ccc01ede5828feb762c7", + "url": "https://api.github.com/repos/opis/closure/zipball/93ebc5712cdad8d5f489b500c59d122df2e53969", + "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969", "shasum": "" }, "require": { @@ -3355,7 +3458,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.5.x-dev" } }, "autoload": { @@ -3390,7 +3493,7 @@ "serialization", "serialize" ], - "time": "2019-10-19T18:38:51+00:00" + "time": "2019-11-29T22:36:02+00:00" }, { "name": "paragonie/random_compat", @@ -3439,16 +3542,16 @@ }, { "name": "php-http/discovery", - "version": "1.7.0", + "version": "1.7.4", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "e822f86a6983790aa17ab13aa7e69631e86806b6" + "reference": "82dbef649ccffd8e4f22e1953c3a5265992b83c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/e822f86a6983790aa17ab13aa7e69631e86806b6", - "reference": "e822f86a6983790aa17ab13aa7e69631e86806b6", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82dbef649ccffd8e4f22e1953c3a5265992b83c0", + "reference": "82dbef649ccffd8e4f22e1953c3a5265992b83c0", "shasum": "" }, "require": { @@ -3500,7 +3603,7 @@ "message", "psr7" ], - "time": "2019-06-30T09:04:27+00:00" + "time": "2020-01-03T11:25:47+00:00" }, { "name": "php-units-of-measure/php-units-of-measure", @@ -3555,43 +3658,48 @@ }, { "name": "phpoption/phpoption", - "version": "1.5.0", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", - "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.5.9 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "4.7.*" + "bamarni/composer-bin-plugin": "^1.3", + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.7-dev" } }, "autoload": { - "psr-0": { - "PhpOption\\": "src/" + "psr-4": { + "PhpOption\\": "src/PhpOption/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache2" + "Apache-2.0" ], "authors": [ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -3601,7 +3709,7 @@ "php", "type" ], - "time": "2015-07-25T16:39:46+00:00" + "time": "2019-12-15T19:35:24+00:00" }, { "name": "pragmarx/version", @@ -3726,16 +3834,16 @@ }, { "name": "prettus/l5-repository", - "version": "2.6.36", + "version": "2.6.40", "source": { "type": "git", "url": "https://github.com/andersao/l5-repository.git", - "reference": "c4f56cffbd23d61e16d2a8a9df0c651037313b54" + "reference": "48ed6d347941bf04927a3cd490df7bba7a02ca36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/andersao/l5-repository/zipball/c4f56cffbd23d61e16d2a8a9df0c651037313b54", - "reference": "c4f56cffbd23d61e16d2a8a9df0c651037313b54", + "url": "https://api.github.com/repos/andersao/l5-repository/zipball/48ed6d347941bf04927a3cd490df7bba7a02ca36", + "reference": "48ed6d347941bf04927a3cd490df7bba7a02ca36", "shasum": "" }, "require": { @@ -3787,7 +3895,7 @@ "model", "repository" ], - "time": "2019-09-11T14:09:40+00:00" + "time": "2019-12-22T13:53:50+00:00" }, { "name": "prettus/laravel-validation", @@ -3979,16 +4087,16 @@ }, { "name": "psr/log", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2", - "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -4022,7 +4130,7 @@ "psr", "psr-3" ], - "time": "2019-10-25T08:06:51+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "psr/simple-cache", @@ -4114,44 +4222,46 @@ }, { "name": "ramsey/uuid", - "version": "3.8.0", + "version": "3.9.2", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" + "reference": "7779489a47d443f845271badbdcedfe4df8e06fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", - "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/7779489a47d443f845271badbdcedfe4df8e06fb", + "reference": "7779489a47d443f845271badbdcedfe4df8e06fb", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.0|^2.0|9.99.99", - "php": "^5.4 || ^7.0", + "ext-json": "*", + "paragonie/random_compat": "^1 | ^2 | 9.99.99", + "php": "^5.4 | ^7 | ^8", "symfony/polyfill-ctype": "^1.8" }, "replace": { "rhumsaa/uuid": "self.version" }, "require-dev": { - "codeception/aspect-mock": "^1.0 | ~2.0.0", - "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", - "ircmaxell/random-lib": "^1.1", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "mockery/mockery": "^0.9.9", + "codeception/aspect-mock": "^1 | ^2", + "doctrine/annotations": "^1.2", + "goaop/framework": "1.0.0-alpha.2 | ^1 | ^2.1", + "jakub-onderka/php-parallel-lint": "^1", + "mockery/mockery": "^0.9.11 | ^1", "moontoast/math": "^1.1", - "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0|^6.5", - "squizlabs/php_codesniffer": "^2.3" + "paragonie/random-lib": "^2", + "php-mock/php-mock-phpunit": "^0.3 | ^1.1", + "phpunit/phpunit": "^4.8 | ^5.4 | ^6.5", + "squizlabs/php_codesniffer": "^3.5" }, "suggest": { "ext-ctype": "Provides support for PHP Ctype functions", "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-openssl": "Provides the OpenSSL extension for use with the OpenSslGenerator", "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", - "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, @@ -4164,13 +4274,21 @@ "autoload": { "psr-4": { "Ramsey\\Uuid\\": "src/" - } + }, + "files": [ + "src/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + }, { "name": "Marijn Huizendveld", "email": "marijn.huizendveld@gmail.com" @@ -4178,11 +4296,6 @@ { "name": "Thibaud Fabre", "email": "thibaud@aztech.io" - }, - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" } ], "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", @@ -4192,7 +4305,7 @@ "identifier", "uuid" ], - "time": "2018-07-19T23:38:55+00:00" + "time": "2019-12-17T08:18:51+00:00" }, { "name": "react/event-loop", @@ -4284,16 +4397,16 @@ }, { "name": "santigarcor/laratrust", - "version": "5.2.5", + "version": "5.2.6", "source": { "type": "git", "url": "https://github.com/santigarcor/laratrust.git", - "reference": "084cf15a0710657c203616f27309971f8a38ccd3" + "reference": "8efac1ee9cc7750c9207e521776a9adbc35ce307" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/084cf15a0710657c203616f27309971f8a38ccd3", - "reference": "084cf15a0710657c203616f27309971f8a38ccd3", + "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/8efac1ee9cc7750c9207e521776a9adbc35ce307", + "reference": "8efac1ee9cc7750c9207e521776a9adbc35ce307", "shasum": "" }, "require": { @@ -4345,20 +4458,20 @@ "rbac", "roles" ], - "time": "2019-10-22T14:41:04+00:00" + "time": "2019-11-08T13:53:13+00:00" }, { "name": "scrivo/highlight.php", - "version": "v9.15.10.0", + "version": "v9.18.0.0", "source": { "type": "git", "url": "https://github.com/scrivo/highlight.php.git", - "reference": "9ad3adb4456dc91196327498dbbce6aa1ba1239e" + "reference": "0e7860058231b5bc843d1f5ac5c091be6b15b2d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/9ad3adb4456dc91196327498dbbce6aa1ba1239e", - "reference": "9ad3adb4456dc91196327498dbbce6aa1ba1239e", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/0e7860058231b5bc843d1f5ac5c091be6b15b2d1", + "reference": "0e7860058231b5bc843d1f5ac5c091be6b15b2d1", "shasum": "" }, "require": { @@ -4368,7 +4481,8 @@ }, "require-dev": { "phpunit/phpunit": "^4.8|^5.7", - "symfony/finder": "^2.8" + "symfony/finder": "^2.8|^3.4", + "symfony/var-dumper": "^2.8|^3.4" }, "suggest": { "ext-dom": "Needed to make use of the features in the utilities namespace" @@ -4390,18 +4504,18 @@ "authors": [ { "name": "Geert Bergman", - "role": "Project Author", - "homepage": "http://www.scrivo.org/" + "homepage": "http://www.scrivo.org/", + "role": "Project Author" }, { "name": "Vladimir Jimenez", - "role": "Contributor", - "homepage": "https://allejo.io" + "homepage": "https://allejo.io", + "role": "Maintainer" }, { "name": "Martin Folkers", - "role": "Contributor", - "homepage": "https://twobrain.io" + "homepage": "https://twobrain.io", + "role": "Contributor" } ], "description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js", @@ -4412,7 +4526,7 @@ "highlight.php", "syntax" ], - "time": "2019-08-27T04:27:48+00:00" + "time": "2020-01-29T15:18:09+00:00" }, { "name": "sebastiaanluca/laravel-helpers", @@ -4532,16 +4646,16 @@ }, { "name": "seld/phar-utils", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + "reference": "84715761c35808076b00908a20317a3a8a67d17e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/84715761c35808076b00908a20317a3a8a67d17e", + "reference": "84715761c35808076b00908a20317a3a8a67d17e", "shasum": "" }, "require": { @@ -4572,7 +4686,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2020-01-13T10:41:09+00:00" }, { "name": "semver/semver", @@ -4624,21 +4738,21 @@ }, { "name": "spatie/db-dumper", - "version": "2.14.3", + "version": "2.15.3", "source": { "type": "git", "url": "https://github.com/spatie/db-dumper.git", - "reference": "0ea605041373dce22cd0a387bca598050c7d033b" + "reference": "e167b8bf925c5da553f885326bb7bfaed3f95d15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/db-dumper/zipball/0ea605041373dce22cd0a387bca598050c7d033b", - "reference": "0ea605041373dce22cd0a387bca598050c7d033b", + "url": "https://api.github.com/repos/spatie/db-dumper/zipball/e167b8bf925c5da553f885326bb7bfaed3f95d15", + "reference": "e167b8bf925c5da553f885326bb7bfaed3f95d15", "shasum": "" }, "require": { "php": "^7.2", - "symfony/process": "^4.2" + "symfony/process": "^4.2|^5.0" }, "require-dev": { "phpunit/phpunit": "^7.0|^8.0" @@ -4656,9 +4770,9 @@ "authors": [ { "name": "Freek Van der Herten", - "role": "Developer", "email": "freek@spatie.be", - "homepage": "https://spatie.be" + "homepage": "https://spatie.be", + "role": "Developer" } ], "description": "Dump databases", @@ -4670,20 +4784,20 @@ "mysqldump", "spatie" ], - "time": "2019-08-21T16:39:54+00:00" + "time": "2020-01-24T13:05:20+00:00" }, { "name": "spatie/laravel-backup", - "version": "6.7.2", + "version": "6.7.7", "source": { "type": "git", "url": "https://github.com/spatie/laravel-backup.git", - "reference": "ab48ebb31388e004dfac9d6203033e29db9a24a9" + "reference": "c2aeb1685007ee1cc2b3f86c26315aeb32602a93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/ab48ebb31388e004dfac9d6203033e29db9a24a9", - "reference": "ab48ebb31388e004dfac9d6203033e29db9a24a9", + "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/c2aeb1685007ee1cc2b3f86c26315aeb32602a93", + "reference": "c2aeb1685007ee1cc2b3f86c26315aeb32602a93", "shasum": "" }, "require": { @@ -4704,7 +4818,7 @@ "league/flysystem-aws-s3-v3": "^1.0", "mockery/mockery": "^1.0", "orchestra/testbench": "3.8.*|4.*", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.4" }, "suggest": { "laravel/slack-notification-channel": "Required for sending notifications via Slack" @@ -4745,20 +4859,20 @@ "laravel-backup", "spatie" ], - "time": "2019-10-29T03:46:02+00:00" + "time": "2020-01-27T13:58:27+00:00" }, { "name": "spatie/temporary-directory", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/spatie/temporary-directory.git", - "reference": "3e51af9a8361f85cffc1fb2c52135f3e064758cc" + "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/3e51af9a8361f85cffc1fb2c52135f3e064758cc", - "reference": "3e51af9a8361f85cffc1fb2c52135f3e064758cc", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/fcb127e615700751dac2aefee0ea2808ff3f5bb1", + "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1", "shasum": "" }, "require": { @@ -4780,9 +4894,9 @@ "authors": [ { "name": "Alex Vanderbist", - "role": "Developer", "email": "alex@spatie.be", - "homepage": "https://spatie.be" + "homepage": "https://spatie.be", + "role": "Developer" } ], "description": "Easily create, use and destroy temporary directories", @@ -4791,7 +4905,7 @@ "spatie", "temporary-directory" ], - "time": "2019-08-28T06:53:51+00:00" + "time": "2019-12-15T18:52:09+00:00" }, { "name": "spatie/valuestore", @@ -4848,16 +4962,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v6.2.1", + "version": "v6.2.3", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "5397cd05b0a0f7937c47b0adcb4c60e5ab936b6a" + "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/5397cd05b0a0f7937c47b0adcb4c60e5ab936b6a", - "reference": "5397cd05b0a0f7937c47b0adcb4c60e5ab936b6a", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/149cfdf118b169f7840bbe3ef0d4bc795d1780c9", + "reference": "149cfdf118b169f7840bbe3ef0d4bc795d1780c9", "shasum": "" }, "require": { @@ -4906,31 +5020,32 @@ "mail", "mailer" ], - "time": "2019-04-21T09:21:45+00:00" + "time": "2019-11-12T09:31:26+00:00" }, { "name": "symfony/console", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "929ddf360d401b958f611d44e726094ab46a7369" + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369", - "reference": "929ddf360d401b958f611d44e726094ab46a7369", + "url": "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { @@ -4938,12 +5053,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/event-dispatcher": "^4.3", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -4954,7 +5069,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -4981,29 +5096,29 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-10-07T12:36:49+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/css-selector", - "version": "v4.3.5", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ff60c90cb7950b592ebc84ad1289d0345bf24f9f", + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -5034,20 +5149,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-02T08:36:26+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/debug", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "cc5c1efd0edfcfd10b354750594a46b3dd2afbbe" + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/cc5c1efd0edfcfd10b354750594a46b3dd2afbbe", - "reference": "cc5c1efd0edfcfd10b354750594a46b3dd2afbbe", + "url": "https://api.github.com/repos/symfony/debug/zipball/89c3fd5c299b940333bc6fe9f1b8db1b0912c759", + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759", "shasum": "" }, "require": { @@ -5058,12 +5173,12 @@ "symfony/http-kernel": "<3.4" }, "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5090,20 +5205,76 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-09-19T15:51:53+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.3.5", + "name": "symfony/error-handler", + "version": "v4.4.3", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807" + "url": "https://github.com/symfony/error-handler.git", + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6229f58993e5a157f6096fc7145c0717d0be8807", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/a59789092e40ad08465dc2cdc55651be503d0d5a", + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0", + "symfony/debug": "^4.4", + "symfony/var-dumper": "^4.4|^5.0" + }, + "require-dev": { + "symfony/http-kernel": "^4.4|^5.0", + "symfony/serializer": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ErrorHandler Component", + "homepage": "https://symfony.com", + "time": "2020-01-08T17:29:02+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9e3de195e5bc301704dd6915df55892f6dfc208b", + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b", "shasum": "" }, "require": { @@ -5119,12 +5290,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "^3.4|^4.0", - "symfony/service-contracts": "^1.1", - "symfony/stopwatch": "~3.4|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -5133,7 +5304,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5160,7 +5331,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-10-01T16:40:32+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5222,16 +5393,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" + "reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/266c9540b475f26122b61ef8b23dd9198f5d1cfd", + "reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd", "shasum": "" }, "require": { @@ -5241,7 +5412,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5268,20 +5439,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:07:54+00:00" + "time": "2020-01-21T08:20:44+00:00" }, { "name": "symfony/finder", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "5e575faa95548d0586f6bedaeabec259714e44d1" + "reference": "3a50be43515590faf812fbd7708200aabc327ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5e575faa95548d0586f6bedaeabec259714e44d1", - "reference": "5e575faa95548d0586f6bedaeabec259714e44d1", + "url": "https://api.github.com/repos/symfony/finder/zipball/3a50be43515590faf812fbd7708200aabc327ec3", + "reference": "3a50be43515590faf812fbd7708200aabc327ec3", "shasum": "" }, "require": { @@ -5290,7 +5461,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5317,35 +5488,35 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-09-16T11:29:48+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "76590ced16d4674780863471bae10452b79210a5" + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/76590ced16d4674780863471bae10452b79210a5", - "reference": "76590ced16d4674780863471bae10452b79210a5", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c33998709f3fe9b8e27e0277535b07fbf6fde37a", + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/mime": "^4.3", + "symfony/mime": "^4.3|^5.0", "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "symfony/expression-language": "^3.4|^4.0|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5372,37 +5543,37 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-10-04T19:48:13+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "5f08141850932e8019c01d8988bf3ed6367d2991" + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5f08141850932e8019c01d8988bf3ed6367d2991", - "reference": "5f08141850932e8019c01d8988bf3ed6367d2991", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16f2aa3c54b08483fba5375938f60b1ff83b6bd2", + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2", "shasum": "" }, "require": { "php": "^7.1.3", "psr/log": "~1.0", - "symfony/debug": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", - "symfony/http-foundation": "^4.1.1", - "symfony/polyfill-ctype": "~1.8", + "symfony/error-handler": "^4.4", + "symfony/event-dispatcher": "^4.4", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9" }, "conflict": { "symfony/browser-kit": "<4.3", "symfony/config": "<3.4", + "symfony/console": ">=5", "symfony/dependency-injection": "<4.3", "symfony/translation": "<4.2", - "symfony/var-dumper": "<4.1.1", "twig/twig": "<1.34|<2.4,>=2" }, "provide": { @@ -5410,34 +5581,32 @@ }, "require-dev": { "psr/cache": "~1.0", - "symfony/browser-kit": "^4.3", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/css-selector": "~3.4|~4.0", - "symfony/dependency-injection": "^4.3", - "symfony/dom-crawler": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/routing": "~3.4|~4.0", - "symfony/stopwatch": "~3.4|~4.0", - "symfony/templating": "~3.4|~4.0", - "symfony/translation": "~4.2", - "symfony/translation-contracts": "^1.1", - "symfony/var-dumper": "^4.1.1", - "twig/twig": "^1.34|^2.4" + "symfony/browser-kit": "^4.3|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0", + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^4.3|^5.0", + "symfony/dom-crawler": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/routing": "^3.4|^4.0|^5.0", + "symfony/stopwatch": "^3.4|^4.0|^5.0", + "symfony/templating": "^3.4|^4.0|^5.0", + "symfony/translation": "^4.2|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "twig/twig": "^1.34|^2.4|^3.0" }, "suggest": { "symfony/browser-kit": "", "symfony/config": "", "symfony/console": "", - "symfony/dependency-injection": "", - "symfony/var-dumper": "" + "symfony/dependency-injection": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5464,30 +5633,30 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-10-07T15:06:41+00:00" + "time": "2020-01-21T13:23:17+00:00" }, { "name": "symfony/inflector", - "version": "v4.3.5", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", - "reference": "fc488a52c79b2bbe848fa9def35f2cccb47c4798" + "reference": "e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/fc488a52c79b2bbe848fa9def35f2cccb47c4798", - "reference": "fc488a52c79b2bbe848fa9def35f2cccb47c4798", + "url": "https://api.github.com/repos/symfony/inflector/zipball/e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2", + "reference": "e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -5522,35 +5691,38 @@ "symfony", "words" ], - "time": "2019-09-17T11:12:06+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/mime", - "version": "v4.3.5", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "32f71570547b91879fdbd9cf50317d556ae86916" + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/32f71570547b91879fdbd9cf50317d556ae86916", - "reference": "32f71570547b91879fdbd9cf50317d556ae86916", + "url": "https://api.github.com/repos/symfony/mime/zipball/2a3c7fee1f1a0961fa9cf360d5da553d05095e59", + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, + "conflict": { + "symfony/mailer": "<4.4" + }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "~3.4|^4.1" + "symfony/dependency-injection": "^4.4|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -5581,20 +5753,20 @@ "mime", "mime-type" ], - "time": "2019-09-19T17:00:15+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -5606,7 +5778,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5639,20 +5811,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "685968b11e61a347c18bf25db32effa478be610f" + "reference": "a019efccc03f1a335af6b4f20c30f5ea8060be36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/685968b11e61a347c18bf25db32effa478be610f", - "reference": "685968b11e61a347c18bf25db32effa478be610f", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/a019efccc03f1a335af6b4f20c30f5ea8060be36", + "reference": "a019efccc03f1a335af6b4f20c30f5ea8060be36", "shasum": "" }, "require": { @@ -5664,7 +5836,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5698,20 +5870,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2" + "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", - "reference": "6af626ae6fa37d396dc90a399c0ff08e5cfc45b2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6f9c239e61e1b0c9229a28ff89a812dc449c3d46", + "reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46", "shasum": "" }, "require": { @@ -5725,7 +5897,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5760,20 +5932,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -5785,7 +5957,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5819,20 +5991,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", "shasum": "" }, "require": { @@ -5841,7 +6013,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5874,20 +6046,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", "shasum": "" }, "require": { @@ -5896,7 +6068,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -5932,20 +6104,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T16:25:15+00:00" }, { "name": "symfony/process", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b" + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/50556892f3cc47d4200bfd1075314139c4c9ff4b", - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b", + "url": "https://api.github.com/repos/symfony/process/zipball/f5697ab4cb14a5deed7473819e63141bf5352c36", + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36", "shasum": "" }, "require": { @@ -5954,7 +6126,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -5981,28 +6153,28 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-09-26T21:17:10+00:00" + "time": "2020-01-09T09:50:08+00:00" }, { "name": "symfony/property-access", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "bb0c302375ffeef60c31e72a4539611b7f787565" + "reference": "090b4bc92ded1ec512f7e2ed1691210769dffdb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/bb0c302375ffeef60c31e72a4539611b7f787565", - "reference": "bb0c302375ffeef60c31e72a4539611b7f787565", + "url": "https://api.github.com/repos/symfony/property-access/zipball/090b4bc92ded1ec512f7e2ed1691210769dffdb3", + "reference": "090b4bc92ded1ec512f7e2ed1691210769dffdb3", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/inflector": "~3.4|~4.0" + "symfony/inflector": "^3.4|^4.0|^5.0" }, "require-dev": { - "symfony/cache": "~3.4|~4.0" + "symfony/cache": "^3.4|^4.0|^5.0" }, "suggest": { "psr/cache-implementation": "To cache access methods." @@ -6010,7 +6182,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6048,20 +6220,20 @@ "property path", "reflection" ], - "time": "2019-08-26T08:26:39+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/routing", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3b174ef04fe66696524efad1e5f7a6c663d822ea" + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3b174ef04fe66696524efad1e5f7a6c663d822ea", - "reference": "3b174ef04fe66696524efad1e5f7a6c663d822ea", + "url": "https://api.github.com/repos/symfony/routing/zipball/7bf4e38573728e317b926ca4482ad30470d0e86a", + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a", "shasum": "" }, "require": { @@ -6075,11 +6247,11 @@ "require-dev": { "doctrine/annotations": "~1.2", "psr/log": "~1.0", - "symfony/config": "~4.2", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^4.2|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "doctrine/annotations": "For using the annotation loader", @@ -6091,7 +6263,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6124,20 +6296,20 @@ "uri", "url" ], - "time": "2019-10-04T20:57:10+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/serializer", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "805eacc72d28e237ef31659344a4d72acef335ec" + "reference": "76ecc214a93b763c29b924277e85f64326f9fbb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/805eacc72d28e237ef31659344a4d72acef335ec", - "reference": "805eacc72d28e237ef31659344a4d72acef335ec", + "url": "https://api.github.com/repos/symfony/serializer/zipball/76ecc214a93b763c29b924277e85f64326f9fbb2", + "reference": "76ecc214a93b763c29b924277e85f64326f9fbb2", "shasum": "" }, "require": { @@ -6154,15 +6326,16 @@ "require-dev": { "doctrine/annotations": "~1.0", "doctrine/cache": "~1.0", - "phpdocumentor/reflection-docblock": "^3.0|^4.0", - "symfony/cache": "~3.4|~4.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/http-foundation": "~3.4|~4.0", - "symfony/property-access": "~3.4|~4.0", - "symfony/property-info": "^3.4.13|~4.0", - "symfony/validator": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "phpdocumentor/reflection-docblock": "^3.2|^4.0", + "symfony/cache": "^3.4|^4.0|^5.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/property-access": "^3.4|^4.0|^5.0", + "symfony/property-info": "^3.4.13|~4.0|^5.0", + "symfony/validator": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", @@ -6177,7 +6350,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6204,24 +6377,24 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2019-10-02T15:03:35+00:00" + "time": "2020-01-07T22:30:39+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.7", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -6230,7 +6403,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -6262,30 +6435,31 @@ "interoperability", "standards" ], - "time": "2019-09-17T11:12:18+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/translation", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "fe6193b066c457c144333c06aaa869a2d42a167f" + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/fe6193b066c457c144333c06aaa869a2d42a167f", - "reference": "fe6193b066c457c144333c06aaa869a2d42a167f", + "url": "https://api.github.com/repos/symfony/translation/zipball/f5d2ac46930238b30a9c2f1b17c905f3697d808c", + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.6" + "symfony/translation-contracts": "^1.1.6|^2" }, "conflict": { "symfony/config": "<3.4", "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", "symfony/yaml": "<3.4" }, "provide": { @@ -6293,15 +6467,14 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/console": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/http-kernel": "~3.4|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/service-contracts": "^1.1.2", - "symfony/var-dumper": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/finder": "~2.8|~3.0|~4.0|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -6311,7 +6484,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6338,24 +6511,24 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-09-27T14:37:39+00:00" + "time": "2020-01-15T13:29:06+00:00" }, { "name": "symfony/translation-contracts", - "version": "v1.1.7", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "364518c132c95642e530d9b2d217acbc2ccac3e6" + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/364518c132c95642e530d9b2d217acbc2ccac3e6", - "reference": "364518c132c95642e530d9b2d217acbc2ccac3e6", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "suggest": { "symfony/translation-implementation": "" @@ -6363,7 +6536,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -6395,20 +6568,20 @@ "interoperability", "standards" ], - "time": "2019-09-17T11:12:18+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "bde8957fc415fdc6964f33916a3755737744ff05" + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bde8957fc415fdc6964f33916a3755737744ff05", - "reference": "bde8957fc415fdc6964f33916a3755737744ff05", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", "shasum": "" }, "require": { @@ -6422,9 +6595,9 @@ }, "require-dev": { "ext-iconv": "*", - "symfony/console": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "twig/twig": "~1.34|~2.4" + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.34|^2.4|^3.0" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", @@ -6437,7 +6610,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6471,20 +6644,20 @@ "debug", "dump" ], - "time": "2019-10-04T19:48:13+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.5", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" + "reference": "cd014e425b3668220adb865f53bff64b3ad21767" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "url": "https://api.github.com/repos/symfony/yaml/zipball/cd014e425b3668220adb865f53bff64b3ad21767", + "reference": "cd014e425b3668220adb865f53bff64b3ad21767", "shasum": "" }, "require": { @@ -6495,7 +6668,7 @@ "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -6503,7 +6676,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -6530,7 +6703,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-09-11T15:41:19+00:00" + "time": "2020-01-21T11:12:16+00:00" }, { "name": "theiconic/php-ga-measurement-protocol", @@ -6783,16 +6956,16 @@ }, { "name": "willdurand/geocoder", - "version": "4.2.1", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/geocoder-php/php-common.git", - "reference": "aaa17bddb8dc9e4553110db8beb38534b095b61a" + "reference": "31bc59626c737871c3d5cc4dc9bc468a7668d0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/geocoder-php/php-common/zipball/aaa17bddb8dc9e4553110db8beb38534b095b61a", - "reference": "aaa17bddb8dc9e4553110db8beb38534b095b61a", + "url": "https://api.github.com/repos/geocoder-php/php-common/zipball/31bc59626c737871c3d5cc4dc9bc468a7668d0d1", + "reference": "31bc59626c737871c3d5cc4dc9bc468a7668d0d1", "shasum": "" }, "require": { @@ -6800,7 +6973,7 @@ }, "require-dev": { "nyholm/nsa": "^1.1", - "phpunit/phpunit": "6.3.*", + "phpunit/phpunit": "^6.5 || ^7.5", "symfony/stopwatch": "~2.5" }, "suggest": { @@ -6826,7 +6999,7 @@ ], "authors": [ { - "name": "William DURAND", + "name": "William Durand", "email": "william.durand1@gmail.com" } ], @@ -6838,7 +7011,7 @@ "geocoding", "geoip" ], - "time": "2018-12-26T12:01:09+00:00" + "time": "2020-01-22T09:02:24+00:00" } ], "packages-dev": [ @@ -6912,16 +7085,16 @@ }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.6.5", + "version": "v2.6.6", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "8740a9a158d3dd5cfc706a9d4cc1bf7a518f99f3" + "reference": "b91b959364d97af658f268c733c75dccdbff197e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/8740a9a158d3dd5cfc706a9d4cc1bf7a518f99f3", - "reference": "8740a9a158d3dd5cfc706a9d4cc1bf7a518f99f3", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/b91b959364d97af658f268c733c75dccdbff197e", + "reference": "b91b959364d97af658f268c733c75dccdbff197e", "shasum": "" }, "require": { @@ -6979,7 +7152,7 @@ "phpstorm", "sublime" ], - "time": "2019-09-08T09:56:38+00:00" + "time": "2019-10-30T20:53:27+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -7083,16 +7256,16 @@ }, { "name": "codedungeon/php-cli-colors", - "version": "1.10.7", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/mikeerickson/php-cli-colors.git", - "reference": "5649ef76ec0c9ed626e95bf40fdfaf4b8efcf79b" + "reference": "9f60ac692cc790755dad47b01c1d607fe5f43b94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikeerickson/php-cli-colors/zipball/5649ef76ec0c9ed626e95bf40fdfaf4b8efcf79b", - "reference": "5649ef76ec0c9ed626e95bf40fdfaf4b8efcf79b", + "url": "https://api.github.com/repos/mikeerickson/php-cli-colors/zipball/9f60ac692cc790755dad47b01c1d607fe5f43b94", + "reference": "9f60ac692cc790755dad47b01c1d607fe5f43b94", "shasum": "" }, "require-dev": { @@ -7123,7 +7296,7 @@ "package", "php" ], - "time": "2018-05-17T01:34:14+00:00" + "time": "2019-12-29T22:29:29+00:00" }, { "name": "codedungeon/phpunit-result-printer", @@ -7246,16 +7419,16 @@ }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -7298,20 +7471,20 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.15.3", + "version": "v2.16.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "705490b0f282f21017d73561e9498d2b622ee34c" + "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/705490b0f282f21017d73561e9498d2b622ee34c", - "reference": "705490b0f282f21017d73561e9498d2b622ee34c", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c8afb599858876e95e8ebfcd97812d383fa23f02", + "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02", "shasum": "" }, "require": { @@ -7322,15 +7495,15 @@ "ext-tokenizer": "*", "php": "^5.6 || ^7.0", "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.17 || ^4.1.6", - "symfony/event-dispatcher": "^3.0 || ^4.0", - "symfony/filesystem": "^3.0 || ^4.0", - "symfony/finder": "^3.0 || ^4.0", - "symfony/options-resolver": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", "symfony/polyfill-php70": "^1.0", "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0", - "symfony/stopwatch": "^3.0 || ^4.0" + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", @@ -7343,8 +7516,8 @@ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", "phpunitgoodpractices/traits": "^1.8", - "symfony/phpunit-bridge": "^4.3", - "symfony/yaml": "^3.0 || ^4.0" + "symfony/phpunit-bridge": "^4.3 || ^5.0", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", @@ -7387,20 +7560,20 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-08-31T12:51:54+00:00" + "time": "2019-11-25T22:10:32+00:00" }, { "name": "fzaninotto/faker", - "version": "v1.8.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", "shasum": "" }, "require": { @@ -7409,12 +7582,12 @@ "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^1.5" + "squizlabs/php_codesniffer": "^2.9.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -7437,7 +7610,7 @@ "faker", "fixtures" ], - "time": "2018-07-12T10:23:15+00:00" + "time": "2019-12-12T13:22:17+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -8026,16 +8199,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "4.3.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", "shasum": "" }, "require": { @@ -8047,6 +8220,7 @@ "require-dev": { "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", "phpunit/phpunit": "^6.4" }, "type": "library", @@ -8073,7 +8247,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2019-12-28T18:55:12+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -8124,33 +8298,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -8183,20 +8357,20 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-01-20T15:57:02+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "7.0.8", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa0d179a13284c7420fc281fc32750e6cc7c9e2f", - "reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { @@ -8246,7 +8420,7 @@ "testing", "xunit" ], - "time": "2019-09-17T06:24:36+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -8439,16 +8613,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.4.2", + "version": "8.5.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b" + "reference": "018b6ac3c8ab20916db85fa91bf6465acb64d1e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b", - "reference": "a142a7e66c0ea7b5b6c04ee27f08d10d1137cd9b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/018b6ac3c8ab20916db85fa91bf6465acb64d1e0", + "reference": "018b6ac3c8ab20916db85fa91bf6465acb64d1e0", "shasum": "" }, "require": { @@ -8492,7 +8666,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.4-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -8518,7 +8692,7 @@ "testing", "xunit" ], - "time": "2019-10-28T10:39:51+00:00" + "time": "2020-01-08T08:49:49+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -8687,16 +8861,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -8736,7 +8910,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -9137,16 +9311,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", + "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "shasum": "" }, "require": { @@ -9184,29 +9358,29 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2019-12-04T04:46:47+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.5", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "81c2e120522a42f623233968244baebd6b36cb6a" + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/81c2e120522a42f623233968244baebd6b36cb6a", - "reference": "81c2e120522a42f623233968244baebd6b36cb6a", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b1ab86ce52b0c0abe031367a173005a025e30e04", + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -9238,20 +9412,20 @@ "configuration", "options" ], - "time": "2019-08-08T09:29:19+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "reference": "af23c7bb26a73b850840823662dda371484926c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", + "reference": "af23c7bb26a73b850840823662dda371484926c4", "shasum": "" }, "require": { @@ -9261,7 +9435,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9297,30 +9471,30 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.5", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71" + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e4ff456bd625be5032fac9be4294e60442e9b71", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5d9add8034135b9a5f7b101d1e42c797e7f053e4", + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "php": "^7.2.5", + "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -9347,7 +9521,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-08-07T11:52:19+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "theseer/tokenizer", @@ -9391,31 +9565,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -9437,7 +9609,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" } ], "aliases": [], diff --git a/config/app.php b/config/app.php index 69d570c8..2fafc44c 100755 --- a/config/app.php +++ b/config/app.php @@ -8,11 +8,12 @@ */ return [ - 'name' => env('APP_NAME', 'phpvms'), - 'env' => env('APP_ENV', 'dev'), - 'debug' => env('APP_DEBUG', true), - 'url' => env('APP_URL', 'http://localhost'), - 'version' => '7.0.0', + 'name' => env('APP_NAME', 'phpvms'), + 'env' => env('APP_ENV', 'dev'), + 'debug' => env('APP_DEBUG', true), + 'url' => env('APP_URL', 'http://localhost'), + 'version' => '7.0.0', + 'debug_toolbar' => false, 'locale' => env('APP_LOCALE', 'en'), 'fallback_locale' => 'en', diff --git a/config/backup.php b/config/backup.php index 4597f86d..78922107 100644 --- a/config/backup.php +++ b/config/backup.php @@ -1,6 +1,6 @@ env('FLARE_KEY'), + + /* + |-------------------------------------------------------------------------- + | Reporting Options + |-------------------------------------------------------------------------- + | + | These options determine which information will be transmitted to Flare. + | + */ + + 'reporting' => [ + 'anonymize_ips' => true, + 'collect_git_information' => false, + 'report_queries' => true, + 'maximum_number_of_collected_queries' => 200, + 'report_query_bindings' => true, + 'report_view_data' => true, + 'grouping_type' => null, + ], + + /* + |-------------------------------------------------------------------------- + | Reporting Log statements + |-------------------------------------------------------------------------- + | + | If this setting is `false` log statements won't be send as events to Flare, + | no matter which error level you specified in the Flare log channel. + | + */ + + 'send_logs_as_events' => true, +]; diff --git a/config/laratrust.php b/config/laratrust.php index f4410357..04d510d8 100644 --- a/config/laratrust.php +++ b/config/laratrust.php @@ -168,8 +168,33 @@ return [ 'middleware' => [ 'register' => true, 'handling' => 'redirect', - 'params' => '/login', - + /** + * Handlers for the unauthorized method in the middlewares. + * The name of the handler must be the same as the handling. + */ + 'handlers' => [ + /** + * Aborts the execution with a 403 code and allows you to provide the response text + */ + 'abort' => [ + 'code' => 403, + 'message' => 'User does not have any of the necessary access rights.', + ], + /** + * Redirects the user to the given url. + * If you want to flash a key to the session, + * you can do it by setting the key and the content of the message + * If the message content is empty it won't be added to the redirection. + */ + 'redirect' => [ + 'url' => '/', + 'message' => [ + 'key' => 'flash_notification.message', + 'content' => 'User does not have any of the necessary access rights.', + ], + ], + ], + 'params' => '/login', ], /* diff --git a/config/modules.php b/config/modules.php index 184ece94..2ec7508d 100644 --- a/config/modules.php +++ b/config/modules.php @@ -1,5 +1,7 @@ 'Modules', 'stubs' => [ @@ -133,4 +135,14 @@ return [ 'register' => [ 'translations' => true, ], + + 'activator' => 'file', + 'activators' => [ + 'file' => [ + 'class' => FileActivator::class, + 'statuses-file' => config_path('modules_statuses.json'), + 'cache-key' => 'activator.installed', + 'cache-lifetime' => 604800, + ], + ], ]; diff --git a/config/modules_statuses.json b/config/modules_statuses.json new file mode 100644 index 00000000..d7b8ddbe --- /dev/null +++ b/config/modules_statuses.json @@ -0,0 +1,9 @@ +{ + "Awards": true, + "Importer": true, + "Installer": true, + "Sample": true, + "Updater": true, + "VMSAcars": true, + "Vacentral": true +} diff --git a/config/notifications.php b/config/notifications.php new file mode 100644 index 00000000..069d225b --- /dev/null +++ b/config/notifications.php @@ -0,0 +1,26 @@ + [ + AdminUserRegistered::class => ['mail'], + NewsAdded::class => ['mail'], + PirepAccepted::class => ['mail'], + PirepRejected::class => ['mail'], + PirepSubmitted::class => ['mail'], + UserPending::class => ['mail'], + UserRegistered::class => ['mail'], + UserRejected::class => ['mail'], + ], +]; diff --git a/config/phpvms.php b/config/phpvms.php index 3f890fcb..6f3a5b41 100644 --- a/config/phpvms.php +++ b/config/phpvms.php @@ -99,4 +99,11 @@ return [ * RFC 7807 type, which can be used as a machine-readable error code/map */ 'error_root' => 'https://phpvms.net/errors', + + /** + * The links to various docs on the documentation site + */ + 'docs' => [ + 'cron' => 'http://docs.phpvms.net/configuration/cron', + ], ]; diff --git a/config/queue.php b/config/queue.php index e4026e0d..e6031055 100755 --- a/config/queue.php +++ b/config/queue.php @@ -14,7 +14,7 @@ return [ | */ - 'default' => env('QUEUE_DRIVER', 'sync'), + 'default' => env('QUEUE_DRIVER', 'database'), /* |-------------------------------------------------------------------------- diff --git a/config/repository.php b/config/repository.php index 9a90078e..d4663ba7 100644 --- a/config/repository.php +++ b/config/repository.php @@ -2,7 +2,7 @@ return [ 'pagination' => [ - 'limit' => 50, + 'limit' => 20, ], /* diff --git a/config/version.yml b/config/version.yml index b83667f5..5a8c70ff 100644 --- a/config/version.yml +++ b/config/version.yml @@ -3,13 +3,15 @@ current: major: 7 minor: 0 patch: 0 + prerelease: 'dev' + buildmetadata: '' + commit: '' git_absorb: git-local format: '{$major}.{$minor}.{$patch}' build: mode: number length: 6 - increment_by: 1 - number: 180212-2f8a69 + number: git_absorb: git-local git: git-local: 'git rev-parse --verify HEAD' diff --git a/docker-compose.yml b/docker-compose.yml index 8f35a4fc..5a1ad1e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,9 @@ version: '3' services: app: + # For your own docker-compose, use `image: phpvms:latest` instead of the build/context block build: - context: ./resources/docker/php + context: . environment: DB_HOST: mysql REDIS_HOST: redis diff --git a/intellij_style.xml b/intellij_style.xml index 903cf02a..3fc35b05 100644 --- a/intellij_style.xml +++ b/intellij_style.xml @@ -1,16 +1,15 @@ - - +