From 57bd2be885fddb51314a3bf710bd3e6fba0a997d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 12 Aug 2020 04:16:41 +0800 Subject: [PATCH] Initial commit --- .editorconfig | 15 + .env.example | 48 + .gitattributes | 5 + .gitignore | 13 + .styleci.yml | 13 + README.md | 79 + .../CodeGenerator/Commands/BaseCommand.php | 277 +++ .../Commands/RollbackGeneratorCommand.php | 187 ++ .../Scaffold/MicroGeneratorCommand.php | 91 + .../Scaffold/ScaffoldGeneratorCommand.php | 96 + .../CodeGenerator/Common/CommandData.php | 294 +++ .../CodeGenerator/Common/GenerateGetters.php | 26 + .../CodeGenerator/Common/GeneratorConfig.php | 413 ++++ .../CodeGenerator/Common/GeneratorField.php | 173 ++ .../Common/GeneratorFieldRelation.php | 103 + .../CodeGenerator/Common/GeneratorHelpers.php | 78 + .../CodeGenerator/Common/TemplatesManager.php | 24 + .../Generators/BaseGenerator.php | 31 + .../Generators/FactoryGenerator.php | 119 + .../Micros/DataTransferObjectGenerator.php | 140 ++ .../Generators/Micros/ResourceGenerator.php | 75 + .../Generators/Micros/RulesGenerator.php | 68 + .../Generators/Micros/ServicesGenerator.php | 96 + .../Generators/Micros/ValidatorsGenerator.php | 112 + .../Generators/MigrationGenerator.php | 92 + .../Generators/ModelGenerator.php | 351 +++ .../Scaffold/ControllerLogicGenerator.php | 83 + .../Scaffold/ControllersGenerator.php | 64 + .../Generators/Scaffold/RoutesGenerator.php | 55 + .../Generators/Scaffold/ViewsGenerator.php | 53 + .../Generators/Scaffold/VueGenerator.php | 196 ++ .../Generators/Scaffold/WebRouteGenerator.php | 55 + .../Generators/SeederGenerator.php | 86 + .../CodeGenerator/Schemas/addresses.json | 102 + .../CodeGenerator/Schemas/companies.json | 35 + .../CodeGenerator/Schemas/contacts.json | 70 + .../CodeGenerator/Stubs/Docs/model.stub | 6 + .../Stubs/Factories/model_factory.stub | 12 + .../CodeGenerator/Stubs/Fields/date.stub | 1 + .../CodeGenerator/Stubs/Fields/email.stub | 1 + .../CodeGenerator/Stubs/Fields/field.stub | 8 + .../Stubs/Fields/filter_field.stub | 8 + .../CodeGenerator/Stubs/Fields/password.stub | 1 + .../CodeGenerator/Stubs/Fields/select.stub | 1 + .../Stubs/Fields/selectable.stub | 1 + .../CodeGenerator/Stubs/Fields/text.stub | 1 + .../CodeGenerator/Stubs/Fields/textarea.stub | 1 + .../Stubs/Micros/data_transfer_object.stub | 24 + .../Stubs/Micros/getter_function.stub | 7 + .../Stubs/Migration/migration.stub | 31 + .../CodeGenerator/Stubs/Models/model.stub | 44 + .../Stubs/Models/relationship.stub | 7 + .../Stubs/Resource/model_resource.stub | 22 + .../CodeGenerator/Stubs/Routes/route.stub | 15 + .../CodeGenerator/Stubs/Routes/web.stub | 5 + .../CodeGenerator/Stubs/Rules/can_create.stub | 57 + .../CodeGenerator/Stubs/Rules/can_delete.stub | 43 + .../CodeGenerator/Stubs/Rules/can_fetch.stub | 43 + .../CodeGenerator/Stubs/Rules/can_list.stub | 43 + .../CodeGenerator/Stubs/Rules/can_update.stub | 57 + .../Controllers/create_controller.stub | 20 + .../Controllers/delete_controller.stub | 20 + .../Controllers/fetch_controller.stub | 20 + .../Scaffold/Controllers/list_controller.stub | 20 + .../Controllers/update_controller.stub | 20 + .../create_controller_logic.stub | 69 + .../delete_controller_logic.stub | 73 + .../fetch_controller_logic.stub | 67 + .../list_controller_logic.stub | 66 + .../update_controller_logic.stub | 78 + .../Stubs/Seeds/model_seeder.stub | 16 + .../Stubs/Services/create_service.stub | 19 + .../Stubs/Services/delete_service.stub | 15 + .../Stubs/Services/fetch_service.stub | 33 + .../Stubs/Services/list_service.stub | 33 + .../Stubs/Services/update_service.stub | 19 + .../Stubs/Validator/request_validation.stub | 39 + .../CodeGenerator/Stubs/Views/column.stub | 16 + .../CodeGenerator/Stubs/Views/view.stub | 31 + .../Stubs/VueJs/element_component.stub | 41 + .../Stubs/VueJs/filter_component.stub | 49 + .../Stubs/VueJs/form_component.stub | 63 + .../CodeGenerator/Stubs/base_repository.stub | 193 ++ app/Classes/CodeGenerator/Utils/FileUtil.php | 37 + .../Utils/GeneratorFieldsInputUtil.php | 105 + .../Utils/HTMLFieldGenerator.php | 85 + .../CodeGenerator/Utils/ResponseUtil.php | 41 + .../CodeGenerator/Utils/SchemaUtil.php | 42 + .../Utils/TableFieldsGenerator.php | 541 +++++ .../Exceptions/AccessForbiddenException.php | 12 + .../AccessUnauthorisedException.php | 12 + app/Classes/Exceptions/ErrorException.php | 20 + .../InternalServerErrorException.php | 12 + .../Exceptions/MalformedRequestException.php | 11 + .../Exceptions/RequestValidationException.php | 11 + .../Exceptions/ResourceConflictException.php | 12 + .../Exceptions/ResourceNotFoundException.php | 11 + .../Exceptions/ServiceApiException.php | 11 + .../Abstracts/AbstractControllerLogic.php | 87 + .../General/Abstracts/AbstractRule.php | 46 + .../General/Abstracts/AbstractService.php | 42 + .../General/Abstracts/AbstractValidation.php | 49 + .../General/Eloquent/AbstractDeleteRecord.php | 32 + .../General/Eloquent/AbstractFetchRecord.php | 37 + .../General/Eloquent/AbstractGetRecord.php | 70 + .../General/Eloquent/AbstractListRecord.php | 49 + .../General/Eloquent/AbstractUpdateRecord.php | 31 + .../General/Eloquent/ApplyFiltersToQuery.php | 41 + .../General/Eloquent/Filters/Active.php | 20 + .../General/Eloquent/Filters/Email.php | 20 + .../General/Eloquent/Filters/Filter.php | 19 + app/Classes/General/Eloquent/Filters/Id.php | 20 + .../General/Eloquent/Filters/Milestone.php | 21 + .../General/Eloquent/Filters/ModuleType.php | 21 + app/Classes/General/Eloquent/Filters/Name.php | 20 + .../General/Eloquent/Filters/ProjectType.php | 21 + .../General/Eloquent/Filters/Status.php | 20 + .../General/Eloquent/Filters/Token.php | 20 + .../General/Eloquent/Filters/UserName.php | 22 + .../General/Eloquent/Filters/WithUser.php | 20 + app/Classes/General/Wrapper/Hasher.php | 23 + app/Classes/Interfaces/DataTransferObject.php | 9 + .../Jobs/PasswordResetTokenExpiration.php | 43 + app/Classes/Jobs/SendResetPasswordEmail.php | 42 + .../AuthenticateUserLogic.php | 69 + .../ControllersLogic/CheckEmailLogic.php | 59 + .../GeneratePasswordResetLogic.php | 85 + .../ListUsersControllerLogic.php | 59 + .../ControllersLogic/ResetPasswordLogic.php | 83 + .../AuthenticationCredentialsObject.php | 59 + .../GeneratePasswordResetObject.php | 34 + .../DataTransferObjects/NewPasswordObject.php | 45 + .../PasswordResetObject.php | 44 + .../Accounts/Services/AuthenticatesUser.php | 27 + .../Services/AuthenticationRedirect.php | 19 + .../Accounts/Services/ChangesPassword.php | 32 + .../Services/CompletesPasswordReset.php | 35 + .../Services/ExpiresPasswordReset.php | 33 + .../Services/FetchesPasswordReset.php | 34 + .../Modules/Accounts/Services/FetchesUser.php | 33 + .../Services/GeneratesPasswordReset.php | 37 + .../Modules/Accounts/Services/ListsUsers.php | 33 + .../Criteria/PasswordResetTokenExists.php | 39 + .../Standards/Criteria/UserEmailExists.php | 40 + .../Standards/Rules/CanAuthenticateUser.php | 57 + .../Rules/CanGeneratePasswordReset.php | 65 + .../Accounts/Standards/Rules/CanListUsers.php | 46 + .../Standards/Rules/CanResetPassword.php | 65 + .../GeneratePasswordResetValidation.php | 42 + .../Validators/ResetPasswordValidation.php | 50 + .../UserAuthenticationValidation.php | 43 + .../CreateAddressControllerLogic.php | 69 + .../DeleteAddressControllerLogic.php | 73 + .../FetchAddressControllerLogic.php | 67 + .../ListAddressesControllerLogic.php | 66 + .../UpdateAddressControllerLogic.php | 78 + .../DataTransferObjects/AddressObject.php | 135 ++ .../Addresses/Services/CreatesAddress.php | 27 + .../Addresses/Services/DeletesAddress.php | 15 + .../Addresses/Services/FetchesAddress.php | 33 + .../Addresses/Services/ListsAddresses.php | 33 + .../Addresses/Services/UpdatesAddress.php | 27 + .../Standards/Rules/CanCreateAddress.php | 57 + .../Standards/Rules/CanDeleteAddress.php | 43 + .../Standards/Rules/CanFetchAddress.php | 43 + .../Standards/Rules/CanListAddresses.php | 43 + .../Standards/Rules/CanUpdateAddress.php | 57 + .../Validators/AddressValidation.php | 54 + .../CreateCompanyControllerLogic.php | 69 + .../DeleteCompanyControllerLogic.php | 73 + .../FetchCompanyControllerLogic.php | 67 + .../ListCompaniesControllerLogic.php | 66 + .../UpdateCompanyControllerLogic.php | 78 + .../DataTransferObjects/CompanyObject.php | 58 + .../Companies/Services/CreatesCompany.php | 21 + .../Companies/Services/DeletesCompany.php | 15 + .../Companies/Services/FetchesCompany.php | 33 + .../Companies/Services/ListsCompanies.php | 33 + .../Companies/Services/UpdatesCompany.php | 21 + .../Standards/Rules/CanCreateCompany.php | 57 + .../Standards/Rules/CanDeleteCompany.php | 43 + .../Standards/Rules/CanFetchCompany.php | 43 + .../Standards/Rules/CanListCompanies.php | 43 + .../Standards/Rules/CanUpdateCompany.php | 57 + .../Validators/CompanyValidation.php | 43 + .../CreateContactControllerLogic.php | 70 + .../DeleteContactControllerLogic.php | 73 + .../FetchContactControllerLogic.php | 67 + .../ListContactsControllerLogic.php | 66 + .../UpdateContactControllerLogic.php | 78 + .../DataTransferObjects/ContactObject.php | 97 + .../Contacts/Services/CreatesContact.php | 24 + .../Contacts/Services/DeletesContact.php | 15 + .../Contacts/Services/FetchesContact.php | 33 + .../Contacts/Services/ListsContacts.php | 33 + .../Contacts/Services/UpdatesContact.php | 24 + .../Standards/Rules/CanCreateContact.php | 57 + .../Standards/Rules/CanDeleteContact.php | 43 + .../Standards/Rules/CanFetchContact.php | 43 + .../Standards/Rules/CanListContacts.php | 43 + .../Standards/Rules/CanUpdateContact.php | 57 + .../Validators/ContactValidation.php | 45 + app/Classes/Notifications/AbstractEmail.php | 15 + .../Notifications/ResetPasswordEmail.php | 38 + .../ValueObjects/Constants/AccountStatus.php | 20 + .../ValueObjects/Constants/HttpStatus.php | 29 + .../ValueObjects/Constants/ModularTypes.php | 26 + .../ValueObjects/Constants/Notifications.php | 29 + app/Classes/ValueObjects/Constants/Roles.php | 20 + .../Response/ApiResponseObject.php | 79 + app/Console/Kernel.php | 46 + app/Exceptions/Handler.php | 67 + .../Authentication/CheckEmailController.php | 21 + .../GeneratePasswordResetController.php | 22 + .../ResetPasswordController.php | 22 + .../UserAuthenticationController.php | 21 + .../Account/User/ListUsersController.php | 30 + .../Addresses/CreateAddressController.php | 20 + .../Addresses/DeleteAddressController.php | 20 + .../Addresses/FetchAddressController.php | 20 + .../Addresses/ListAddressesController.php | 20 + .../Addresses/UpdateAddressController.php | 20 + .../Companies/CreateCompanyController.php | 20 + .../Companies/DeleteCompanyController.php | 20 + .../Companies/FetchCompanyController.php | 20 + .../Companies/ListCompaniesController.php | 20 + .../Companies/UpdateCompanyController.php | 20 + .../Contacts/CreateContactController.php | 20 + .../Contacts/DeleteContactController.php | 20 + .../Contacts/FetchContactController.php | 20 + .../Contacts/ListContactsController.php | 20 + .../Contacts/UpdateContactController.php | 20 + app/Http/Controllers/Controller.php | 13 + .../Controllers/Orders/OrderController.php | 17 + app/Http/Kernel.php | 76 + app/Http/Middleware/Authenticate.php | 21 + .../Middleware/CheckForMaintenanceMode.php | 17 + app/Http/Middleware/EncryptCookies.php | 17 + .../Middleware/RedirectIfAuthenticated.php | 27 + app/Http/Middleware/TrimStrings.php | 18 + app/Http/Middleware/TrustHosts.php | 20 + app/Http/Middleware/TrustProxies.php | 23 + app/Http/Middleware/ValidateToken.php | 30 + app/Http/Middleware/VerifyCsrfToken.php | 17 + app/Http/Resources/AddressResource.php | 30 + app/Http/Resources/CompanyResource.php | 27 + app/Http/Resources/ContactResource.php | 27 + app/Http/Resources/UserResource.php | 23 + app/Models/AbstractModel.php | 13 + app/Models/Address.php | 85 + app/Models/Company.php | 71 + app/Models/Contact.php | 74 + app/Models/Order.php | 46 + app/Models/PasswordReset.php | 22 + app/Models/User.php | 76 + app/Providers/AppServiceProvider.php | 29 + app/Providers/AuthServiceProvider.php | 30 + app/Providers/BroadcastServiceProvider.php | 21 + app/Providers/EventServiceProvider.php | 34 + app/Providers/RouteServiceProvider.php | 80 + artisan | 53 + bootstrap/app.php | 55 + bootstrap/cache/.gitignore | 2 + composer.json | 66 + config/activitylog.php | 52 + config/app.php | 232 ++ config/auth.php | 117 + config/broadcasting.php | 59 + config/cache.php | 104 + config/cors.php | 34 + config/database.php | 147 ++ config/filesystems.php | 85 + config/hashing.php | 52 + config/logging.php | 104 + config/mail.php | 110 + config/queue.php | 89 + config/services.php | 33 + config/session.php | 201 ++ config/view.php | 36 + database/.gitignore | 2 + database/factories/AddressFactory.php | 20 + database/factories/CompanyFactory.php | 14 + database/factories/ContactFactory.php | 17 + database/factories/UserFactory.php | 30 + .../2014_10_12_000000_create_users_table.php | 39 + ..._08_19_000000_create_failed_jobs_table.php | 35 + ...30_022600_create_password_resets_table.php | 37 + .../2020_07_30_022724_create_jobs_table.php | 35 + ...07_30_023042_create_activity_log_table.php | 42 + ...20_08_04_042142_create_companies_table.php | 37 + ...20_08_04_043647_create_addresses_table.php | 45 + .../2020_08_05_223808_create_order_table.php | 43 + ...020_08_05_224625_create_contacts_table.php | 40 + .../2020_08_06_035532_create_orders_table.php | 43 + ...6_035655_create_order_warehouses_table.php | 36 + database/seeds/AddressesTableSeeder.php | 16 + database/seeds/CompaniesTableSeeder.php | 16 + database/seeds/ContactsTableSeeder.php | 16 + database/seeds/DatabaseSeeder.php | 17 + database/seeds/UsersTableSeeder.php | 41 + gulpfile.js | 101 + package.json | 120 + phpunit.xml | 31 + public/.htaccess | 21 + public/favicon.ico | 0 public/index.php | 60 + public/robots.txt | 2 + public/web.config | 28 + .../fonts/montserrat/Montserrat-Bold.ttf | Bin 0 -> 54864 bytes .../fonts/montserrat/Montserrat-Regular.ttf | Bin 0 -> 54988 bytes .../montserrat/montserrat-bold-webfont.svg | 1462 +++++++++++ .../montserrat/montserrat-regular-webfont.svg | 1317 ++++++++++ resources/assets/images/accounts-graphic.png | Bin 0 -> 72579 bytes .../images/admin-dashboard-illustration.png | Bin 0 -> 98650 bytes resources/assets/images/favicon.png | Bin 0 -> 5174 bytes .../images/favicon/android-icon-144x144.png | Bin 0 -> 14321 bytes .../images/favicon/android-icon-192x192.png | Bin 0 -> 19455 bytes .../images/favicon/android-icon-36x36.png | Bin 0 -> 2461 bytes .../images/favicon/android-icon-48x48.png | Bin 0 -> 3360 bytes .../images/favicon/android-icon-72x72.png | Bin 0 -> 5551 bytes .../images/favicon/android-icon-96x96.png | Bin 0 -> 8062 bytes .../images/favicon/apple-icon-114x114.png | Bin 0 -> 10394 bytes .../images/favicon/apple-icon-120x120.png | Bin 0 -> 11100 bytes .../images/favicon/apple-icon-144x144.png | Bin 0 -> 14321 bytes .../images/favicon/apple-icon-152x152.png | Bin 0 -> 15291 bytes .../images/favicon/apple-icon-180x180.png | Bin 0 -> 19070 bytes .../images/favicon/apple-icon-57x57.png | Bin 0 -> 4135 bytes .../images/favicon/apple-icon-60x60.png | Bin 0 -> 4350 bytes .../images/favicon/apple-icon-72x72.png | Bin 0 -> 5551 bytes .../images/favicon/apple-icon-76x76.png | Bin 0 -> 5921 bytes .../images/favicon/apple-icon-precomposed.png | Bin 0 -> 20029 bytes .../assets/images/favicon/apple-icon.png | Bin 0 -> 20029 bytes .../assets/images/favicon/browserconfig.xml | 2 + .../assets/images/favicon/favicon-16x16.png | Bin 0 -> 1404 bytes .../assets/images/favicon/favicon-32x32.png | Bin 0 -> 2170 bytes .../assets/images/favicon/favicon-96x96.png | Bin 0 -> 8062 bytes resources/assets/images/favicon/favicon.ico | Bin 0 -> 1150 bytes resources/assets/images/favicon/manifest.json | 41 + .../assets/images/favicon/ms-icon-144x144.png | Bin 0 -> 14321 bytes .../assets/images/favicon/ms-icon-150x150.png | Bin 0 -> 15063 bytes .../assets/images/favicon/ms-icon-310x310.png | Bin 0 -> 40812 bytes .../assets/images/favicon/ms-icon-70x70.png | Bin 0 -> 5323 bytes resources/assets/images/guangzhou-map.png | Bin 0 -> 24829 bytes .../assets/images/icons/packing-icon.png | Bin 0 -> 13029 bytes resources/assets/images/icons/pdf.png | Bin 0 -> 7901 bytes .../assets/images/icons/processing-icon.png | Bin 0 -> 7860 bytes resources/assets/images/icons/xlsx.png | Bin 0 -> 64553 bytes resources/assets/images/login_bg.jpg | Bin 0 -> 2997312 bytes resources/assets/images/logo.png | Bin 0 -> 15926 bytes resources/assets/images/logo_white.png | Bin 0 -> 6152 bytes resources/assets/images/maintenance.png | Bin 0 -> 65389 bytes .../assets/images/not-found-illustration.png | Bin 0 -> 29701 bytes resources/assets/images/profile_black.png | Bin 0 -> 17884 bytes resources/assets/images/profile_white.png | Bin 0 -> 17136 bytes .../assets/images/search-illustration.png | Bin 0 -> 54648 bytes resources/assets/images/shipping_bg.jpeg | Bin 0 -> 426713 bytes resources/assets/images/top-banner.jpg | Bin 0 -> 28683 bytes resources/assets/images/user-illustration.png | Bin 0 -> 21201 bytes resources/assets/images/yiwu-map.png | Bin 0 -> 19721 bytes resources/assets/js/pages.js | 2048 ++++++++++++++++ resources/assets/js/route.js | 16 + resources/assets/js/scripts.js | 41 + resources/assets/js/three.r92.min.js | 927 +++++++ resources/assets/js/vanta.birds.min.js | 1 + resources/assets/sass/_color.scss | 543 +++++ resources/assets/sass/_mixins.scss | 903 +++++++ resources/assets/sass/_modules.scss | 96 + resources/assets/sass/_responsive.scss | 1134 +++++++++ resources/assets/sass/_var.scss | 168 ++ resources/assets/sass/main.scss | 40 + resources/assets/sass/modules/_alerts.scss | 93 + resources/assets/sass/modules/_animation.scss | 112 + resources/assets/sass/modules/_buttons.scss | 642 +++++ resources/assets/sass/modules/_calendar.scss | 719 ++++++ resources/assets/sass/modules/_cards.scss | 410 ++++ resources/assets/sass/modules/_charts.scss | 367 +++ resources/assets/sass/modules/_chat.scss | 81 + resources/assets/sass/modules/_email.scss | 150 ++ .../assets/sass/modules/_form_elements.scss | 2142 +++++++++++++++++ resources/assets/sass/modules/_gallery.scss | 255 ++ resources/assets/sass/modules/_layout.scss | 2115 ++++++++++++++++ resources/assets/sass/modules/_list.scss | 210 ++ .../assets/sass/modules/_lock_screen.scss | 92 + resources/assets/sass/modules/_login.scss | 71 + resources/assets/sass/modules/_misc.scss | 718 ++++++ resources/assets/sass/modules/_modals.scss | 278 +++ resources/assets/sass/modules/_nestables.scss | 84 + .../assets/sass/modules/_notifications.scss | 675 ++++++ resources/assets/sass/modules/_print.scss | 32 + .../sass/modules/_progress_indicators.scss | 225 ++ resources/assets/sass/modules/_sliders.scss | 313 +++ resources/assets/sass/modules/_social.scss | 450 ++++ resources/assets/sass/modules/_tables.scss | 416 ++++ .../assets/sass/modules/_tabs_accordian.scss | 756 ++++++ resources/assets/sass/modules/_timeline.scss | 521 ++++ resources/assets/sass/modules/_treeview.scss | 36 + .../assets/sass/modules/_typography.scss | 856 +++++++ .../assets/sass/modules/_vector_map.scss | 144 ++ resources/assets/sass/modules/_view.scss | 116 + resources/assets/sass/modules/_widgets.scss | 472 ++++ resources/assets/sass/modules/_z_index.scss | 24 + resources/assets/vue/app.js | 70 + .../address/forms/AddressFormComponent.vue | 115 + .../forms/ForgetPasswordFormComponent.vue | 71 + .../forms/LoginFormComponent.vue | 110 + .../forms/RegistrationFormComponent.vue | 239 ++ .../forms/ResetPasswordFormComponent.vue | 103 + .../sections/LoginSectionComponent.vue | 119 + .../CompanyProfileSectionComponent.vue | 398 +++ .../sections/OnboardingSectionComponent.vue | 144 ++ .../general/elements/ListComponent.vue | 115 + .../general/elements/LoadingComponent.vue | 34 + .../general/elements/ModalComponent.vue | 33 + .../general/elements/PaginationComponent.vue | 63 + .../general/elements/SearchComponent.vue | 51 + .../general/elements/TransitionComponent.vue | 58 + .../elements/ValidationErrorComponent.vue | 32 + .../general/forms/ModalFormComponent.vue | 27 + .../general/forms/SelectComponent.vue | 54 + .../forms/ValidationErrorComponent.vue | 32 + .../forms/ValidationWrapperComponent.vue | 26 + .../order/elements/OrderComponent.vue | 266 ++ .../order/forms/OrderFormComponent.vue | 110 + .../user/elements/UserComponent.vue | 105 + .../user/forms/UserFiltersComponent.vue | 39 + resources/assets/vue/mixins/crudMixin.js | 50 + resources/assets/vue/mixins/requestMixin.js | 48 + .../assets/vue/vuex/modules/authentication.js | 29 + .../vue/vuex/modules/createNotification.js | 15 + .../assets/vue/vuex/modules/crudRequest.js | 17 + .../vue/vuex/modules/loadRequestQueue.js | 71 + .../assets/vue/vuex/modules/toggleLoading.js | 26 + .../assets/vue/vuex/modules/toggleSection.js | 29 + resources/assets/vue/vuex/store.js | 21 + resources/lang/en/auth.php | 19 + resources/lang/en/pagination.php | 19 + resources/lang/en/passwords.php | 21 + resources/lang/en/validation.php | 151 ++ .../emails/account/layout/base.blade.php | 135 ++ .../emails/account/layout/header.blade.php | 5 + .../emails/account/reset_password.blade.php | 11 + resources/views/layouts/base.blade.php | 13 + resources/views/layouts/base_login.blade.php | 42 + resources/views/layouts/base_portal.blade.php | 15 + .../accounts/authentication/login.blade.php | 107 + .../authentication/reset_password.blade.php | 74 + .../views/pages/accounts/dashboard.blade.php | 277 +++ .../companies/importer_profile.blade.php | 9 + .../views/pages/errors/maintenance.blade.php | 27 + resources/views/partials/footer.blade.php | 11 + resources/views/partials/header.blade.php | 69 + resources/views/partials/menu.blade.php | 74 + resources/views/vendor/head.blade.php | 23 + resources/views/vendor/js.blade.php | 12 + resources/views/welcome.blade.php | 0 routes/account.php | 25 + routes/api.php | 23 + routes/channels.php | 18 + routes/console.php | 19 + routes/crud.php | 44 + routes/web.php | 30 + server.php | 21 + storage/app/.gitignore | 3 + storage/app/public/.gitignore | 2 + storage/framework/.gitignore | 8 + storage/framework/cache/.gitignore | 3 + storage/framework/cache/data/.gitignore | 2 + storage/framework/sessions/.gitignore | 2 + storage/framework/testing/.gitignore | 2 + storage/framework/views/.gitignore | 2 + storage/logs/.gitignore | 2 + tests/CreatesApplication.php | 22 + tests/Feature/ExampleTest.php | 21 + tests/TestCase.php | 10 + tests/Unit/ExampleTest.php | 18 + webpack.mix.js | 14 + 476 files changed, 41783 insertions(+) create mode 100644 .editorconfig create mode 100644 .env.example create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .styleci.yml create mode 100644 README.md create mode 100644 app/Classes/CodeGenerator/Commands/BaseCommand.php create mode 100644 app/Classes/CodeGenerator/Commands/RollbackGeneratorCommand.php create mode 100644 app/Classes/CodeGenerator/Commands/Scaffold/MicroGeneratorCommand.php create mode 100644 app/Classes/CodeGenerator/Commands/Scaffold/ScaffoldGeneratorCommand.php create mode 100644 app/Classes/CodeGenerator/Common/CommandData.php create mode 100644 app/Classes/CodeGenerator/Common/GenerateGetters.php create mode 100644 app/Classes/CodeGenerator/Common/GeneratorConfig.php create mode 100644 app/Classes/CodeGenerator/Common/GeneratorField.php create mode 100644 app/Classes/CodeGenerator/Common/GeneratorFieldRelation.php create mode 100644 app/Classes/CodeGenerator/Common/GeneratorHelpers.php create mode 100644 app/Classes/CodeGenerator/Common/TemplatesManager.php create mode 100644 app/Classes/CodeGenerator/Generators/BaseGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/FactoryGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Micros/DataTransferObjectGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Micros/ResourceGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Micros/RulesGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Micros/ServicesGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Micros/ValidatorsGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/MigrationGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/ModelGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/ControllerLogicGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/ControllersGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/RoutesGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/ViewsGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/VueGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/Scaffold/WebRouteGenerator.php create mode 100644 app/Classes/CodeGenerator/Generators/SeederGenerator.php create mode 100644 app/Classes/CodeGenerator/Schemas/addresses.json create mode 100644 app/Classes/CodeGenerator/Schemas/companies.json create mode 100644 app/Classes/CodeGenerator/Schemas/contacts.json create mode 100644 app/Classes/CodeGenerator/Stubs/Docs/model.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Factories/model_factory.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/date.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/email.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/field.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/filter_field.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/password.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/select.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/selectable.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/text.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Fields/textarea.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Micros/data_transfer_object.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Micros/getter_function.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Migration/migration.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Models/model.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Models/relationship.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Resource/model_resource.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Routes/route.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Routes/web.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Rules/can_create.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Rules/can_delete.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Rules/can_fetch.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Rules/can_list.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Rules/can_update.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/create_controller.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/delete_controller.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/fetch_controller.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/list_controller.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/update_controller.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/create_controller_logic.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/delete_controller_logic.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/fetch_controller_logic.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/list_controller_logic.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/update_controller_logic.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Seeds/model_seeder.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Services/create_service.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Services/delete_service.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Services/fetch_service.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Services/list_service.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Services/update_service.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Validator/request_validation.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Views/column.stub create mode 100644 app/Classes/CodeGenerator/Stubs/Views/view.stub create mode 100644 app/Classes/CodeGenerator/Stubs/VueJs/element_component.stub create mode 100644 app/Classes/CodeGenerator/Stubs/VueJs/filter_component.stub create mode 100644 app/Classes/CodeGenerator/Stubs/VueJs/form_component.stub create mode 100644 app/Classes/CodeGenerator/Stubs/base_repository.stub create mode 100644 app/Classes/CodeGenerator/Utils/FileUtil.php create mode 100644 app/Classes/CodeGenerator/Utils/GeneratorFieldsInputUtil.php create mode 100644 app/Classes/CodeGenerator/Utils/HTMLFieldGenerator.php create mode 100644 app/Classes/CodeGenerator/Utils/ResponseUtil.php create mode 100644 app/Classes/CodeGenerator/Utils/SchemaUtil.php create mode 100644 app/Classes/CodeGenerator/Utils/TableFieldsGenerator.php create mode 100644 app/Classes/Exceptions/AccessForbiddenException.php create mode 100644 app/Classes/Exceptions/AccessUnauthorisedException.php create mode 100644 app/Classes/Exceptions/ErrorException.php create mode 100644 app/Classes/Exceptions/InternalServerErrorException.php create mode 100644 app/Classes/Exceptions/MalformedRequestException.php create mode 100644 app/Classes/Exceptions/RequestValidationException.php create mode 100644 app/Classes/Exceptions/ResourceConflictException.php create mode 100644 app/Classes/Exceptions/ResourceNotFoundException.php create mode 100644 app/Classes/Exceptions/ServiceApiException.php create mode 100644 app/Classes/General/Abstracts/AbstractControllerLogic.php create mode 100644 app/Classes/General/Abstracts/AbstractRule.php create mode 100644 app/Classes/General/Abstracts/AbstractService.php create mode 100644 app/Classes/General/Abstracts/AbstractValidation.php create mode 100644 app/Classes/General/Eloquent/AbstractDeleteRecord.php create mode 100644 app/Classes/General/Eloquent/AbstractFetchRecord.php create mode 100644 app/Classes/General/Eloquent/AbstractGetRecord.php create mode 100644 app/Classes/General/Eloquent/AbstractListRecord.php create mode 100644 app/Classes/General/Eloquent/AbstractUpdateRecord.php create mode 100644 app/Classes/General/Eloquent/ApplyFiltersToQuery.php create mode 100644 app/Classes/General/Eloquent/Filters/Active.php create mode 100644 app/Classes/General/Eloquent/Filters/Email.php create mode 100644 app/Classes/General/Eloquent/Filters/Filter.php create mode 100644 app/Classes/General/Eloquent/Filters/Id.php create mode 100644 app/Classes/General/Eloquent/Filters/Milestone.php create mode 100644 app/Classes/General/Eloquent/Filters/ModuleType.php create mode 100644 app/Classes/General/Eloquent/Filters/Name.php create mode 100644 app/Classes/General/Eloquent/Filters/ProjectType.php create mode 100644 app/Classes/General/Eloquent/Filters/Status.php create mode 100644 app/Classes/General/Eloquent/Filters/Token.php create mode 100644 app/Classes/General/Eloquent/Filters/UserName.php create mode 100644 app/Classes/General/Eloquent/Filters/WithUser.php create mode 100644 app/Classes/General/Wrapper/Hasher.php create mode 100644 app/Classes/Interfaces/DataTransferObject.php create mode 100644 app/Classes/Jobs/PasswordResetTokenExpiration.php create mode 100644 app/Classes/Jobs/SendResetPasswordEmail.php create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/AuthenticateUserLogic.php create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/CheckEmailLogic.php create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/GeneratePasswordResetLogic.php create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/ListUsersControllerLogic.php create mode 100644 app/Classes/Modules/Accounts/ControllersLogic/ResetPasswordLogic.php create mode 100644 app/Classes/Modules/Accounts/DataTransferObjects/AuthenticationCredentialsObject.php create mode 100644 app/Classes/Modules/Accounts/DataTransferObjects/GeneratePasswordResetObject.php create mode 100644 app/Classes/Modules/Accounts/DataTransferObjects/NewPasswordObject.php create mode 100644 app/Classes/Modules/Accounts/DataTransferObjects/PasswordResetObject.php create mode 100644 app/Classes/Modules/Accounts/Services/AuthenticatesUser.php create mode 100644 app/Classes/Modules/Accounts/Services/AuthenticationRedirect.php create mode 100644 app/Classes/Modules/Accounts/Services/ChangesPassword.php create mode 100644 app/Classes/Modules/Accounts/Services/CompletesPasswordReset.php create mode 100644 app/Classes/Modules/Accounts/Services/ExpiresPasswordReset.php create mode 100644 app/Classes/Modules/Accounts/Services/FetchesPasswordReset.php create mode 100644 app/Classes/Modules/Accounts/Services/FetchesUser.php create mode 100644 app/Classes/Modules/Accounts/Services/GeneratesPasswordReset.php create mode 100644 app/Classes/Modules/Accounts/Services/ListsUsers.php create mode 100644 app/Classes/Modules/Accounts/Standards/Criteria/PasswordResetTokenExists.php create mode 100644 app/Classes/Modules/Accounts/Standards/Criteria/UserEmailExists.php create mode 100644 app/Classes/Modules/Accounts/Standards/Rules/CanAuthenticateUser.php create mode 100644 app/Classes/Modules/Accounts/Standards/Rules/CanGeneratePasswordReset.php create mode 100644 app/Classes/Modules/Accounts/Standards/Rules/CanListUsers.php create mode 100644 app/Classes/Modules/Accounts/Standards/Rules/CanResetPassword.php create mode 100644 app/Classes/Modules/Accounts/Standards/Validators/GeneratePasswordResetValidation.php create mode 100644 app/Classes/Modules/Accounts/Standards/Validators/ResetPasswordValidation.php create mode 100644 app/Classes/Modules/Accounts/Standards/Validators/UserAuthenticationValidation.php create mode 100644 app/Classes/Modules/Addresses/ControllerLogic/CreateAddressControllerLogic.php create mode 100644 app/Classes/Modules/Addresses/ControllerLogic/DeleteAddressControllerLogic.php create mode 100644 app/Classes/Modules/Addresses/ControllerLogic/FetchAddressControllerLogic.php create mode 100644 app/Classes/Modules/Addresses/ControllerLogic/ListAddressesControllerLogic.php create mode 100644 app/Classes/Modules/Addresses/ControllerLogic/UpdateAddressControllerLogic.php create mode 100644 app/Classes/Modules/Addresses/DataTransferObjects/AddressObject.php create mode 100644 app/Classes/Modules/Addresses/Services/CreatesAddress.php create mode 100644 app/Classes/Modules/Addresses/Services/DeletesAddress.php create mode 100644 app/Classes/Modules/Addresses/Services/FetchesAddress.php create mode 100644 app/Classes/Modules/Addresses/Services/ListsAddresses.php create mode 100644 app/Classes/Modules/Addresses/Services/UpdatesAddress.php create mode 100644 app/Classes/Modules/Addresses/Standards/Rules/CanCreateAddress.php create mode 100644 app/Classes/Modules/Addresses/Standards/Rules/CanDeleteAddress.php create mode 100644 app/Classes/Modules/Addresses/Standards/Rules/CanFetchAddress.php create mode 100644 app/Classes/Modules/Addresses/Standards/Rules/CanListAddresses.php create mode 100644 app/Classes/Modules/Addresses/Standards/Rules/CanUpdateAddress.php create mode 100644 app/Classes/Modules/Addresses/Standards/Validators/AddressValidation.php create mode 100644 app/Classes/Modules/Companies/ControllerLogic/CreateCompanyControllerLogic.php create mode 100644 app/Classes/Modules/Companies/ControllerLogic/DeleteCompanyControllerLogic.php create mode 100644 app/Classes/Modules/Companies/ControllerLogic/FetchCompanyControllerLogic.php create mode 100644 app/Classes/Modules/Companies/ControllerLogic/ListCompaniesControllerLogic.php create mode 100644 app/Classes/Modules/Companies/ControllerLogic/UpdateCompanyControllerLogic.php create mode 100644 app/Classes/Modules/Companies/DataTransferObjects/CompanyObject.php create mode 100644 app/Classes/Modules/Companies/Services/CreatesCompany.php create mode 100644 app/Classes/Modules/Companies/Services/DeletesCompany.php create mode 100644 app/Classes/Modules/Companies/Services/FetchesCompany.php create mode 100644 app/Classes/Modules/Companies/Services/ListsCompanies.php create mode 100644 app/Classes/Modules/Companies/Services/UpdatesCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanCreateCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanDeleteCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanFetchCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanListCompanies.php create mode 100644 app/Classes/Modules/Companies/Standards/Rules/CanUpdateCompany.php create mode 100644 app/Classes/Modules/Companies/Standards/Validators/CompanyValidation.php create mode 100644 app/Classes/Modules/Contacts/ControllerLogic/CreateContactControllerLogic.php create mode 100644 app/Classes/Modules/Contacts/ControllerLogic/DeleteContactControllerLogic.php create mode 100644 app/Classes/Modules/Contacts/ControllerLogic/FetchContactControllerLogic.php create mode 100644 app/Classes/Modules/Contacts/ControllerLogic/ListContactsControllerLogic.php create mode 100644 app/Classes/Modules/Contacts/ControllerLogic/UpdateContactControllerLogic.php create mode 100644 app/Classes/Modules/Contacts/DataTransferObjects/ContactObject.php create mode 100644 app/Classes/Modules/Contacts/Services/CreatesContact.php create mode 100644 app/Classes/Modules/Contacts/Services/DeletesContact.php create mode 100644 app/Classes/Modules/Contacts/Services/FetchesContact.php create mode 100644 app/Classes/Modules/Contacts/Services/ListsContacts.php create mode 100644 app/Classes/Modules/Contacts/Services/UpdatesContact.php create mode 100644 app/Classes/Modules/Contacts/Standards/Rules/CanCreateContact.php create mode 100644 app/Classes/Modules/Contacts/Standards/Rules/CanDeleteContact.php create mode 100644 app/Classes/Modules/Contacts/Standards/Rules/CanFetchContact.php create mode 100644 app/Classes/Modules/Contacts/Standards/Rules/CanListContacts.php create mode 100644 app/Classes/Modules/Contacts/Standards/Rules/CanUpdateContact.php create mode 100644 app/Classes/Modules/Contacts/Standards/Validators/ContactValidation.php create mode 100644 app/Classes/Notifications/AbstractEmail.php create mode 100644 app/Classes/Notifications/ResetPasswordEmail.php create mode 100644 app/Classes/ValueObjects/Constants/AccountStatus.php create mode 100644 app/Classes/ValueObjects/Constants/HttpStatus.php create mode 100644 app/Classes/ValueObjects/Constants/ModularTypes.php create mode 100644 app/Classes/ValueObjects/Constants/Notifications.php create mode 100644 app/Classes/ValueObjects/Constants/Roles.php create mode 100644 app/Classes/ValueObjects/Response/ApiResponseObject.php create mode 100644 app/Console/Kernel.php create mode 100644 app/Exceptions/Handler.php create mode 100644 app/Http/Controllers/Account/Authentication/CheckEmailController.php create mode 100644 app/Http/Controllers/Account/Authentication/GeneratePasswordResetController.php create mode 100644 app/Http/Controllers/Account/Authentication/ResetPasswordController.php create mode 100644 app/Http/Controllers/Account/Authentication/UserAuthenticationController.php create mode 100644 app/Http/Controllers/Account/User/ListUsersController.php create mode 100644 app/Http/Controllers/Addresses/CreateAddressController.php create mode 100644 app/Http/Controllers/Addresses/DeleteAddressController.php create mode 100644 app/Http/Controllers/Addresses/FetchAddressController.php create mode 100644 app/Http/Controllers/Addresses/ListAddressesController.php create mode 100644 app/Http/Controllers/Addresses/UpdateAddressController.php create mode 100644 app/Http/Controllers/Companies/CreateCompanyController.php create mode 100644 app/Http/Controllers/Companies/DeleteCompanyController.php create mode 100644 app/Http/Controllers/Companies/FetchCompanyController.php create mode 100644 app/Http/Controllers/Companies/ListCompaniesController.php create mode 100644 app/Http/Controllers/Companies/UpdateCompanyController.php create mode 100644 app/Http/Controllers/Contacts/CreateContactController.php create mode 100644 app/Http/Controllers/Contacts/DeleteContactController.php create mode 100644 app/Http/Controllers/Contacts/FetchContactController.php create mode 100644 app/Http/Controllers/Contacts/ListContactsController.php create mode 100644 app/Http/Controllers/Contacts/UpdateContactController.php create mode 100644 app/Http/Controllers/Controller.php create mode 100644 app/Http/Controllers/Orders/OrderController.php create mode 100644 app/Http/Kernel.php create mode 100644 app/Http/Middleware/Authenticate.php create mode 100644 app/Http/Middleware/CheckForMaintenanceMode.php create mode 100644 app/Http/Middleware/EncryptCookies.php create mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php create mode 100644 app/Http/Middleware/TrimStrings.php create mode 100644 app/Http/Middleware/TrustHosts.php create mode 100644 app/Http/Middleware/TrustProxies.php create mode 100644 app/Http/Middleware/ValidateToken.php create mode 100644 app/Http/Middleware/VerifyCsrfToken.php create mode 100644 app/Http/Resources/AddressResource.php create mode 100644 app/Http/Resources/CompanyResource.php create mode 100644 app/Http/Resources/ContactResource.php create mode 100644 app/Http/Resources/UserResource.php create mode 100644 app/Models/AbstractModel.php create mode 100644 app/Models/Address.php create mode 100644 app/Models/Company.php create mode 100644 app/Models/Contact.php create mode 100644 app/Models/Order.php create mode 100644 app/Models/PasswordReset.php create mode 100644 app/Models/User.php create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/Providers/AuthServiceProvider.php create mode 100644 app/Providers/BroadcastServiceProvider.php create mode 100644 app/Providers/EventServiceProvider.php create mode 100644 app/Providers/RouteServiceProvider.php create mode 100644 artisan create mode 100644 bootstrap/app.php create mode 100644 bootstrap/cache/.gitignore create mode 100644 composer.json create mode 100644 config/activitylog.php create mode 100644 config/app.php create mode 100644 config/auth.php create mode 100644 config/broadcasting.php create mode 100644 config/cache.php create mode 100644 config/cors.php create mode 100644 config/database.php create mode 100644 config/filesystems.php create mode 100644 config/hashing.php create mode 100644 config/logging.php create mode 100644 config/mail.php create mode 100644 config/queue.php create mode 100644 config/services.php create mode 100644 config/session.php create mode 100644 config/view.php create mode 100644 database/.gitignore create mode 100644 database/factories/AddressFactory.php create mode 100644 database/factories/CompanyFactory.php create mode 100644 database/factories/ContactFactory.php create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/2014_10_12_000000_create_users_table.php create mode 100644 database/migrations/2019_08_19_000000_create_failed_jobs_table.php create mode 100644 database/migrations/2020_07_30_022600_create_password_resets_table.php create mode 100644 database/migrations/2020_07_30_022724_create_jobs_table.php create mode 100644 database/migrations/2020_07_30_023042_create_activity_log_table.php create mode 100644 database/migrations/2020_08_04_042142_create_companies_table.php create mode 100644 database/migrations/2020_08_04_043647_create_addresses_table.php create mode 100644 database/migrations/2020_08_05_223808_create_order_table.php create mode 100644 database/migrations/2020_08_05_224625_create_contacts_table.php create mode 100644 database/migrations/2020_08_06_035532_create_orders_table.php create mode 100644 database/migrations/2020_08_06_035655_create_order_warehouses_table.php create mode 100644 database/seeds/AddressesTableSeeder.php create mode 100644 database/seeds/CompaniesTableSeeder.php create mode 100644 database/seeds/ContactsTableSeeder.php create mode 100644 database/seeds/DatabaseSeeder.php create mode 100644 database/seeds/UsersTableSeeder.php create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 phpunit.xml create mode 100644 public/.htaccess create mode 100644 public/favicon.ico create mode 100644 public/index.php create mode 100644 public/robots.txt create mode 100644 public/web.config create mode 100644 resources/assets/fonts/montserrat/Montserrat-Bold.ttf create mode 100644 resources/assets/fonts/montserrat/Montserrat-Regular.ttf create mode 100644 resources/assets/fonts/montserrat/montserrat-bold-webfont.svg create mode 100644 resources/assets/fonts/montserrat/montserrat-regular-webfont.svg create mode 100644 resources/assets/images/accounts-graphic.png create mode 100644 resources/assets/images/admin-dashboard-illustration.png create mode 100644 resources/assets/images/favicon.png create mode 100644 resources/assets/images/favicon/android-icon-144x144.png create mode 100644 resources/assets/images/favicon/android-icon-192x192.png create mode 100644 resources/assets/images/favicon/android-icon-36x36.png create mode 100644 resources/assets/images/favicon/android-icon-48x48.png create mode 100644 resources/assets/images/favicon/android-icon-72x72.png create mode 100644 resources/assets/images/favicon/android-icon-96x96.png create mode 100644 resources/assets/images/favicon/apple-icon-114x114.png create mode 100644 resources/assets/images/favicon/apple-icon-120x120.png create mode 100644 resources/assets/images/favicon/apple-icon-144x144.png create mode 100644 resources/assets/images/favicon/apple-icon-152x152.png create mode 100644 resources/assets/images/favicon/apple-icon-180x180.png create mode 100644 resources/assets/images/favicon/apple-icon-57x57.png create mode 100644 resources/assets/images/favicon/apple-icon-60x60.png create mode 100644 resources/assets/images/favicon/apple-icon-72x72.png create mode 100644 resources/assets/images/favicon/apple-icon-76x76.png create mode 100644 resources/assets/images/favicon/apple-icon-precomposed.png create mode 100644 resources/assets/images/favicon/apple-icon.png create mode 100644 resources/assets/images/favicon/browserconfig.xml create mode 100644 resources/assets/images/favicon/favicon-16x16.png create mode 100644 resources/assets/images/favicon/favicon-32x32.png create mode 100644 resources/assets/images/favicon/favicon-96x96.png create mode 100644 resources/assets/images/favicon/favicon.ico create mode 100644 resources/assets/images/favicon/manifest.json create mode 100644 resources/assets/images/favicon/ms-icon-144x144.png create mode 100644 resources/assets/images/favicon/ms-icon-150x150.png create mode 100644 resources/assets/images/favicon/ms-icon-310x310.png create mode 100644 resources/assets/images/favicon/ms-icon-70x70.png create mode 100644 resources/assets/images/guangzhou-map.png create mode 100644 resources/assets/images/icons/packing-icon.png create mode 100644 resources/assets/images/icons/pdf.png create mode 100644 resources/assets/images/icons/processing-icon.png create mode 100644 resources/assets/images/icons/xlsx.png create mode 100644 resources/assets/images/login_bg.jpg create mode 100644 resources/assets/images/logo.png create mode 100644 resources/assets/images/logo_white.png create mode 100644 resources/assets/images/maintenance.png create mode 100644 resources/assets/images/not-found-illustration.png create mode 100644 resources/assets/images/profile_black.png create mode 100644 resources/assets/images/profile_white.png create mode 100644 resources/assets/images/search-illustration.png create mode 100644 resources/assets/images/shipping_bg.jpeg create mode 100644 resources/assets/images/top-banner.jpg create mode 100644 resources/assets/images/user-illustration.png create mode 100644 resources/assets/images/yiwu-map.png create mode 100644 resources/assets/js/pages.js create mode 100644 resources/assets/js/route.js create mode 100644 resources/assets/js/scripts.js create mode 100644 resources/assets/js/three.r92.min.js create mode 100644 resources/assets/js/vanta.birds.min.js create mode 100644 resources/assets/sass/_color.scss create mode 100644 resources/assets/sass/_mixins.scss create mode 100644 resources/assets/sass/_modules.scss create mode 100644 resources/assets/sass/_responsive.scss create mode 100644 resources/assets/sass/_var.scss create mode 100644 resources/assets/sass/main.scss create mode 100644 resources/assets/sass/modules/_alerts.scss create mode 100644 resources/assets/sass/modules/_animation.scss create mode 100644 resources/assets/sass/modules/_buttons.scss create mode 100644 resources/assets/sass/modules/_calendar.scss create mode 100644 resources/assets/sass/modules/_cards.scss create mode 100644 resources/assets/sass/modules/_charts.scss create mode 100644 resources/assets/sass/modules/_chat.scss create mode 100644 resources/assets/sass/modules/_email.scss create mode 100644 resources/assets/sass/modules/_form_elements.scss create mode 100644 resources/assets/sass/modules/_gallery.scss create mode 100644 resources/assets/sass/modules/_layout.scss create mode 100644 resources/assets/sass/modules/_list.scss create mode 100644 resources/assets/sass/modules/_lock_screen.scss create mode 100644 resources/assets/sass/modules/_login.scss create mode 100644 resources/assets/sass/modules/_misc.scss create mode 100644 resources/assets/sass/modules/_modals.scss create mode 100644 resources/assets/sass/modules/_nestables.scss create mode 100644 resources/assets/sass/modules/_notifications.scss create mode 100644 resources/assets/sass/modules/_print.scss create mode 100644 resources/assets/sass/modules/_progress_indicators.scss create mode 100644 resources/assets/sass/modules/_sliders.scss create mode 100644 resources/assets/sass/modules/_social.scss create mode 100644 resources/assets/sass/modules/_tables.scss create mode 100644 resources/assets/sass/modules/_tabs_accordian.scss create mode 100644 resources/assets/sass/modules/_timeline.scss create mode 100644 resources/assets/sass/modules/_treeview.scss create mode 100644 resources/assets/sass/modules/_typography.scss create mode 100644 resources/assets/sass/modules/_vector_map.scss create mode 100644 resources/assets/sass/modules/_view.scss create mode 100644 resources/assets/sass/modules/_widgets.scss create mode 100644 resources/assets/sass/modules/_z_index.scss create mode 100644 resources/assets/vue/app.js create mode 100644 resources/assets/vue/components/address/forms/AddressFormComponent.vue create mode 100644 resources/assets/vue/components/authentication/forms/ForgetPasswordFormComponent.vue create mode 100644 resources/assets/vue/components/authentication/forms/LoginFormComponent.vue create mode 100644 resources/assets/vue/components/authentication/forms/RegistrationFormComponent.vue create mode 100644 resources/assets/vue/components/authentication/forms/ResetPasswordFormComponent.vue create mode 100644 resources/assets/vue/components/authentication/sections/LoginSectionComponent.vue create mode 100644 resources/assets/vue/components/company/sections/CompanyProfileSectionComponent.vue create mode 100644 resources/assets/vue/components/company/sections/OnboardingSectionComponent.vue create mode 100644 resources/assets/vue/components/general/elements/ListComponent.vue create mode 100644 resources/assets/vue/components/general/elements/LoadingComponent.vue create mode 100644 resources/assets/vue/components/general/elements/ModalComponent.vue create mode 100644 resources/assets/vue/components/general/elements/PaginationComponent.vue create mode 100644 resources/assets/vue/components/general/elements/SearchComponent.vue create mode 100644 resources/assets/vue/components/general/elements/TransitionComponent.vue create mode 100644 resources/assets/vue/components/general/elements/ValidationErrorComponent.vue create mode 100644 resources/assets/vue/components/general/forms/ModalFormComponent.vue create mode 100644 resources/assets/vue/components/general/forms/SelectComponent.vue create mode 100644 resources/assets/vue/components/general/forms/ValidationErrorComponent.vue create mode 100644 resources/assets/vue/components/general/forms/ValidationWrapperComponent.vue create mode 100644 resources/assets/vue/components/order/elements/OrderComponent.vue create mode 100644 resources/assets/vue/components/order/forms/OrderFormComponent.vue create mode 100644 resources/assets/vue/components/user/elements/UserComponent.vue create mode 100644 resources/assets/vue/components/user/forms/UserFiltersComponent.vue create mode 100644 resources/assets/vue/mixins/crudMixin.js create mode 100644 resources/assets/vue/mixins/requestMixin.js create mode 100644 resources/assets/vue/vuex/modules/authentication.js create mode 100644 resources/assets/vue/vuex/modules/createNotification.js create mode 100644 resources/assets/vue/vuex/modules/crudRequest.js create mode 100644 resources/assets/vue/vuex/modules/loadRequestQueue.js create mode 100644 resources/assets/vue/vuex/modules/toggleLoading.js create mode 100644 resources/assets/vue/vuex/modules/toggleSection.js create mode 100644 resources/assets/vue/vuex/store.js create mode 100644 resources/lang/en/auth.php create mode 100644 resources/lang/en/pagination.php create mode 100644 resources/lang/en/passwords.php create mode 100644 resources/lang/en/validation.php create mode 100644 resources/views/emails/account/layout/base.blade.php create mode 100644 resources/views/emails/account/layout/header.blade.php create mode 100644 resources/views/emails/account/reset_password.blade.php create mode 100644 resources/views/layouts/base.blade.php create mode 100644 resources/views/layouts/base_login.blade.php create mode 100644 resources/views/layouts/base_portal.blade.php create mode 100644 resources/views/pages/accounts/authentication/login.blade.php create mode 100644 resources/views/pages/accounts/authentication/reset_password.blade.php create mode 100644 resources/views/pages/accounts/dashboard.blade.php create mode 100644 resources/views/pages/companies/importer_profile.blade.php create mode 100644 resources/views/pages/errors/maintenance.blade.php create mode 100644 resources/views/partials/footer.blade.php create mode 100644 resources/views/partials/header.blade.php create mode 100644 resources/views/partials/menu.blade.php create mode 100644 resources/views/vendor/head.blade.php create mode 100644 resources/views/vendor/js.blade.php create mode 100644 resources/views/welcome.blade.php create mode 100644 routes/account.php create mode 100644 routes/api.php create mode 100644 routes/channels.php create mode 100644 routes/console.php create mode 100644 routes/crud.php create mode 100644 routes/web.php create mode 100644 server.php create mode 100644 storage/app/.gitignore create mode 100644 storage/app/public/.gitignore create mode 100644 storage/framework/.gitignore create mode 100644 storage/framework/cache/.gitignore create mode 100644 storage/framework/cache/data/.gitignore create mode 100644 storage/framework/sessions/.gitignore create mode 100644 storage/framework/testing/.gitignore create mode 100644 storage/framework/views/.gitignore create mode 100644 storage/logs/.gitignore create mode 100644 tests/CreatesApplication.php create mode 100644 tests/Feature/ExampleTest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/ExampleTest.php create mode 100644 webpack.mix.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..6537ca46 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..a0701a99 --- /dev/null +++ b/.env.example @@ -0,0 +1,48 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=laravel +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +JWT_SECRET= diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..967315dd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto +*.css linguist-vendored +*.scss linguist-vendored +*.js linguist-vendored +CHANGELOG.md export-ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..eec23d5b --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/node_modules +/public/hot +/public/storage +/storage/*.key +/vendor +**/.idea/ +.env +.env.backup +.phpunit.result.cache +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 00000000..1db61d96 --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,13 @@ +php: + preset: laravel + disabled: + - unused_use + finder: + not-name: + - index.php + - server.php +js: + finder: + not-name: + - webpack.mix.js +css: true diff --git a/README.md b/README.md new file mode 100644 index 00000000..3cae01ea --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +

+ +

+Build Status +Total Downloads +Latest Stable Version +License +

+ +## About Laravel + +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: + +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). + +Laravel is accessible, powerful, and provides tools required for large, robust applications. + +## Learning Laravel + +Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. + +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. + +## Laravel Sponsors + +We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). + +- **[Vehikl](https://vehikl.com/)** +- **[Tighten Co.](https://tighten.co)** +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** +- **[64 Robots](https://64robots.com)** +- **[Cubet Techno Labs](https://cubettech.com)** +- **[Cyber-Duck](https://cyber-duck.co.uk)** +- **[Many](https://www.many.co.uk)** +- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** +- **[DevSquad](https://devsquad.com)** +- [UserInsights](https://userinsights.com) +- [Fragrantica](https://www.fragrantica.com) +- [SOFTonSOFA](https://softonsofa.com/) +- [User10](https://user10.com) +- [Soumettre.fr](https://soumettre.fr/) +- [CodeBrisk](https://codebrisk.com) +- [1Forge](https://1forge.com) +- [TECPRESSO](https://tecpresso.co.jp/) +- [Runtime Converter](http://runtimeconverter.com/) +- [WebL'Agence](https://weblagence.com/) +- [Invoice Ninja](https://www.invoiceninja.com) +- [iMi digital](https://www.imi-digital.de/) +- [Earthlink](https://www.earthlink.ro/) +- [Steadfast Collective](https://steadfastcollective.com/) +- [We Are The Robots Inc.](https://watr.mx/) +- [Understand.io](https://www.understand.io/) +- [Abdel Elrafa](https://abdelelrafa.com) +- [Hyper Host](https://hyper.host) +- [Appoly](https://www.appoly.co.uk) +- [OP.GG](https://op.gg) +- [云软科技](http://www.yunruan.ltd/) + +## Contributing + +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). + +## Code of Conduct + +In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). + +## Security Vulnerabilities + +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. + +## License + +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Classes/CodeGenerator/Commands/BaseCommand.php b/app/Classes/CodeGenerator/Commands/BaseCommand.php new file mode 100644 index 00000000..e1f4c80c --- /dev/null +++ b/app/Classes/CodeGenerator/Commands/BaseCommand.php @@ -0,0 +1,277 @@ +composer = app()['composer']; + } + + public function handle() + { + $this->commandData->modelName = $this->argument('model'); + + $this->commandData->initCommandData(); + $this->commandData->getFields(); + } + + public function generateCommonItems() + { + if (!$this->commandData->getOption('fromTable')) { + $migrationGenerator = new MigrationGenerator($this->commandData); + $migrationGenerator->generate(); + } + + $modelGenerator = new ModelGenerator($this->commandData); + $modelGenerator->generate(); + + $factoryGenerator = new FactoryGenerator($this->commandData); + $factoryGenerator->generate(); + + $seederGenerator = new SeederGenerator($this->commandData); + $seederGenerator->generate(); + + if($this->confirm("\nDo you want to include this seeder to the main seeder? [y|N]", false)){ + $seederGenerator->updateMainSeeder(); + } + + } + + public function generateMicroItems() + { + $dataTransferObjectGenerator = new DataTransferObjectGenerator($this->commandData); + $dataTransferObjectGenerator->generate(); + + $serviceGenerator = new ServicesGenerator($this->commandData); + $serviceGenerator->generate(); + } + + public function generateScaffoldItems() + { + + $resourceGenerator = new ResourceGenerator($this->commandData); + $resourceGenerator->generate(); + + $validatorsGenerator = new ValidatorsGenerator($this->commandData); + $validatorsGenerator->generate(); + + $rulesGenerator = new RulesGenerator($this->commandData); + $rulesGenerator->generate(); + + if (!$this->isSkip('controllers') and !$this->isSkip('scaffold_controller')) { + $controllerLogicGenerator = new ControllerLogicGenerator($this->commandData); + $controllerLogicGenerator->generate(); + + $controllerGenerator = new ControllersGenerator($this->commandData); + $controllerGenerator->generate(); + + } + + $routesGenerator = new RoutesGenerator($this->commandData); + $routesGenerator->generate(); + +// $webRouteGenerator = new WebRouteGenerator($this->commandData); +// $webRouteGenerator->generate(); + } + + public function generateViews(){ + $viewGenerator = new ViewsGenerator($this->commandData); + $viewGenerator->generate(); + + $vueGenerator = new vueGenerator($this->commandData); + $vueGenerator->generate(); + + if($this->confirm("\nDo you want to compile your vue files? [y|N]", false)){ + shell_exec('yarn dev'); + } + } + + public function performPostActions($runMigration = false) + { + if ($this->commandData->getOption('save')) { + $this->saveSchemaFile(); + } + + if ($runMigration) { + if ($this->commandData->getOption('forceMigrate')) { + $this->runMigration(); + } elseif (!$this->commandData->getOption('fromTable') and !$this->isSkip('migration')) { + $requestFromConsole = (php_sapi_name() == 'cli') ? true : false; + if ($this->commandData->getOption('jsonFromGUI') && $requestFromConsole) { + $this->runMigration(); + } elseif ($requestFromConsole && $this->confirm("\nDo you want to migrate database? [y|N]", false)) { + $this->runMigration(); + } + } + } + + if (!$this->isSkip('dump-autoload')) { + $this->info('Generating autoload files'); + $this->composer->dumpOptimized(); + } + } + + public function runMigration() + { + $migrationPath = database_path('migrations/'); + $path = Str::after($migrationPath, base_path()); // get path after base_path + $this->call('migrate', ['--path' => $path, '--force' => true]); + + return true; + } + + public function isSkip($skip) + { + if ($this->commandData->getOption('skip')) { + return in_array($skip, (array) $this->commandData->getOption('skip')); + } + + return false; + } + + public function performPostActionsWithMigration() + { + $this->performPostActions(true); + } + + private function saveSchemaFile() + { + $fileFields = []; + + foreach ($this->commandData->fields as $field) { + $fileFields[] = [ + 'name' => $field->name, + 'dbType' => $field->dbInput, + 'htmlType' => $field->htmlInput, + 'validations' => $field->validations, + 'searchable' => $field->isSearchable, + 'fillable' => $field->isFillable, + 'primary' => $field->isPrimary, + 'inForm' => $field->inForm, + 'inIndex' => $field->inIndex, + 'inView' => $field->inView, + ]; + } + + foreach ($this->commandData->relations as $relation) { + $fileFields[] = [ + 'type' => 'relation', + 'relation' => $relation->type.','.implode(',', $relation->inputs), + ]; + } + + $path = app_path('Classes/CodeGenerator/Schemas/'); + + $fileName = $this->commandData->modelName.'.json'; + + if (file_exists($path.$fileName) && !$this->confirmOverwrite($fileName)) { + return; + } + FileUtil::createFile($path, $fileName, json_encode($fileFields, JSON_PRETTY_PRINT)); + $this->commandData->commandComment("\nSchema File saved: "); + $this->commandData->commandInfo($fileName); + } + + /** + * @param $fileName + * @param string $prompt + * + * @return bool + */ + protected function confirmOverwrite($fileName, $prompt = '') + { + $prompt = (empty($prompt)) + ? $fileName.' already exists. Do you want to overwrite it? [y|N]' + : $prompt; + + return $this->confirm($prompt, false); + } + + + /** + * Get the console command options. + * + * @return array + */ + public function getOptions() + { + return [ + ['fieldsFile', null, InputOption::VALUE_REQUIRED, 'Fields input as json file'], + ['jsonFromGUI', null, InputOption::VALUE_REQUIRED, 'Direct Json string while using GUI interface'], + ['plural', null, InputOption::VALUE_REQUIRED, 'Plural Model name'], + ['tableName', null, InputOption::VALUE_REQUIRED, 'Table Name'], + ['fromTable', null, InputOption::VALUE_NONE, 'Generate from existing table'], + ['ignoreFields', null, InputOption::VALUE_REQUIRED, 'Ignore fields while generating from table'], + ['save', null, InputOption::VALUE_NONE, 'Save model schema to file'], + ['primary', null, InputOption::VALUE_REQUIRED, 'Custom primary key'], + ['prefix', null, InputOption::VALUE_REQUIRED, 'Prefix for all files'], + ['paginate', null, InputOption::VALUE_REQUIRED, 'Pagination for index.blade.php'], + ['skip', null, InputOption::VALUE_REQUIRED, 'Skip Specific Items to Generate (migration,model,controllers,api_controller,scaffold_controller,repository,requests,api_requests,scaffold_requests,routes,api_routes,scaffold_routes,views,tests,menu,dump-autoload)'], + ['datatables', null, InputOption::VALUE_REQUIRED, 'Override datatables settings'], + ['views', null, InputOption::VALUE_REQUIRED, 'Specify only the views you want generated: index,create,edit,show'], + ['relations', null, InputOption::VALUE_NONE, 'Specify if you want to pass relationships for fields'], + ['softDelete', null, InputOption::VALUE_NONE, 'Soft Delete Option'], + ['forceMigrate', null, InputOption::VALUE_NONE, 'Specify if you want to run migration or not'], + ['factory', null, InputOption::VALUE_NONE, 'To generate factory'], + ['seeder', null, InputOption::VALUE_NONE, 'To generate seeder'], + ['localized', null, InputOption::VALUE_NONE, 'Localize files.'], + ['repositoryPattern', null, InputOption::VALUE_REQUIRED, 'Repository Pattern'], + ['connection', null, InputOption::VALUE_REQUIRED, 'Specify connection name'], + ]; + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return [ + ['model', InputArgument::REQUIRED, 'Singular Model name'], + ]; + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Commands/RollbackGeneratorCommand.php b/app/Classes/CodeGenerator/Commands/RollbackGeneratorCommand.php new file mode 100644 index 00000000..dd7552d1 --- /dev/null +++ b/app/Classes/CodeGenerator/Commands/RollbackGeneratorCommand.php @@ -0,0 +1,187 @@ +composer = app()['composer']; + } + + /** + * Execute the command. + * + * @return void + */ + public function handle() + { + if (!in_array($this->argument('type'), [ + 'scaffold', 'micro' + ])) { + $this->error('invalid rollback type'); + } + + $this->commandData = new CommandData($this, $this->argument('type')); + $this->commandData->config->mName = $this->commandData->modelName = $this->argument('model'); + + $this->commandData->config->init($this->commandData, ['tableName', 'prefix', 'plural', 'views']); + + $this->rollbackCommon(); + $this->rollbackMicros(); + + if($this->commandData->commandType === 'scaffold'){ + + $this->rollbackScaffold(); + $this->rollbackViews(); + + } + + + $this->info('Generating autoload files'); + $this->composer->dumpOptimized(); + } + + private function rollbackCommon(){ + $migrationGenerator = new MigrationGenerator($this->commandData); + $migrationGenerator->rollback(); + + $modelGenerator = new ModelGenerator($this->commandData); + $modelGenerator->rollback(); + + $factoryGenerator = new FactoryGenerator($this->commandData); + $factoryGenerator->rollback(); + + $seederGenerator = new SeederGenerator($this->commandData); + $seederGenerator->rollback(); + } + + private function rollbackMicros(){ + + $dataTransferObjectGenerator = new DataTransferObjectGenerator($this->commandData); + $dataTransferObjectGenerator->rollback(); + + $serviceGenerator = new ServicesGenerator($this->commandData); + $serviceGenerator->rollback(); + + } + + private function rollbackScaffold(){ + $resourceGenerator = new ResourceGenerator($this->commandData); + $resourceGenerator->rollback(); + + $validatorsGenerator = new ValidatorsGenerator($this->commandData); + $validatorsGenerator->rollback(); + + $rulesGenerator = new RulesGenerator($this->commandData); + $rulesGenerator->rollback(); + + File::deleteDirectories(app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/Standards/')); + + $routesGenerator = new RoutesGenerator($this->commandData); + $routesGenerator->rollback(); + + $webRouteGenerator = new WebRouteGenerator($this->commandData); + $webRouteGenerator->rollback(); + + $controllerGenerator = new ControllersGenerator($this->commandData); + $controllerGenerator->rollback(); + + $controllerLogicGenerator = new ControllerLogicGenerator($this->commandData); + $controllerLogicGenerator->rollback(); + + File::deleteDirectories(app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/')); + + } + + private function rollbackViews(){ + $viewGenerator = new ViewsGenerator($this->commandData); + $viewGenerator->rollback(); + + $vueGenerator = new vueGenerator($this->commandData); + $vueGenerator->rollback(); + } + + + + /** + * Get the console command options. + * + * @return array + */ + public function getOptions() + { + return [ + ['tableName', null, InputOption::VALUE_REQUIRED, 'Table Name'], + ['prefix', null, InputOption::VALUE_REQUIRED, 'Prefix for all files'], + ['plural', null, InputOption::VALUE_REQUIRED, 'Plural Model name'], + ['views', null, InputOption::VALUE_REQUIRED, 'Views to rollback'], + ]; + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return [ + ['model', InputArgument::REQUIRED, 'Singular Model name'], + ['type', InputArgument::REQUIRED, 'Rollback type: (micro / scaffold )'], + ]; + } + +} diff --git a/app/Classes/CodeGenerator/Commands/Scaffold/MicroGeneratorCommand.php b/app/Classes/CodeGenerator/Commands/Scaffold/MicroGeneratorCommand.php new file mode 100644 index 00000000..2964a6b1 --- /dev/null +++ b/app/Classes/CodeGenerator/Commands/Scaffold/MicroGeneratorCommand.php @@ -0,0 +1,91 @@ +commandData = new CommandData($this, 'micro'); + } + + /** + * Execute the command. + * + * @return void + */ + public function handle() + { + parent::handle(); + + if ($this->checkIsThereAnyDataToGenerate()) { + + $this->generateCommonItems(); + + $this->generateMicroItems(); + + $this->performPostActionsWithMigration(); + + } else { + + $this->commandData->commandInfo('There are not enough input fields for scaffold generation.'); + + } + } + + + /** + * Get the console command options. + * + * @return array + */ + public function getOptions() + { + return array_merge(parent::getOptions(), []); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return array_merge(parent::getArguments(), []); + } + + /** + * Check if there is anything to generate. + * + * @return bool + */ + protected function checkIsThereAnyDataToGenerate() + { + if (count($this->commandData->fields) > 1) { + return true; + } + } +} diff --git a/app/Classes/CodeGenerator/Commands/Scaffold/ScaffoldGeneratorCommand.php b/app/Classes/CodeGenerator/Commands/Scaffold/ScaffoldGeneratorCommand.php new file mode 100644 index 00000000..dc370e61 --- /dev/null +++ b/app/Classes/CodeGenerator/Commands/Scaffold/ScaffoldGeneratorCommand.php @@ -0,0 +1,96 @@ +commandData = new CommandData($this, 'scaffold'); + } + + /** + * Execute the command. + * + * @return void + */ + public function handle() + { + parent::handle(); + + if ($this->checkIsThereAnyDataToGenerate()) { + + + $this->generateCommonItems(); + + $this->generateMicroItems(); + + $this->generateScaffoldItems(); + +// $this->generateViews(); + + $this->performPostActionsWithMigration(); + + } else { + + $this->commandData->commandInfo('There are not enough input fields for scaffold generation.'); + + } + } + + + /** + * Get the console command options. + * + * @return array + */ + public function getOptions() + { + return array_merge(parent::getOptions(), []); + } + + /** + * Get the console command arguments. + * + * @return array + */ + protected function getArguments() + { + return array_merge(parent::getArguments(), []); + } + + /** + * Check if there is anything to generate. + * + * @return bool + */ + protected function checkIsThereAnyDataToGenerate() + { + if (count($this->commandData->fields) > 1) { + return true; + } + } +} diff --git a/app/Classes/CodeGenerator/Common/CommandData.php b/app/Classes/CodeGenerator/Common/CommandData.php new file mode 100644 index 00000000..a58cb978 --- /dev/null +++ b/app/Classes/CodeGenerator/Common/CommandData.php @@ -0,0 +1,294 @@ +templateManager; + } + + + /** + * @param Command $commandObj + * @param $commandType + * @param TemplatesManager $templatesManager + */ + public function __construct(Command $commandObj, $commandType, TemplatesManager $templatesManager = null) + { + $this->commandObj = $commandObj; + + if (is_null($templatesManager)) { + $this->templateManager = app(TemplatesManager::class); + } else { + $this->templateManager = $templatesManager; + } + + $this->commandType = $commandType; + + $this->fieldNamesMapping = [ + '$FIELD_NAME_TITLE$' => 'fieldTitle', + '$FIELD_NAME$' => 'name', + ]; + + $this->config = new GeneratorConfig(); + } + + public function commandError($error) + { + $this->commandObj->error($error); + } + + public function commandComment($message) + { + $this->commandObj->comment($message); + } + + public function commandWarn($warning) + { + $this->commandObj->warn($warning); + } + + public function commandInfo($message) + { + $this->commandObj->info($message); + } + + public function initCommandData() + { + $this->config->init($this); + } + + public function getOption($option) + { + return $this->config->getOption($option); + } + + public function getAddOn($option) + { + return $this->config->getAddOn($option); + } + + public function setOption($option, $value) + { + $this->config->setOption($option, $value); + } + + public function addDynamicVariable($name, $val) + { + $this->dynamicVars[$name] = $val; + } + + public function getFields() + { + $this->fields = []; + + if ($this->getOption('fieldsFile') or $this->getOption('jsonFromGUI')) { + $this->getInputFromFileOrJson(); + } elseif ($this->getOption('fromTable')) { + $this->getInputFromTable(); + } else { + $this->getInputFromConsole(); + } + } + + private function getInputFromConsole() + { + $this->commandInfo('Specify fields for the model (skip id & timestamp fields, we will add it automatically)'); + $this->commandInfo('Read docs carefully to specify field inputs)'); + $this->commandInfo('Enter "exit" to finish'); + + $this->addPrimaryKey(); + + while (true) { + $fieldInputStr = $this->commandObj->ask('Field: (name db_type html_type options)', ''); + + if (empty($fieldInputStr) || $fieldInputStr == false || $fieldInputStr == 'exit') { + break; + } + + if (!GeneratorFieldsInputUtil::validateFieldInput($fieldInputStr)) { + $this->commandError('Invalid Input. Try again'); + continue; + } + + $validations = $this->commandObj->ask('Enter validations: ', false); + $validations = ($validations == false) ? '' : $validations; + + if ($this->getOption('relations')) { + $relation = $this->commandObj->ask('Enter relationship (Leave Blank to skip):', false); + } else { + $relation = ''; + } + + $this->fields[] = GeneratorFieldsInputUtil::processFieldInput( + $fieldInputStr, + $validations + ); + + if (!empty($relation)) { + $this->relations[] = GeneratorFieldRelation::parseRelation($relation); + } + } + + $this->addTimestamps(); + } + + private function addPrimaryKey() + { + $primaryKey = new GeneratorField(); + if ($this->getOption('primary')) { + $primaryKey->name = $this->getOption('primary'); + } else { + $primaryKey->name = 'id'; + } + $primaryKey->parseDBType('increments'); + $primaryKey->parseOptions('s,f,p,if,ii'); + + $this->fields[] = $primaryKey; + } + + private function addTimestamps() + { + $createdAt = new GeneratorField(); + $createdAt->name = 'created_at'; + $createdAt->parseDBType('timestamp'); + $createdAt->parseOptions('s,f,if,ii'); + $this->fields[] = $createdAt; + + $updatedAt = new GeneratorField(); + $updatedAt->name = 'updated_at'; + $updatedAt->parseDBType('timestamp'); + $updatedAt->parseOptions('s,f,if,ii'); + $this->fields[] = $updatedAt; + } + + private function getInputFromFileOrJson() + { + // fieldsFile option will get high priority than json option if both options are passed + try { + if ($this->getOption('fieldsFile')) { + $fieldsFileValue = $this->getOption('fieldsFile'); + if (file_exists($fieldsFileValue)) { + $filePath = $fieldsFileValue; + } elseif (file_exists(base_path($fieldsFileValue))) { + $filePath = base_path($fieldsFileValue); + } else { + $schemaFileDirector = app_path('Classes/CodeGenerator/Schemas/'); + $filePath = $schemaFileDirector.$fieldsFileValue; + } + + if (!file_exists($filePath)) { + $this->commandError('Fields file not found'); + exit; + } + + $fileContents = file_get_contents($filePath); + $jsonData = json_decode($fileContents, true); + $this->fields = []; + foreach ($jsonData as $field) { + if (isset($field['type']) && $field['relation']) { + $this->relations[] = GeneratorFieldRelation::parseRelation($field['relation']); + } else { + $this->fields[] = GeneratorField::parseFieldFromFile($field); + if (isset($field['relation'])) { + $this->relations[] = GeneratorFieldRelation::parseRelation($field['relation']); + } + } + } + } else { + $fileContents = $this->getOption('jsonFromGUI'); + $jsonData = json_decode($fileContents, true); + + // override config options from jsonFromGUI + $this->config->overrideOptionsFromJsonFile($jsonData); + + // Manage custom table name option + if (isset($jsonData['tableName'])) { + $tableName = $jsonData['tableName']; + $this->config->tableName = $tableName; + $this->addDynamicVariable('$TABLE_NAME$', $tableName); + $this->addDynamicVariable('$TABLE_NAME_TITLE$', Str::studly($tableName)); + } + + // Manage migrate option + if (isset($jsonData['migrate']) && $jsonData['migrate'] == false) { + $this->config->options['skip'][] = 'migration'; + } + + foreach ($jsonData['fields'] as $field) { + if (isset($field['type']) && $field['relation']) { + $this->relations[] = GeneratorFieldRelation::parseRelation($field['relation']); + } else { + $this->fields[] = GeneratorField::parseFieldFromFile($field); + if (isset($field['relation'])) { + $this->relations[] = GeneratorFieldRelation::parseRelation($field['relation']); + } + } + } + } + } catch (Exception $e) { + $this->commandError($e->getMessage()); + exit; + } + } + + private function getInputFromTable() + { + $tableName = $this->dynamicVars['$TABLE_NAME$']; + + $ignoredFields = $this->getOption('ignoreFields'); + if (!empty($ignoredFields)) { + $ignoredFields = explode(',', trim($ignoredFields)); + } else { + $ignoredFields = []; + } + + $tableFieldsGenerator = new TableFieldsGenerator($tableName, $ignoredFields, $this->config->connection); + $tableFieldsGenerator->prepareFieldsFromTable(); + $tableFieldsGenerator->prepareRelations(); + + $this->fields = $tableFieldsGenerator->fields; + $this->relations = $tableFieldsGenerator->relations; + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Common/GenerateGetters.php b/app/Classes/CodeGenerator/Common/GenerateGetters.php new file mode 100644 index 00000000..fbf5be5a --- /dev/null +++ b/app/Classes/CodeGenerator/Common/GenerateGetters.php @@ -0,0 +1,26 @@ +generatorHelpers->get_template('Micros.getter_function'); + + $template = str_replace('$FIELD_NAME$', str::camel($name), $template); + $template = str_replace('$DATA_TYPE$', $type, $template); + $template = str_replace('$FUNCTION_NAME$', $functionPrefix.str::studly($name), $template); + + return $template; + } + + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Common/GeneratorConfig.php b/app/Classes/CodeGenerator/Common/GeneratorConfig.php new file mode 100644 index 00000000..6c96c118 --- /dev/null +++ b/app/Classes/CodeGenerator/Common/GeneratorConfig.php @@ -0,0 +1,413 @@ +mName = $commandData->modelName; + + $this->prepareAddOns(); + $this->prepareOptions($commandData); + $this->prepareModelNames(); + $this->preparePrefixes(); + $this->loadPaths(); + $this->prepareTableName(); + $this->preparePrimaryName(); + $this->loadNamespaces($commandData); + $commandData = $this->loadDynamicVariables($commandData); + $this->commandData = &$commandData; + } + + public function loadNamespaces(CommandData &$commandData) + { + $prefix = $this->prefixes['ns']; + + if (!empty($prefix)) { + $prefix = '\\'.$prefix; + } + + $this->nsApp = $commandData->commandObj->getLaravel()->getNamespace(); + $this->nsApp = substr($this->nsApp, 0, strlen($this->nsApp) - 1); + $this->nsModel = 'App\Models'; + $this->nsModelExtend = 'App\Models\AbstractModel'; + + $this->nsBaseController = 'App\Http\Controllers'; + $this->nsController = 'App\Http\Controllers'.$prefix; + + $this->nsApiTests = 'Tests\APIs'; + $this->nsTests = 'Tests'; + } + + public function loadPaths() + { + $prefix = $this->prefixes['path']; + + if (!empty($prefix)) { + $prefix .= '/'; + } + + $this->pathModel = app_path('Models/'); + + $this->pathApiRoutes = base_path('routes/api.php'); + + $this->pathApiTests = base_path('tests/APIs/'); + + $this->pathController = app_path('Http/Controllers/').$prefix; + + $this->pathRoutes = base_path('routes/web.php'); + $this->pathFactory = database_path('factories/'); + + + $this->pathSeeder = database_path('seeds/'); + $this->pathDatabaseSeeder = database_path('seeds/DatabaseSeeder.php'); + } + + public function loadDynamicVariables(CommandData &$commandData) + { + $commandData->addDynamicVariable('$NAMESPACE_APP$', $this->nsApp); + $commandData->addDynamicVariable('$NAMESPACE_MODEL$', $this->nsModel); + $commandData->addDynamicVariable('$NAMESPACE_MODEL_EXTEND$', $this->nsModelExtend); + + $commandData->addDynamicVariable('$NAMESPACE_BASE_CONTROLLER$', $this->nsBaseController); + $commandData->addDynamicVariable('$NAMESPACE_CONTROLLER$', $this->nsController); + + $commandData->addDynamicVariable('$NAMESPACE_API_TESTS$', $this->nsApiTests); + $commandData->addDynamicVariable('$NAMESPACE_TESTS$', $this->nsTests); + + $commandData->addDynamicVariable('$TABLE_NAME$', $this->tableName); + $commandData->addDynamicVariable('$TABLE_NAME_TITLE$', Str::studly($this->tableName)); + $commandData->addDynamicVariable('$PRIMARY_KEY_NAME$', $this->primaryName); + + $commandData->addDynamicVariable('$MODEL_NAME$', $this->mName); + $commandData->addDynamicVariable('$MODEL_NAME_CAMEL$', $this->mCamel); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL$', $this->mPlural); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL_CAMEL$', $this->mCamelPlural); + $commandData->addDynamicVariable('$MODEL_NAME_SNAKE$', $this->mSnake); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL_SNAKE$', $this->mSnakePlural); + $commandData->addDynamicVariable('$MODEL_NAME_DASHED$', $this->mDashed); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL_DASHED$', $this->mDashedPlural); + $commandData->addDynamicVariable('$MODEL_NAME_SLASH$', $this->mSlash); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL_SLASH$', $this->mSlashPlural); + $commandData->addDynamicVariable('$MODEL_NAME_HUMAN$', $this->mHuman); + $commandData->addDynamicVariable('$MODEL_NAME_PLURAL_HUMAN$', $this->mHumanPlural); + $commandData->addDynamicVariable('$FILES$', ''); + + if (!empty($this->prefixes['route'])) { + $commandData->addDynamicVariable('$ROUTE_NAMED_PREFIX$', $this->prefixes['route'].'.'); + $commandData->addDynamicVariable('$ROUTE_PREFIX$', str_replace('.', '/', $this->prefixes['route']).'/'); + $commandData->addDynamicVariable('$RAW_ROUTE_PREFIX$', $this->prefixes['route']); + } else { + $commandData->addDynamicVariable('$ROUTE_PREFIX$', ''); + $commandData->addDynamicVariable('$ROUTE_NAMED_PREFIX$', ''); + } + + if (!empty($this->prefixes['ns'])) { + $commandData->addDynamicVariable('$PATH_PREFIX$', $this->prefixes['ns'].'\\'); + } else { + $commandData->addDynamicVariable('$PATH_PREFIX$', ''); + } + + if (!empty($this->prefixes['view'])) { + $commandData->addDynamicVariable('$VIEW_PREFIX$', str_replace('/', '.', $this->prefixes['view']).'.'); + } else { + $commandData->addDynamicVariable('$VIEW_PREFIX$', ''); + } + + if (!empty($this->prefixes['public'])) { + $commandData->addDynamicVariable('$PUBLIC_PREFIX$', $this->prefixes['public']); + } else { + $commandData->addDynamicVariable('$PUBLIC_PREFIX$', ''); + } + + $commandData->addDynamicVariable( + '$API_PREFIX$', + 'api' + ); + + $commandData->addDynamicVariable( + '$API_VERSION$', + 'v1' + ); + + $commandData->addDynamicVariable('$SEARCHABLE$', ''); + + return $commandData; + } + + public function prepareTableName() + { + if ($this->getOption('tableName')) { + $this->tableName = $this->getOption('tableName'); + } else { + $this->tableName = $this->mSnakePlural; + } + } + + public function preparePrimaryName() + { + if ($this->getOption('primary')) { + $this->primaryName = $this->getOption('primary'); + } else { + $this->primaryName = 'id'; + } + } + + public function prepareModelNames() + { + if ($this->getOption('plural')) { + $this->mPlural = $this->getOption('plural'); + } else { + $this->mPlural = Str::plural($this->mName); + } + $this->mCamel = Str::camel($this->mName); + $this->mCamelPlural = Str::camel($this->mPlural); + $this->mSnake = Str::snake($this->mName); + $this->mSnakePlural = Str::snake($this->mPlural); + $this->mDashed = str_replace('_', '-', Str::snake($this->mSnake)); + $this->mDashedPlural = str_replace('_', '-', Str::snake($this->mSnakePlural)); + $this->mSlash = str_replace('_', '/', Str::snake($this->mSnake)); + $this->mSlashPlural = str_replace('_', '/', Str::snake($this->mSnakePlural)); + $this->mHuman = Str::title(str_replace('_', ' ', Str::snake($this->mSnake))); + $this->mHumanPlural = Str::title(str_replace('_', ' ', Str::snake($this->mSnakePlural))); + } + + public function prepareOptions(CommandData &$commandData) + { + foreach (self::$availableOptions as $option) { + $this->options[$option] = $commandData->commandObj->option($option); + } + + if (isset($options['fromTable']) and $this->options['fromTable']) { + if (!$this->options['tableName']) { + $commandData->commandError('tableName required with fromTable option.'); + exit; + } + } + + $this->options['softDelete'] = true; + if (!empty($this->options['skip'])) { + $this->options['skip'] = array_map('trim', explode(',', $this->options['skip'])); + } + } + + public function preparePrefixes() + { + $this->prefixes['route'] = explode('/', ''); + $this->prefixes['path'] = explode('/', ''); + $this->prefixes['view'] = explode('.', ''); + $this->prefixes['public'] = explode('/', ''); + + if ($this->getOption('prefix')) { + $multiplePrefixes = explode('/', $this->getOption('prefix')); + + $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes); + $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes); + $this->prefixes['view'] = array_merge($this->prefixes['view'], $multiplePrefixes); + $this->prefixes['public'] = array_merge($this->prefixes['public'], $multiplePrefixes); + } + + $this->prefixes['route'] = array_diff($this->prefixes['route'], ['']); + $this->prefixes['path'] = array_diff($this->prefixes['path'], ['']); + $this->prefixes['view'] = array_diff($this->prefixes['view'], ['']); + $this->prefixes['public'] = array_diff($this->prefixes['public'], ['']); + + $routePrefix = ''; + + foreach ($this->prefixes['route'] as $singlePrefix) { + $routePrefix .= Str::camel($singlePrefix).'.'; + } + + if (!empty($routePrefix)) { + $routePrefix = substr($routePrefix, 0, strlen($routePrefix) - 1); + } + + $this->prefixes['route'] = $routePrefix; + + $nsPrefix = ''; + + foreach ($this->prefixes['path'] as $singlePrefix) { + $nsPrefix .= Str::title($singlePrefix).'\\'; + } + + if (!empty($nsPrefix)) { + $nsPrefix = substr($nsPrefix, 0, strlen($nsPrefix) - 1); + } + + $this->prefixes['ns'] = $nsPrefix; + + $pathPrefix = ''; + + foreach ($this->prefixes['path'] as $singlePrefix) { + $pathPrefix .= Str::title($singlePrefix).'/'; + } + + if (!empty($pathPrefix)) { + $pathPrefix = substr($pathPrefix, 0, strlen($pathPrefix) - 1); + } + + $this->prefixes['path'] = $pathPrefix; + + $viewPrefix = ''; + + foreach ($this->prefixes['view'] as $singlePrefix) { + $viewPrefix .= Str::camel($singlePrefix).'/'; + } + + if (!empty($viewPrefix)) { + $viewPrefix = substr($viewPrefix, 0, strlen($viewPrefix) - 1); + } + + $this->prefixes['view'] = $viewPrefix; + + $publicPrefix = ''; + + foreach ($this->prefixes['public'] as $singlePrefix) { + $publicPrefix .= Str::camel($singlePrefix).'/'; + } + + if (!empty($publicPrefix)) { + $publicPrefix = substr($publicPrefix, 0, strlen($publicPrefix) - 1); + } + + $this->prefixes['public'] = $publicPrefix; + } + + public function overrideOptionsFromJsonFile($jsonData) + { + $options = self::$availableOptions; + + foreach ($options as $option) { + if (isset($jsonData['options'][$option])) { + $this->setOption($option, $jsonData['options'][$option]); + } + } + + // prepare prefixes than reload namespaces, paths and dynamic variables + if (!empty($this->getOption('prefix'))) { + $this->preparePrefixes(); + $this->loadPaths(); + $this->loadNamespaces($this->commandData); + $this->loadDynamicVariables($this->commandData); + } + } + + public function getOption($option) + { + if (isset($this->options[$option])) { + return $this->options[$option]; + } + + return false; + } + + public function getAddOn($addOn) + { + if (isset($this->addOns[$addOn])) { + return $this->addOns[$addOn]; + } + + return false; + } + + public function setOption($option, $value) + { + $this->options[$option] = $value; + } + + public function prepareAddOns() + { + $this->addOns['tests'] = false; + } + + public function excludeFields() + { + return self::$excludeFields; + } +} diff --git a/app/Classes/CodeGenerator/Common/GeneratorField.php b/app/Classes/CodeGenerator/Common/GeneratorField.php new file mode 100644 index 00000000..b3a7adff --- /dev/null +++ b/app/Classes/CodeGenerator/Common/GeneratorField.php @@ -0,0 +1,173 @@ +dbInput = $dbInput; + if (!is_null($column)) { + $this->dbInput = ($column->getLength() > 0) ? $this->dbInput.','.$column->getLength() : $this->dbInput; + $this->dbInput = (!$column->getNotnull()) ? $this->dbInput.':nullable' : $this->dbInput; + } + $this->prepareMigrationText(); + } + + public function parseHtmlInput($htmlInput) + { + $this->htmlInput = $htmlInput; + $this->htmlValues = []; + + if (empty($htmlInput)) { + $this->htmlType = 'text'; + + return; + } + + if (Str::contains($htmlInput, 'selectTable')) { + $inputsArr = explode(':', $htmlInput); + $this->htmlType = array_shift($inputsArr); + $this->htmlValues = $inputsArr; + + return; + } + + $inputsArr = explode(',', $htmlInput); + + $this->htmlType = array_shift($inputsArr); + + if (count($inputsArr) > 0) { + $this->htmlValues = $inputsArr; + } + } + + public function parseOptions($options) + { + $options = strtolower($options); + $optionsArr = explode(',', $options); + if (in_array('s', $optionsArr)) { + $this->isSearchable = false; + } + if (in_array('p', $optionsArr)) { + // if field is primary key, then its not searchable, fillable, not in index & form + $this->isPrimary = true; + $this->isSearchable = false; + $this->isFillable = false; + $this->inForm = false; + $this->inIndex = false; + $this->inView = false; + } + if (in_array('f', $optionsArr)) { + $this->isFillable = false; + } + if (in_array('if', $optionsArr)) { + $this->inForm = false; + } + if (in_array('ii', $optionsArr)) { + $this->inIndex = false; + } + if (in_array('iv', $optionsArr)) { + $this->inView = false; + } + } + + private function prepareMigrationText() + { + $inputsArr = explode(':', $this->dbInput); + $this->migrationText = '$table->'; + + $fieldTypeParams = explode(',', array_shift($inputsArr)); + $this->fieldType = array_shift($fieldTypeParams); + $this->migrationText .= $this->fieldType."('".$this->name."'"; + + if ($this->fieldType == 'enum') { + $this->migrationText .= ', ['; + foreach ($fieldTypeParams as $param) { + $this->migrationText .= "'".$param."',"; + } + $this->migrationText = substr($this->migrationText, 0, strlen($this->migrationText) - 1); + $this->migrationText .= ']'; + } else { + foreach ($fieldTypeParams as $param) { + $this->migrationText .= ', '.$param; + } + } + + $this->migrationText .= ')'; + + foreach ($inputsArr as $input) { + $inputParams = explode(',', $input); + $functionName = array_shift($inputParams); + if ($functionName == 'foreign') { + $foreignTable = array_shift($inputParams); + $foreignField = array_shift($inputParams); + $this->foreignKeyText .= "\$table->foreign('".$this->name."')->references('".$foreignField."')->on('".$foreignTable."');"; + } else { + $this->migrationText .= '->'.$functionName; + $this->migrationText .= '('; + $this->migrationText .= implode(', ', $inputParams); + $this->migrationText .= ')'; + } + } + + $this->migrationText .= ';'; + } + + public static function parseFieldFromFile($fieldInput) + { + $field = new self(); + $field->name = $fieldInput['name']; + $field->parseDBType($fieldInput['dbType']); + $field->parseHtmlInput(isset($fieldInput['htmlType']) ? $fieldInput['htmlType'] : ''); + $field->validations = isset($fieldInput['validations']) ? $fieldInput['validations'] : ''; + $field->isSearchable = isset($fieldInput['searchable']) ? $fieldInput['searchable'] : false; + $field->isFillable = isset($fieldInput['fillable']) ? $fieldInput['fillable'] : true; + $field->isPrimary = isset($fieldInput['primary']) ? $fieldInput['primary'] : false; + $field->inForm = isset($fieldInput['inForm']) ? $fieldInput['inForm'] : true; + $field->inIndex = isset($fieldInput['inIndex']) ? $fieldInput['inIndex'] : true; + $field->inView = isset($fieldInput['inView']) ? $fieldInput['inView'] : true; + + return $field; + } + + public function __get($key) + { + if ($key == 'fieldTitle') { + return Str::title(str_replace('_', ' ', $this->name)); + } + + return $this->$key; + } +} diff --git a/app/Classes/CodeGenerator/Common/GeneratorFieldRelation.php b/app/Classes/CodeGenerator/Common/GeneratorFieldRelation.php new file mode 100644 index 00000000..eb569c75 --- /dev/null +++ b/app/Classes/CodeGenerator/Common/GeneratorFieldRelation.php @@ -0,0 +1,103 @@ +type = array_shift($inputs); + $modelWithRelation = explode(':', array_shift($inputs)); //e.g ModelName:relationName + if (count($modelWithRelation) == 2) { + $relation->relationName = $modelWithRelation[1]; + unset($modelWithRelation[1]); + } + $relation->inputs = array_merge($modelWithRelation, $inputs); + + return $relation; + } + + public function getRelationFunctionText($relationText = null) + { + $singularRelation = (!empty($this->relationName)) ? $this->relationName : Str::camel($relationText); + $pluralRelation = (!empty($this->relationName)) ? $this->relationName : Str::camel(Str::plural($relationText)); + + switch ($this->type) { + case '1t1': + $functionName = $singularRelation; + $relation = 'hasOne'; + $relationClass = 'HasOne'; + break; + case '1tm': + $functionName = $pluralRelation; + $relation = 'hasMany'; + $relationClass = 'HasMany'; + break; + case 'mt1': + if (!empty($this->relationName)) { + $singularRelation = $this->relationName; + } elseif (isset($this->inputs[1])) { + $singularRelation = Str::camel(str_replace('_id', '', strtolower($this->inputs[1]))); + } + $functionName = $singularRelation; + $relation = 'belongsTo'; + $relationClass = 'BelongsTo'; + break; + case 'mtm': + $functionName = $pluralRelation; + $relation = 'belongsToMany'; + $relationClass = 'BelongsToMany'; + break; + case 'hmt': + $functionName = $pluralRelation; + $relation = 'hasManyThrough'; + $relationClass = 'HasManyThrough'; + break; + default: + $functionName = ''; + $relation = ''; + $relationClass = ''; + break; + } + + if (!empty($functionName) and !empty($relation)) { + return $this->generateRelation($functionName, $relation, $relationClass); + } + + return ''; + } + + private function generateRelation($functionName, $relation, $relationClass) + { + $inputs = $this->inputs; + $modelName = array_shift($inputs); + + $template = (new GeneratorHelpers())->get_template('Models.relationship'); + + $template = str_replace('$RELATIONSHIP_CLASS$', $relationClass, $template); + $template = str_replace('$FUNCTION_NAME$', $functionName, $template); + $template = str_replace('$RELATION$', $relation, $template); + $template = str_replace('$RELATION_MODEL_NAME$', $modelName, $template); + + if (count($inputs) > 0) { + $inputFields = implode("', '", $inputs); + $inputFields = ", '".$inputFields."'"; + } else { + $inputFields = ''; + } + + $template = str_replace('$INPUT_FIELDS$', $inputFields, $template); + + return $template; + } +} diff --git a/app/Classes/CodeGenerator/Common/GeneratorHelpers.php b/app/Classes/CodeGenerator/Common/GeneratorHelpers.php new file mode 100644 index 00000000..350faf57 --- /dev/null +++ b/app/Classes/CodeGenerator/Common/GeneratorHelpers.php @@ -0,0 +1,78 @@ +generator_tab($spaces), $tabs); + } + + public function generator_nl($count = 1) + { + return str_repeat(PHP_EOL, $count); + } + + public function generator_nls($count, $nls = 1) + { + return str_repeat($this->generator_nl($nls), $count); + } + + public function generator_nl_tab($lns = 1, $tabs = 1) + { + return $this->generator_nl($lns) . $this->generator_tabs($tabs); + } + + public function get_template_file_path($templateName) + { + $templateName = str_replace('.', '/', $templateName); + + return base_path('App/Classes/CodeGenerator/Stubs/'.$templateName.'.stub'); + } + + public function get_template($templateName) + { + $path = $this->get_template_file_path($templateName); + + return file_get_contents($path); + } + + public function fill_template($variables, $template) + { + foreach ($variables as $variable => $value) { + $template = str_replace($variable, $value, $template); + } + + return $template; + } + + public function fill_field_template($variables, $template, $field) + { + foreach ($variables as $variable => $key) { + $template = str_replace($variable, $field->$key, $template); + } + + return $template; + } + + public function fill_template_with_field_data($variables, $fieldVariables, $template, $field) + { + $template = $this->fill_template($variables, $template); + + return $this->fill_field_template($fieldVariables, $template, $field); + } + + public function model_name_from_table_name($tableName) + { + return Str::ucfirst(Str::camel(Str::singular($tableName))); + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Common/TemplatesManager.php b/app/Classes/CodeGenerator/Common/TemplatesManager.php new file mode 100644 index 00000000..48420aff --- /dev/null +++ b/app/Classes/CodeGenerator/Common/TemplatesManager.php @@ -0,0 +1,24 @@ +useLocale; + } + + /** + * @param bool $useLocale + */ + public function setUseLocale(bool $useLocale): void + { + $this->useLocale = $useLocale; + } +} diff --git a/app/Classes/CodeGenerator/Generators/BaseGenerator.php b/app/Classes/CodeGenerator/Generators/BaseGenerator.php new file mode 100644 index 00000000..a2105b2d --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/BaseGenerator.php @@ -0,0 +1,31 @@ +generatorHelpers = new GeneratorHelpers(); + } + + + public function rollbackFile($path, $fileName) + { + if (file_exists($path.$fileName)) { + return FileUtil::deleteFile($path, $fileName); + } + + return false; + } +} diff --git a/app/Classes/CodeGenerator/Generators/FactoryGenerator.php b/app/Classes/CodeGenerator/Generators/FactoryGenerator.php new file mode 100644 index 00000000..8a5f0c94 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/FactoryGenerator.php @@ -0,0 +1,119 @@ +commandData = $commandData; + $this->path = $commandData->config->pathFactory; + $this->fileName = Str::studly(Str::singular($this->commandData->modelName)).'Factory.php'; + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Factories.model_factory'); + + $templateData = $this->fillTemplate($templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandObj->comment("\nFactory created: "); + $this->commandData->commandObj->info($this->fileName); + } + + /** + * @param string $templateData + * + * @return mixed|string + */ + private function fillTemplate($templateData) + { + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace( + '$FIELDS$', + implode(','.$this->generatorHelpers->generator_nl_tab(1, 2), $this->generateFields()), + $templateData + ); + + return $templateData; + } + + /** + * @return array + */ + private function generateFields() + { + $fields = []; + + foreach ($this->commandData->fields as $field) { + if ($field->isPrimary) { + continue; + } + + $fieldData = "'".$field->name."' => ".'$faker->'; + + switch ($field->fieldType) { + case 'integer': + case 'float': + $fakerData = 'randomDigitNotNull'; + break; + case 'string': + $fakerData = 'word'; + break; + case 'text': + $fakerData = 'text'; + break; + case 'datetime': + case 'timestamp': + $fakerData = "date('Y-m-d H:i:s')"; + break; + case 'enum': + $fakerData = 'randomElement('. + GeneratorFieldsInputUtil::prepareValuesArrayStr($field->htmlValues). + ')'; + break; + default: + $fakerData = 'word'; + } + + $fieldData .= $fakerData; + + $fields[] = $fieldData; + } + + return $fields; + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + $this->commandData->commandComment('Factory file deleted: '.$this->fileName); + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/Micros/DataTransferObjectGenerator.php b/app/Classes/CodeGenerator/Generators/Micros/DataTransferObjectGenerator.php new file mode 100644 index 00000000..7e246cbb --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Micros/DataTransferObjectGenerator.php @@ -0,0 +1,140 @@ +commandData = $commandData; + $this->path = app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/DataTransferObjects/'); + $this->fileName = Str::studly(Str::singular($this->commandData->modelName)).'Object.php'; + } + + public function generate() + { + + $templateData = $this->generatorHelpers->get_template('Micros.data_transfer_object'); + + $templateData = $this->fillTemplate($templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\nDataTransferObject created: "); + $this->commandData->commandObj->info($this->fileName); + + } + + /** + * @param string $templateData + * + * @return mixed|string + */ + private function fillTemplate($templateData) + { + $properties = []; + $docs = []; + $injection = []; + $body = []; + $getters = []; + + foreach ($this->commandData->fields as $field) { + if(!in_array($field->name, $this->commandData->config->excludeFields())){ + $docType = $this->getPHPDocType($field->fieldType); + $fieldName = $docType === 'bool' ? 'is'.str::studly($field->name) : str::camel($field->name); + $properties[] = '/** @var '.$docType.' */'.PHP_EOL.$this->generatorHelpers->generator_nl_tab(0, 1).'private $'.str::camel($fieldName).';'; + $docs[] = '* @param '.$docType.' $'.str::camel($fieldName); + $injection[] = $docType.' $'.str::camel($fieldName); + $body[] = '$this->'.str::camel($fieldName).' = $'.str::camel($fieldName).';'; + $getters[] = (new GenerateGetters())->generate($fieldName, $docType); + } + + } + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace( + '$PROPERTIES$', + implode(PHP_EOL.$this->generatorHelpers->generator_nl_tab(1, 1), $properties), + $templateData + ); + + $templateData = str_replace( + '$CONSTRUCTOR_DOCS$', + implode($this->generatorHelpers->generator_nl_tab(1, 2), $docs), + $templateData + ); + + $templateData = str_replace( + '$CONSTRUCTOR_PROPERTIES$', + implode(', ', $injection), + $templateData + ); + + $templateData = str_replace( + '$CONSTRUCTOR_BODY$', + implode($this->generatorHelpers->generator_nl_tab(1, 2), $body), + $templateData + ); + + $templateData = str_replace( + '$GETTER_FUNCTIONS$', + implode($this->generatorHelpers->generator_nl_tab(1, 0), $getters), + $templateData + ); + + return $templateData; + } + + + + private function getPHPDocType($db_type){ + switch ($db_type) { + case 'text': + return 'string'; + case 'datetime': + return '\Carbon\Carbon'; + case 'boolean': + return 'bool'; + default: + return $db_type; + + } + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + File::deleteDirectory($this->path); + $this->commandData->commandComment('DataTransferObject file deleted: '.$this->fileName); + } + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Generators/Micros/ResourceGenerator.php b/app/Classes/CodeGenerator/Generators/Micros/ResourceGenerator.php new file mode 100644 index 00000000..a6db66e8 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Micros/ResourceGenerator.php @@ -0,0 +1,75 @@ +commandData = $commandData; + $this->path = app_path('Http/Resources/'); + $this->fileName = Str::studly(Str::singular($this->commandData->modelName)).'Resource.php'; + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Resource.model_resource'); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace('$FIELDS$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 3), $this->generateFields()), $templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\n Resource Object created: "); + $this->commandData->commandObj->info($this->fileName); + + } + + + private function generateFields() + { + + $fields = []; + + foreach ($this->commandData->fields as $field) { + + $field = "'" . $field->name . "' => " . "$" . "this->" . str::snake($field->name); + $fields[] = $field; + } + + return $fields; + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + $this->commandData->commandComment('Resource Object file deleted: '.$this->fileName); + } + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Generators/Micros/RulesGenerator.php b/app/Classes/CodeGenerator/Generators/Micros/RulesGenerator.php new file mode 100644 index 00000000..be1b72d4 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Micros/RulesGenerator.php @@ -0,0 +1,68 @@ +commandData = $commandData; + $this->path = app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/Standards/Rules/'); + } + + public function generate() + { + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = 'Can'.str::studly($type.$name).'.php'; + $templateData = $this->generatorHelpers->get_template('Rules.can_'.$type); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + FileUtil::createFile($this->path, $filename, $templateData); + + $this->commandData->commandComment("\n" . $type . " Rules created: "); + $this->commandData->commandObj->info($filename); + } + + } + + public function rollback() + { + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename ='Can'.str::studly($type.$name).'.php'; + + if ($this->rollbackFile($this->path, $filename)) { + $this->commandData->commandComment($type . ' Rules file deleted: '.$filename); + } + } + + File::deleteDirectory($this->path); + + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Generators/Micros/ServicesGenerator.php b/app/Classes/CodeGenerator/Generators/Micros/ServicesGenerator.php new file mode 100644 index 00000000..ad45cb0f --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Micros/ServicesGenerator.php @@ -0,0 +1,96 @@ +commandData = $commandData; + $this->path = app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/Services/'); + } + + public function generate() + { + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.($type === 'fetch'?'es':'s').$name).'.php'; + + $templateData = $this->generatorHelpers->get_template("Services.".str::snake($type.'_service')); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace( + '$FIELDS$', + implode($this->generatorHelpers->generator_nl_tab(1, 2), $this->generateFields()), + $templateData + ); + + + FileUtil::createFile($this->path, $filename, $templateData); + + $this->commandData->commandComment("\n" . $type . " service class created: "); + $this->commandData->commandObj->info($filename); + + } + + } + + + private function generateFields() + { + + $fields = []; + + foreach ($this->commandData->fields as $field) { + + if(!in_array($field->name, $this->commandData->config->excludeFields())) { + + $getterName = $field->dbInput === 'boolean' ? 'is' . str::studly($field->name) : 'get' . str::studly($field->name); + + $field = "$" . "model->" . $field->name . " = $" . "object->" . $getterName . "();"; + $fields[] = $field; + } + } + + return $fields; + } + + public function rollback() + { + + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.($type === 'fetch'?'es':'s').$name).'.php'; + if ($this->rollbackFile($this->path, $filename)) { + $this->commandData->commandComment( $type . ' service class file deleted: '.$filename); + } + } + + File::deleteDirectory(($this->path)); + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Generators/Micros/ValidatorsGenerator.php b/app/Classes/CodeGenerator/Generators/Micros/ValidatorsGenerator.php new file mode 100644 index 00000000..d9059548 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Micros/ValidatorsGenerator.php @@ -0,0 +1,112 @@ +commandData = $commandData; + $this->path = app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/Standards/Validators/'); + $this->fileName = Str::studly(Str::singular($this->commandData->modelName)).'Validation.php'; + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Validator.request_validation'); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace('$FIELDS$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 3), $this->generateFields()), $templateData); + $templateData = str_replace('$RULES$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 3), $this->generateRules()), $templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\n Request Validator created: "); + $this->commandData->commandObj->info($this->fileName); + + } + + private function generateRules() + { + $dont_require_fields = []; + + $rules = []; + + foreach ($this->commandData->fields as $field) { + if (!$field->isPrimary && $field->isNotNull && empty($field->validations) && + !in_array($field->name, $dont_require_fields)) { + $field->validations = 'required'; + } + + if (!empty($field->validations)) { + if (Str::contains($field->validations, 'unique:')) { + $rule = explode('|', $field->validations); + // move unique rule to last + usort($rule, function ($record) { + return (Str::contains($record, 'unique:')) ? 1 : 0; + }); + $field->validations = implode('|', $rule); + } + $rule = "'".$field->name."' => '".$field->validations."'"; + $rules[] = $rule; + } + } + + return $rules; + } + + private function generateFields() + { + + $fields = []; + + foreach ($this->commandData->fields as $field) { + + if(!in_array($field->name, $this->commandData->config->excludeFields())) { + + $getterName = $field->dbInput === 'boolean' ? 'is' . str::studly($field->name) : 'get' . str::studly($field->name); + + $field = "'" . $field->name . "' => " . "$" . "object->" . $getterName . "()"; + $fields[] = $field; + } + } + + return $fields; + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + File::deleteDirectory($this->path); + $this->commandData->commandComment('Request Validation file deleted: '.$this->fileName); + } + + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Generators/MigrationGenerator.php b/app/Classes/CodeGenerator/Generators/MigrationGenerator.php new file mode 100644 index 00000000..32adf6c7 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/MigrationGenerator.php @@ -0,0 +1,92 @@ +commandData = $commandData; + $this->path = database_path('migrations/'); + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Migration.migration'); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace('$FIELDS$', $this->generateFields(), $templateData); + + $tableName = $this->commandData->dynamicVars['$TABLE_NAME$']; + + $fileName = date('Y_m_d_His').'_'.'create_'.Str::snake(Str::plural($tableName)).'_table.php'; + + FileUtil::createFile($this->path, $fileName, $templateData); + + $this->commandData->commandComment("\nMigration created: "); + $this->commandData->commandInfo($fileName); + } + + private function generateFields() + { + $fields = []; + $foreignKeys = []; + $createdAtField = null; + $updatedAtField = null; + + $fields[] = '$table->id();'; + + foreach ($this->commandData->fields as $field) { + $fields[] = $field->migrationText; + if (!empty($field->foreignKeyText)) { + $foreignKeys[] = $field->foreignKeyText; + } + } + + $fields[] = '$table->timestamps();'; + + if ($this->commandData->getOption('softDelete')) { + $fields[] = '$table->softDeletes();'; + } + + return implode($this->generatorHelpers->generator_nl_tab(1, 3), array_merge($fields, $foreignKeys)); + } + + public function rollback() + { + $fileName = 'create_'.$this->commandData->config->tableName.'_table.php'; + + $allFiles = File::allFiles($this->path); + + $files = []; + + foreach ($allFiles as $file) { + $files[] = $file->getFilename(); + } + + $files = array_reverse($files); + + foreach ($files as $file) { + if (Str::contains($file, $fileName)) { + if ($this->rollbackFile($this->path, $file)) { + $this->commandData->commandComment('Migration file deleted: '.$file); + } + break; + } + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/ModelGenerator.php b/app/Classes/CodeGenerator/Generators/ModelGenerator.php new file mode 100644 index 00000000..0127d57a --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/ModelGenerator.php @@ -0,0 +1,351 @@ +commandData = $commandData; + $this->path = $commandData->config->pathModel; + $this->fileName = Str::studly(Str::singular($this->commandData->modelName)).'.php'; + $this->table = $this->commandData->dynamicVars['$TABLE_NAME$']; + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Models.model'); + + $templateData = $this->fillTemplate($templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\nModel created: "); + $this->commandData->commandInfo($this->fileName); + } + + private function fillTemplate($templateData) + { + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = $this->fillSoftDeletes($templateData); + + $fillables = []; + + foreach ($this->commandData->fields as $field) { + if ($field->isFillable) { + $fillables[] = "'".$field->name."'"; + } + } + + $templateData = $this->fillDocs($templateData); + + $templateData = $this->fillTimestamps($templateData); + + if ($this->commandData->getOption('primary')) { + $primary = $this->generatorHelpers->generator_tab()."protected \$primaryKey = '".$this->commandData->getOption('primary')."';\n"; + } else { + $primary = ''; + } + + $templateData = str_replace('$PRIMARY$', $primary, $templateData); + + $templateData = str_replace('$FIELDS$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 2), $fillables), $templateData); + + $templateData = str_replace('$RULES$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 2), $this->generateRules()), $templateData); + + $templateData = str_replace('$CAST$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 2), $this->generateCasts()), $templateData); + + $templateData = str_replace( + '$RELATIONS$', + $this->generatorHelpers->fill_template($this->commandData->dynamicVars, implode(PHP_EOL.$this->generatorHelpers->generator_nl_tab(1, 1), $this->generateRelations())), + $templateData + ); + + $templateData = str_replace('$GENERATE_DATE$', date('F j, Y, g:i a T'), $templateData); + + return $templateData; + } + + private function fillSoftDeletes($templateData) + { + if (!$this->commandData->getOption('softDelete')) { + $templateData = str_replace('$SOFT_DELETE_IMPORT$', '', $templateData); + $templateData = str_replace('$SOFT_DELETE$', '', $templateData); + $templateData = str_replace('$SOFT_DELETE_DATES$', '', $templateData); + } else { + $templateData = str_replace( + '$SOFT_DELETE_IMPORT$', + "use Illuminate\\Database\\Eloquent\\SoftDeletes;\n", + $templateData + ); + $templateData = str_replace('$SOFT_DELETE$', $this->generatorHelpers->generator_tab()."use SoftDeletes;\n", $templateData); + $deletedAtTimestamp = 'deleted_at'; + $templateData = str_replace( + '$SOFT_DELETE_DATES$', + $this->generatorHelpers->generator_nl_tab()."protected \$dates = ['".$deletedAtTimestamp."'];\n", + $templateData + ); + } + + return $templateData; + } + + private function fillDocs($templateData) + { + + $docsTemplate = $this->generatorHelpers->get_template('Docs.model'); + $docsTemplate = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $docsTemplate); + + $fillables = ''; + $fieldsArr = []; + $count = 1; + foreach ($this->commandData->relations as $relation) { + $field = $relationText = (isset($relation->inputs[0])) ? $relation->inputs[0] : null; + if (in_array($field, $fieldsArr)) { + $relationText = $relationText.'_'.$count; + $count++; + } + + $fillables .= ' * @property '.$this->getPHPDocType($relation->type, $relation, $relationText).PHP_EOL; + $fieldsArr[] = $field; + } + + foreach ($this->commandData->fields as $field) { + if ($field->isFillable) { + $fillables .= ' * @property '.$this->getPHPDocType($field->fieldType).' '.$field->name.PHP_EOL; + } + } + $docsTemplate = str_replace('$GENERATE_DATE$', date('F j, Y, g:i a'), $docsTemplate); + $docsTemplate = str_replace('$PHPDOC$', $fillables, $docsTemplate); + + $templateData = str_replace('$DOCS$', $docsTemplate, $templateData); + + return $templateData; + } + + /** + * @param $db_type + * @param GeneratorFieldRelation|null $relation + * @param string|null $relationText + * + * @return string + */ + private function getPHPDocType($db_type, $relation = null, $relationText = null) + { + $relationText = (!empty($relationText)) ? $relationText : null; + + switch ($db_type) { + case 'text': + return 'string'; + case 'datetime': + return 'string|\Carbon\Carbon'; + case '1t1': + return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' '.Str::camel($relationText); + case 'mt1': + if (isset($relation->inputs[1])) { + $relationName = str_replace('_id', '', strtolower($relation->inputs[1])); + } else { + $relationName = $relationText; + } + + return '\\'.$this->commandData->config->nsModel.'\\'.$relation->inputs[0].' '.Str::camel($relationName); + case '1tm': + case 'mtm': + case 'hmt': + return '\Illuminate\Database\Eloquent\Collection'.' '.Str::camel(Str::plural($relationText)); + default: + if (!empty($fieldData['fieldType'])) { + return $fieldData['fieldType']; + } + + return $db_type; + } + } + + private function fillTimestamps($templateData) + { + $timestamps = TableFieldsGenerator::getTimestampFieldNames(); + + $replace = ''; + if (empty($timestamps)) { + $replace = $this->generatorHelpers->generator_nl_tab()."public \$timestamps = false;\n"; + } + + if ($this->commandData->getOption('fromTable') && !empty($timestamps)) { + list($created_at, $updated_at) = collect($timestamps)->map(function ($field) { + return !empty($field) ? "'$field'" : 'null'; + }); + + $replace .= $this->generatorHelpers->generator_nl_tab()."const CREATED_AT = $created_at;"; + $replace .= $this->generatorHelpers->generator_nl_tab()."const UPDATED_AT = $updated_at;\n"; + } + + return str_replace('$TIMESTAMPS$', $replace, $templateData); + } + + private function generateRules() + { + $dont_require_fields = []; + + $rules = []; + + foreach ($this->commandData->fields as $field) { + if (!$field->isPrimary && $field->isNotNull && empty($field->validations) && + !in_array($field->name, $dont_require_fields)) { + $field->validations = 'required'; + } + + if (!empty($field->validations)) { + if (Str::contains($field->validations, 'unique:')) { + $rule = explode('|', $field->validations); + // move unique rule to last + usort($rule, function ($record) { + return (Str::contains($record, 'unique:')) ? 1 : 0; + }); + $field->validations = implode('|', $rule); + } + $rule = "'".$field->name."' => '".$field->validations."'"; + $rules[] = $rule; + } + } + + return $rules; + } + + public function generateUniqueRules() + { + $tableNameSingular = Str::singular($this->commandData->config->tableName); + $uniqueRules = ''; + foreach ($this->generateRules() as $rule) { + if (Str::contains($rule, 'unique:')) { + $rule = explode('=>', $rule); + $string = '$rules['.trim($rule[0]).'].","'; + + $uniqueRules .= '$rules['.trim($rule[0]).'] = '.$string.'.$this->route("'.$tableNameSingular.'");'; + } + } + + return $uniqueRules; + } + + public function generateCasts() + { + $casts = []; + + $timestamps = TableFieldsGenerator::getTimestampFieldNames(); + + foreach ($this->commandData->fields as $field) { + if (in_array($field->name, $timestamps)) { + continue; + } + + $rule = "'".$field->name."' => "; + + switch (strtolower($field->fieldType)) { + case 'integer': + case 'increments': + case 'smallinteger': + case 'long': + case 'biginteger': + $rule .= "'integer'"; + break; + case 'double': + $rule .= "'double'"; + break; + case 'float': + case 'decimal': + $rule .= "'float'"; + break; + case 'boolean': + $rule .= "'boolean'"; + break; + case 'datetime': + case 'datetimetz': + $rule .= "'datetime'"; + break; + case 'date': + $rule .= "'date'"; + break; + case 'enum': + case 'string': + case 'char': + case 'text': + $rule .= "'string'"; + break; + default: + $rule = ''; + break; + } + + if (!empty($rule)) { + $casts[] = $rule; + } + } + + return $casts; + } + + private function generateRelations() + { + $relations = []; + + $count = 1; + $fieldsArr = []; + foreach ($this->commandData->relations as $relation) { + $field = (isset($relation->inputs[0])) ? $relation->inputs[0] : null; + + $relationShipText = $field; + if (in_array($field, $fieldsArr)) { + $relationShipText = $relationShipText.'_'.$count; + $count++; + } + + $relationText = $relation->getRelationFunctionText($relationShipText); + if (!empty($relationText)) { + $fieldsArr[] = $field; + $relations[] = $relationText; + } + } + + return $relations; + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + $this->commandData->commandComment('Model file deleted: '.$this->fileName); + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/ControllerLogicGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/ControllerLogicGenerator.php new file mode 100644 index 00000000..17230807 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/ControllerLogicGenerator.php @@ -0,0 +1,83 @@ +commandData = $commandData; + $this->path = app_path('Classes/Modules/'. str::pluralStudly($this->commandData->modelName).'/ControllerLogic/'); + } + + public function generate() + { + + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.$name).'ControllerLogic.php'; + + $templateData = $this->generatorHelpers->get_template("Scaffold.ControllersLogic.".$type."_controller_logic"); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace( + '$REQUEST_FIELDS$', + implode(', ', $this->generateFields()), + $templateData + ); + + + FileUtil::createFile($this->path, $filename, $templateData); + + $this->commandData->commandComment("\n" . $type . " Controller logic created: "); + $this->commandData->commandInfo($filename); + } + + } + + private function generateFields(){ + $fields = []; + + foreach ($this->commandData->fields as $field) { + if(!in_array($field->name, $this->commandData->config->excludeFields())) { + $fields[] = '$request->input(\'' . $field->name . '\')'; + } + } + + return $fields; + } + + public function rollback() + { + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.$name).'ControllerLogic.php'; + + if ($this->rollbackFile($this->path, $filename)) { + $this->commandData->commandComment($type . ' Controller logic file deleted: '.$filename); + } + } + + File::deleteDirectory($this->path); + + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/ControllersGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/ControllersGenerator.php new file mode 100644 index 00000000..c651a39d --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/ControllersGenerator.php @@ -0,0 +1,64 @@ +commandData = $commandData; + $this->path = $commandData->config->pathController.'/'.str::pluralStudly($this->commandData->modelName).'/'; + } + + public function generate() + { + + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.$name).'Controller.php'; + + $templateData = $this->generatorHelpers->get_template("Scaffold.Controllers.".$type."_controller"); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + FileUtil::createFile($this->path, $filename, $templateData); + + $this->commandData->commandComment("\n" . $type . " Controller created: "); + $this->commandData->commandInfo($filename); + } + + } + + public function rollback() + { + foreach(['create', 'list', 'fetch', 'update', 'delete'] as $type){ + + $name = $type === 'list' ? str::pluralStudly($this->commandData->modelName) : str::singular($this->commandData->modelName); + $filename = str::studly($type.$name).'Controller.php'; + + if ($this->rollbackFile($this->path, $filename)) { + $this->commandData->commandComment($type . ' Controller file deleted: '.$filename); + } + } + + File::deleteDirectory($this->path); + + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/RoutesGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/RoutesGenerator.php new file mode 100644 index 00000000..33daa971 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/RoutesGenerator.php @@ -0,0 +1,55 @@ +commandData = $commandData; + $this->path = base_path('routes/crud.php');; + $this->routeContents = file_get_contents($this->path); + $this->routesTemplate = $this->generatorHelpers->get_template('Routes.route'); + $this->routesTemplate = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $this->routesTemplate); + } + + public function generate() + { + if (Str::contains($this->routeContents, "Route::group(['prefix' => '".$this->commandData->config->mSnake."',")) { + $this->commandData->commandObj->info('Routes for '.$this->commandData->config->mName.' already exists, Skipping Adjustment.'); + + return; + } + + file_put_contents($this->path, $this->routeContents.$this->routesTemplate); + $this->commandData->commandComment("\n".$this->commandData->config->mName.' routes added.'); + } + + public function rollback() + { + if (Str::contains($this->routeContents, $this->routesTemplate)) { + $this->routeContents = str_replace($this->routesTemplate, '', $this->routeContents); + file_put_contents($this->path, $this->routeContents); + $this->commandData->commandComment('Routes deleted'); + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/ViewsGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/ViewsGenerator.php new file mode 100644 index 00000000..bac5b4a1 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/ViewsGenerator.php @@ -0,0 +1,53 @@ +commandData = $commandData; + $this->path = resource_path('views/pages/'.str::plural(str::snake($this->commandData->modelName)).'/'); + $this->fileName = 'index.blade.php'; + } + + public function generate() + { + + $templateData = $this->generatorHelpers->get_template("Views.view"); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\nView created: "); + $this->commandData->commandInfo($this->fileName); + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + $this->commandData->commandComment('View file deleted: '.$this->fileName); + File::deleteDirectory($this->path); + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/VueGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/VueGenerator.php new file mode 100644 index 00000000..0d700371 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/VueGenerator.php @@ -0,0 +1,196 @@ +commandData = $commandData; + $this->path = resource_path('assets/vue/components/'.str::camel($this->commandData->modelName).'/'); + + } + + public function generate() + { + + $fields = []; + $i = 1; + foreach ($this->commandData->fields as $index => $field) { + if (!$field->inIndex) { + continue; + } + + $fieldTemplate = $this->generatorHelpers->get_template("Views.column"); + $fieldTemplate = str_replace('$FIRST_COLUMN_CLASS$', $i === 1 ? 'ist-item-heading truncate' : 'text-small', $fieldTemplate); + $fieldTemplate = str_replace('$COLUMN_SIZE$', $i === 1 ? 'col-3' : 'col', $fieldTemplate); + $fieldTemplate = $this->generatorHelpers->fill_template_with_field_data( + $this->commandData->dynamicVars, + $this->commandData->fieldNamesMapping, + $fieldTemplate, + $field + ); + + $fields[] = $fieldTemplate; + + $i++; + + } + $templateData = $this->generatorHelpers->get_template("VueJs.element_component"); + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + $templateData = str_replace('$FIELD_BODY$', implode($this->generatorHelpers->generator_nl_tab(1, 0), $fields), $templateData); + $fileName = $this->commandData->modelName.'Component.vue'; + FileUtil::createFile($this->path.'elements/', $fileName, $templateData); + + $this->commandData->commandComment("\nvue element created: "); + $this->commandData->commandInfo($fileName); + + $this->generateForm(); + $this->generateFilterForm(); + } + + private function generateForm() + { + + $this->htmlFields = []; + $formFields = []; + $validations = []; + + foreach ($this->commandData->fields as $field) { + if (!$field->inForm) { + continue; + } + + $formFields[] = $field->name.": ''"; + + $validations[] = $field->name . ": { " . implode(', ', explode('|', $field->validations)) ." }"; + + $fieldTemplate = $this->generatorHelpers->get_template('Fields.field'); + + $fieldInputTemplate = HTMLFieldGenerator::generateHTML($field); + + if($field->htmlType === 'selectTable'){ + $fieldTemplate = str_replace('$v.parameters.$FIELD_NAME$', '$v.parameters.'.$field->name, $fieldTemplate); + $fieldTemplate = str_replace('$FIELD_NAME$', Str::replaceLast('_id', '', $field->name), $fieldTemplate); + } + + $fieldTemplate = str_replace('$FIELD$', $fieldInputTemplate, $fieldTemplate); + + + if (!empty($fieldTemplate)) { + $fieldTemplate = $this->generatorHelpers->fill_template_with_field_data( + $this->commandData->dynamicVars, + $this->commandData->fieldNamesMapping, + $fieldTemplate, + $field + ); + + $this->htmlFields[] = $fieldTemplate; + } + } + + $templateData = $this->generatorHelpers->get_template('VueJs.form_component'); + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace('$FIELDS$', implode("\n", $this->htmlFields), $templateData); + $templateData = str_replace('$REQUEST_FIELDS$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 5), $formFields), $templateData); + $templateData = str_replace('$VALIDATION$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 4), $validations), $templateData); + + FileUtil::createFile($this->path.'forms/', $this->commandData->modelName.'FormComponent.vue', $templateData); + $this->commandData->commandComment("\nvue form created: "); + $this->commandData->commandInfo($this->commandData->modelName.'FormComponent.vue'); + } + + private function generateFilterForm() + { + + $filterFields = []; + $filterMap = []; + + foreach ($this->commandData->fields as $field) { + if (!$field->isSearchable) { + continue; + } + + + $filterMap[] = $field->name.": ''"; + + $fieldTemplate = $this->generatorHelpers->get_template('Fields.filter_field'); + + $fieldInputTemplate = HTMLFieldGenerator::generateHTML($field); + + if($field->htmlType === 'selectTable'){ + $fieldTemplate = str_replace('$v.parameters.$FIELD_NAME$', '$v.parameters.'.$field->name, $fieldTemplate); + $fieldTemplate = str_replace('$FIELD_NAME$', Str::replaceLast('_id', '', $field->name), $fieldTemplate); + } + + $fieldTemplate = str_replace('$FIELD$', $fieldInputTemplate, $fieldTemplate); + + + if (!empty($fieldTemplate)) { + $fieldTemplate = $this->generatorHelpers->fill_template_with_field_data( + $this->commandData->dynamicVars, + $this->commandData->fieldNamesMapping, + $fieldTemplate, + $field + ); + + $filterFields[] = $fieldTemplate; + } + } + + $templateData = $this->generatorHelpers->get_template('VueJs.filter_component'); + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + $templateData = str_replace('$FIELDS$', implode("\n", $filterFields), $templateData); + $templateData = str_replace('$REQUEST_FIELDS$', implode(','.$this->generatorHelpers->generator_nl_tab(1, 5), $filterMap), $templateData); + + FileUtil::createFile($this->path.'forms/', $this->commandData->modelName.'FiltersComponent.vue', $templateData); + $this->commandData->commandComment("\nvue filter created: "); + $this->commandData->commandInfo($this->commandData->modelName.'FiltersComponent.vue'); + } + + + + public function rollback() + { + foreach(['elements', 'forms'] as $folderType){ + if($folderType === 'elements'){ + if ($this->rollbackFile($this->path.$folderType.'/', $this->commandData->modelName.'Component.vue')) { + $this->commandData->commandComment('Vue element file deleted: '.$this->commandData->modelName.'Component.vue'); + } + } else { + foreach(['form', 'filter'] as $type){ + if ($this->rollbackFile($this->path.$folderType.'/', $this->commandData->modelName.str::studly($type).'Component.vue')) { + $this->commandData->commandComment('Vue '.$type.' file deleted: '.$this->commandData->modelName.str::studly($type).'Component.vue'); + } + } + + } + File::deleteDirectory($this->path.$folderType.'/'); + } + + File::deleteDirectory($this->path); + } +} diff --git a/app/Classes/CodeGenerator/Generators/Scaffold/WebRouteGenerator.php b/app/Classes/CodeGenerator/Generators/Scaffold/WebRouteGenerator.php new file mode 100644 index 00000000..e32fd4d6 --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/Scaffold/WebRouteGenerator.php @@ -0,0 +1,55 @@ +commandData = $commandData; + $this->path = base_path('routes/web.php');; + $this->routeContents = file_get_contents($this->path); + $this->routesTemplate = $this->generatorHelpers->get_template('Routes.web'); + $this->routesTemplate = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $this->routesTemplate); + } + + public function generate() + { + if (Str::contains($this->routeContents, "Route::get('/".$this->commandData->config->mSnakePlural."'")) { + $this->commandData->commandObj->info('Web route for '.$this->commandData->config->mName.' already exists, Skipping Adjustment.'); + + return; + } + + file_put_contents($this->path, $this->routeContents.$this->routesTemplate); + $this->commandData->commandComment("\n".$this->commandData->config->mName.' web route added.'); + } + + public function rollback() + { + if (Str::contains($this->routeContents, $this->routesTemplate)) { + $this->routeContents = str_replace($this->routesTemplate, '', $this->routeContents); + file_put_contents($this->path, $this->routeContents); + $this->commandData->commandComment('web route deleted'); + } + } +} diff --git a/app/Classes/CodeGenerator/Generators/SeederGenerator.php b/app/Classes/CodeGenerator/Generators/SeederGenerator.php new file mode 100644 index 00000000..9161ea0f --- /dev/null +++ b/app/Classes/CodeGenerator/Generators/SeederGenerator.php @@ -0,0 +1,86 @@ +commandData = $commandData; + $this->path = $commandData->config->pathSeeder; + $this->fileName = Str::studly($this->commandData->config->mPlural).'TableSeeder.php'; + } + + public function generate() + { + $templateData = $this->generatorHelpers->get_template('Seeds.model_seeder'); + + $templateData = $this->generatorHelpers->fill_template($this->commandData->dynamicVars, $templateData); + + FileUtil::createFile($this->path, $this->fileName, $templateData); + + $this->commandData->commandComment("\nSeeder created: "); + $this->commandData->commandInfo($this->fileName); + } + + public function updateMainSeeder() + { + $mainSeederContent = file_get_contents($this->commandData->config->pathDatabaseSeeder); + + $newSeederStatement = '$this->call('.$this->commandData->config->mPlural.'TableSeeder::class);'; + + if (strpos($mainSeederContent, $newSeederStatement) != false) { + $this->commandData->commandObj->info($this->commandData->config->mPlural.'TableSeeder entry found in DatabaseSeeder. Skipping Adjustment.'); + + return; + } + + $newSeederStatement = $this->generatorHelpers->generator_tabs(2).$newSeederStatement.$this->generatorHelpers->generator_nl(); + + preg_match_all('/\\$this->call\\((.*);/', $mainSeederContent, $matches); + + $totalMatches = count($matches[0]); + $lastSeederStatement = $matches[0][$totalMatches - 1]; + + $replacePosition = strpos($mainSeederContent, $lastSeederStatement); + + $mainSeederContent = substr_replace($mainSeederContent, $newSeederStatement, $replacePosition + strlen($lastSeederStatement) + 1, 0); + + file_put_contents($this->commandData->config->pathDatabaseSeeder, $mainSeederContent); + $this->commandData->commandComment('Main Seeder file updated.'); + } + + public function rollback() + { + if ($this->rollbackFile($this->path, $this->fileName)) { + $this->commandData->commandComment('Seeder file deleted: '.$this->fileName); + } + + $mainSeederContent = file_get_contents($this->commandData->config->pathDatabaseSeeder); + $mainSeederContent = str_replace('$this->call('.$this->commandData->config->mPlural.'TableSeeder::class);', '', $mainSeederContent); + file_put_contents($this->commandData->config->pathDatabaseSeeder, $mainSeederContent); + $this->commandData->commandComment('Main Seeder file updated.'); + + } +} diff --git a/app/Classes/CodeGenerator/Schemas/addresses.json b/app/Classes/CodeGenerator/Schemas/addresses.json new file mode 100644 index 00000000..138889e2 --- /dev/null +++ b/app/Classes/CodeGenerator/Schemas/addresses.json @@ -0,0 +1,102 @@ +[ + { + "name": "company_id", + "dbType": "foreignId:foreign,companies,id", + "htmlType": "selectTable:companies:name,id", + "validations": "required", + "searchable": true, + "fillable": false, + "primary": false, + "inForm": false, + "inIndex": true, + "relation": "1t1,Company,company_id,id" + }, + { + "name": "street_one", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "street_two", + "dbType": "string:nullable", + "htmlType": "text", + "validations": "", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "city", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "state", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "post_code", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "country", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "default", + "dbType": "integer", + "htmlType": "number", + "validations": "required", + "searchable": false, + "fillable": false, + "primary": false, + "inForm": false, + "inIndex": false + }, + { + "name": "billing", + "dbType": "integer", + "htmlType": "number", + "validations": "required", + "searchable": false, + "fillable": false, + "primary": false, + "inForm": false, + "inIndex": false + } +] diff --git a/app/Classes/CodeGenerator/Schemas/companies.json b/app/Classes/CodeGenerator/Schemas/companies.json new file mode 100644 index 00000000..53a80132 --- /dev/null +++ b/app/Classes/CodeGenerator/Schemas/companies.json @@ -0,0 +1,35 @@ +[ + { + "name": "reference_no", + "dbType": "integer:unique", + "htmlType": "number", + "validations": "required", + "searchable": true, + "fillable": false, + "primary": false, + "inForm": false, + "inIndex": true + }, + { + "name": "name", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": true, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "type", + "dbType": "integer", + "htmlType": "number", + "validations": "required", + "searchable": true, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + } +] diff --git a/app/Classes/CodeGenerator/Schemas/contacts.json b/app/Classes/CodeGenerator/Schemas/contacts.json new file mode 100644 index 00000000..7b8cf0fc --- /dev/null +++ b/app/Classes/CodeGenerator/Schemas/contacts.json @@ -0,0 +1,70 @@ +[ + { + "name": "company_id", + "dbType": "foreignId:foreign,companies,id", + "htmlType": "selectTable:companies:name,id", + "validations": "required", + "searchable": true, + "fillable": false, + "primary": false, + "inForm": false, + "inIndex": true, + "relation": "1t1,Company,company_id,id" + }, + { + "name": "name", + "dbType": "string", + "htmlType": "text", + "validations": "required", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "designation", + "dbType": "string:nullable", + "htmlType": "text", + "validations": "", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "email", + "dbType": "string:nullable", + "htmlType": "text", + "validations": "", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + } +, + { + "name": "phone", + "dbType": "string:nullable", + "htmlType": "text", + "validations": "", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + }, + { + "name": "wechat_id", + "dbType": "string:nullable", + "htmlType": "text", + "validations": "", + "searchable": false, + "fillable": true, + "primary": false, + "inForm": true, + "inIndex": true + } +] diff --git a/app/Classes/CodeGenerator/Stubs/Docs/model.stub b/app/Classes/CodeGenerator/Stubs/Docs/model.stub new file mode 100644 index 00000000..31e51baa --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Docs/model.stub @@ -0,0 +1,6 @@ +/** + * Class $MODEL_NAME$ + * @package $NAMESPACE_MODEL$ + * @version $GENERATE_DATE$ + * +$PHPDOC$ */ \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Factories/model_factory.stub b/app/Classes/CodeGenerator/Stubs/Factories/model_factory.stub new file mode 100644 index 00000000..94781477 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Factories/model_factory.stub @@ -0,0 +1,12 @@ +define($NAMESPACE_MODEL$\$MODEL_NAME$::class, function (Faker $faker) { + + return [ + $FIELDS$ + ]; +}); diff --git a/app/Classes/CodeGenerator/Stubs/Fields/date.stub b/app/Classes/CodeGenerator/Stubs/Fields/date.stub new file mode 100644 index 00000000..8e7cfd97 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/date.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/email.stub b/app/Classes/CodeGenerator/Stubs/Fields/email.stub new file mode 100644 index 00000000..92b3624f --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/email.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/field.stub b/app/Classes/CodeGenerator/Stubs/Fields/field.stub new file mode 100644 index 00000000..cc689126 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/field.stub @@ -0,0 +1,8 @@ +
+
+ + $FIELD$ + $FIELD_NAME$ + +
+
\ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/filter_field.stub b/app/Classes/CodeGenerator/Stubs/Fields/filter_field.stub new file mode 100644 index 00000000..7cd638ae --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/filter_field.stub @@ -0,0 +1,8 @@ +
+
+ +
+
\ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/password.stub b/app/Classes/CodeGenerator/Stubs/Fields/password.stub new file mode 100644 index 00000000..28078be1 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/password.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/select.stub b/app/Classes/CodeGenerator/Stubs/Fields/select.stub new file mode 100644 index 00000000..801cdf99 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/select.stub @@ -0,0 +1 @@ + diff --git a/app/Classes/CodeGenerator/Stubs/Fields/selectable.stub b/app/Classes/CodeGenerator/Stubs/Fields/selectable.stub new file mode 100644 index 00000000..72336cd7 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/selectable.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/text.stub b/app/Classes/CodeGenerator/Stubs/Fields/text.stub new file mode 100644 index 00000000..49643385 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/text.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Fields/textarea.stub b/app/Classes/CodeGenerator/Stubs/Fields/textarea.stub new file mode 100644 index 00000000..6475c6bf --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Fields/textarea.stub @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Micros/data_transfer_object.stub b/app/Classes/CodeGenerator/Stubs/Micros/data_transfer_object.stub new file mode 100644 index 00000000..1ac0c061 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Micros/data_transfer_object.stub @@ -0,0 +1,24 @@ +$FIELD_NAME$; + } diff --git a/app/Classes/CodeGenerator/Stubs/Migration/migration.stub b/app/Classes/CodeGenerator/Stubs/Migration/migration.stub new file mode 100644 index 00000000..c1cbd22d --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Migration/migration.stub @@ -0,0 +1,31 @@ +$RELATION$(\$NAMESPACE_MODEL$\$RELATION_MODEL_NAME$::class$INPUT_FIELDS$); + } \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Resource/model_resource.stub b/app/Classes/CodeGenerator/Stubs/Resource/model_resource.stub new file mode 100644 index 00000000..53dfa039 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Resource/model_resource.stub @@ -0,0 +1,22 @@ + $this->id, + $FIELDS$ + ]; + } +} diff --git a/app/Classes/CodeGenerator/Stubs/Routes/route.stub b/app/Classes/CodeGenerator/Stubs/Routes/route.stub new file mode 100644 index 00000000..dfdc67f2 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Routes/route.stub @@ -0,0 +1,15 @@ + + +Route::group(['prefix' => '$MODEL_NAME_SNAKE$', 'as' => '$MODEL_NAME_SNAKE$.', 'namespace' => '$MODEL_NAME_PLURAL$'], function () { + + Route::get('/{id}/show', 'Fetch$MODEL_NAME$Controller@fetch')->name('show'); + + Route::get('/list', 'List$MODEL_NAME_PLURAL$Controller@list')->name('list'); + + Route::post('/create', 'Create$MODEL_NAME$Controller@create')->name('create'); + + Route::put('/update/{id}', 'Update$MODEL_NAME$Controller@update')->name('update'); + + Route::delete('/delete/{id}', 'Delete$MODEL_NAME$Controller@destroy')->name('delete'); + +}); \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Routes/web.stub b/app/Classes/CodeGenerator/Stubs/Routes/web.stub new file mode 100644 index 00000000..bc77836a --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Routes/web.stub @@ -0,0 +1,5 @@ + + +Route::get('/$MODEL_NAME_PLURAL_SNAKE$', function () { + return view('pages.$MODEL_NAME_PLURAL_SNAKE$.index'); +})->name('$MODEL_NAME_SNAKE$.dashboard'); \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Rules/can_create.stub b/app/Classes/CodeGenerator/Stubs/Rules/can_create.stub new file mode 100644 index 00000000..7d25d53d --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Rules/can_create.stub @@ -0,0 +1,57 @@ +$MODEL_NAME_CAMEL$Validation = $$MODEL_NAME_CAMEL$Validation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param $MODEL_NAME$Object $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->$MODEL_NAME_CAMEL$Validation->validate($object); + + } + + + /** + * @param $MODEL_NAME$Object $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Rules/can_delete.stub b/app/Classes/CodeGenerator/Stubs/Rules/can_delete.stub new file mode 100644 index 00000000..234ff8d2 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Rules/can_delete.stub @@ -0,0 +1,43 @@ +$MODEL_NAME_CAMEL$Validation = $$MODEL_NAME_CAMEL$Validation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param $MODEL_NAME$Object $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->$MODEL_NAME_CAMEL$Validation->validate($object); + + } + + + /** + * @param $MODEL_NAME$Object $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/create_controller.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/create_controller.stub new file mode 100644 index 00000000..e92041ab --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/create_controller.stub @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/delete_controller.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/delete_controller.stub new file mode 100644 index 00000000..cc654d6b --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/delete_controller.stub @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/fetch_controller.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/fetch_controller.stub new file mode 100644 index 00000000..d967838b --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/fetch_controller.stub @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/list_controller.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/list_controller.stub new file mode 100644 index 00000000..f2741e30 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/list_controller.stub @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/update_controller.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/update_controller.stub new file mode 100644 index 00000000..1ed56ee7 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/Controllers/update_controller.stub @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/create_controller_logic.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/create_controller_logic.stub new file mode 100644 index 00000000..36042f20 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/create_controller_logic.stub @@ -0,0 +1,69 @@ + 'Created $MODEL_NAME_HUMAN$', + 'message' => 'You have successfully created a new $MODEL_NAME_HUMAN$' + ]; + } + + /** @var CanCreate$MODEL_NAME$ */ + private $canCreate$MODEL_NAME$; + + /** @var Creates$MODEL_NAME$ */ + private $creates$MODEL_NAME$; + + /** + * Create$MODEL_NAME$ControllerLogic constructor. + * @param CanCreate$MODEL_NAME$ $canCreate$MODEL_NAME$ + * @param Creates$MODEL_NAME$ $creates$MODEL_NAME$ + */ + public function __construct(CanCreate$MODEL_NAME$ $canCreate$MODEL_NAME$, Creates$MODEL_NAME$ $creates$MODEL_NAME$) + { + $this->canCreate$MODEL_NAME$ = $canCreate$MODEL_NAME$; + $this->creates$MODEL_NAME$ = $creates$MODEL_NAME$; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new $MODEL_NAME$Object($REQUEST_FIELDS$); + + $this->canCreate$MODEL_NAME$->passes($object); + + $query = $this->creates$MODEL_NAME$->execute($object); + + return $this->resourceResponse(new $MODEL_NAME$Resource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/delete_controller_logic.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/delete_controller_logic.stub new file mode 100644 index 00000000..ddc6c1f6 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/delete_controller_logic.stub @@ -0,0 +1,73 @@ + 'Deleted $MODEL_NAME_HUMAN$', + 'message' => 'You have successfully deleted a $MODEL_NAME_HUMAN$' + ]; + } + + + /** @var CanDelete$MODEL_NAME$ */ + private $canDelete$MODEL_NAME$; + + /** @var Deletes$MODEL_NAME$ */ + private $deletes$MODEL_NAME$; + + /** @var Fetches$MODEL_NAME$ */ + private $fetches$MODEL_NAME$; + + /** + * Delete$MODEL_NAME$ControllerLogic constructor. + * @param CanDelete$MODEL_NAME$ $canDelete$MODEL_NAME$ + * @param Deletes$MODEL_NAME$ $deletes$MODEL_NAME$ + * @param Fetches$MODEL_NAME$ $fetches$MODEL_NAME$ + */ + public function __construct(CanDelete$MODEL_NAME$ $canDelete$MODEL_NAME$, Deletes$MODEL_NAME$ $deletes$MODEL_NAME$, Fetches$MODEL_NAME$ $fetches$MODEL_NAME$) + { + $this->canDelete$MODEL_NAME$ = $canDelete$MODEL_NAME$; + $this->deletes$MODEL_NAME$ = $deletes$MODEL_NAME$; + $this->fetches$MODEL_NAME$ = $fetches$MODEL_NAME$; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canDelete$MODEL_NAME$->passes(); + + $query = $this->fetches$MODEL_NAME$->execute(['id' => $request->route('id')]); + + $this->deletes$MODEL_NAME$->execute($query); + + return $this->response([]); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/fetch_controller_logic.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/fetch_controller_logic.stub new file mode 100644 index 00000000..dc4977e4 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/fetch_controller_logic.stub @@ -0,0 +1,67 @@ + 'Retrieved $MODEL_NAME_HUMAN$', + 'message' => 'You have successfully retrieved a $MODEL_NAME_HUMAN$' + ]; + } + + /** @var CanFetch$MODEL_NAME$ */ + private $canFetch$MODEL_NAME$; + + /** @var Fetches$MODEL_NAME$ */ + private $fetches$MODEL_NAME$; + + /** + * Fetch$MODEL_NAME$ControllerLogic constructor. + * @param CanFetch$MODEL_NAME$ $canFetch$MODEL_NAME$ + * @param Fetches$MODEL_NAME$ $fetches$MODEL_NAME$ + */ + public function __construct(CanFetch$MODEL_NAME$ $canFetch$MODEL_NAME$, Fetches$MODEL_NAME$ $fetches$MODEL_NAME$) + { + $this->canFetch$MODEL_NAME$ = $canFetch$MODEL_NAME$; + $this->fetches$MODEL_NAME$ = $fetches$MODEL_NAME$; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canFetch$MODEL_NAME$->passes(); + + $query = $this->fetches$MODEL_NAME$->execute(['id' => $request->route('id')]); + + return $this->resourceResponse(new $MODEL_NAME$Resource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/list_controller_logic.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/list_controller_logic.stub new file mode 100644 index 00000000..d2ff7b30 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/list_controller_logic.stub @@ -0,0 +1,66 @@ + 'Retrieved $MODEL_NAME_PLURAL_HUMAN$', + 'message' => 'You have successfully retrieved a list of $MODEL_NAME_PLURAL_HUMAN$' + ]; + } + + /** @var CanList$MODEL_NAME_PLURAL$ */ + private $canList$MODEL_NAME_PLURAL$; + + /** @var Lists$MODEL_NAME_PLURAL$ */ + private $lists$MODEL_NAME_PLURAL$; + + /** + * List$MODEL_NAME_PLURAL$ControllerLogic constructor. + * @param CanList$MODEL_NAME_PLURAL$ $canList$MODEL_NAME_PLURAL$ + * @param Lists$MODEL_NAME_PLURAL$ $lists$MODEL_NAME_PLURAL$ + */ + public function __construct(CanList$MODEL_NAME_PLURAL$ $canList$MODEL_NAME_PLURAL$, Lists$MODEL_NAME_PLURAL$ $lists$MODEL_NAME_PLURAL$) + { + $this->canList$MODEL_NAME_PLURAL$ = $canList$MODEL_NAME_PLURAL$; + $this->lists$MODEL_NAME_PLURAL$ = $lists$MODEL_NAME_PLURAL$; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canList$MODEL_NAME_PLURAL$->passes(); + + $query = $this->lists$MODEL_NAME_PLURAL$->execute($this->lists$MODEL_NAME_PLURAL$->deserializeFilters($request->input('filters'))); + + return $this->collectionResponse($MODEL_NAME$Resource::collection($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/update_controller_logic.stub b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/update_controller_logic.stub new file mode 100644 index 00000000..3a831722 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Scaffold/ControllersLogic/update_controller_logic.stub @@ -0,0 +1,78 @@ + 'Updated $MODEL_NAME_HUMAN$', + 'message' => 'You have successfully updated the $MODEL_NAME_HUMAN$' + ]; + } + + /** @var CanUpdate$MODEL_NAME$ */ + private $canUpdate$MODEL_NAME$; + + /** @var Updates$MODEL_NAME$ */ + private $updates$MODEL_NAME$; + + /** @var Fetches$MODEL_NAME$ */ + private $fetches$MODEL_NAME$; + + /** + * Update$MODEL_NAME$ControllerLogic constructor. + * @param CanUpdate$MODEL_NAME$ $canUpdate$MODEL_NAME$ + * @param Updates$MODEL_NAME$ $updates$MODEL_NAME$ + * @param Fetches$MODEL_NAME$ $fetches$MODEL_NAME$ + */ + public function __construct(CanUpdate$MODEL_NAME$ $canUpdate$MODEL_NAME$, Updates$MODEL_NAME$ $updates$MODEL_NAME$, Fetches$MODEL_NAME$ $fetches$MODEL_NAME$) + { + $this->canUpdate$MODEL_NAME$ = $canUpdate$MODEL_NAME$; + $this->updates$MODEL_NAME$ = $updates$MODEL_NAME$; + $this->fetches$MODEL_NAME$ = $fetches$MODEL_NAME$; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new $MODEL_NAME$Object($REQUEST_FIELDS$); + + $this->canUpdate$MODEL_NAME$->passes($object); + + $query = $this->fetches$MODEL_NAME$->execute(['id' => $request->route('id')]); + + $query = $this->updates$MODEL_NAME$->execute($query, $object); + + return $this->resourceResponse(new $MODEL_NAME$Resource($query)); + + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Seeds/model_seeder.stub b/app/Classes/CodeGenerator/Stubs/Seeds/model_seeder.stub new file mode 100644 index 00000000..f4aa75d3 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Seeds/model_seeder.stub @@ -0,0 +1,16 @@ +create(); + } +} diff --git a/app/Classes/CodeGenerator/Stubs/Services/create_service.stub b/app/Classes/CodeGenerator/Stubs/Services/create_service.stub new file mode 100644 index 00000000..e4dee8c7 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Services/create_service.stub @@ -0,0 +1,19 @@ +handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Services/delete_service.stub b/app/Classes/CodeGenerator/Stubs/Services/delete_service.stub new file mode 100644 index 00000000..a2b3a2a0 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Services/delete_service.stub @@ -0,0 +1,15 @@ +handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Services/fetch_service.stub b/app/Classes/CodeGenerator/Stubs/Services/fetch_service.stub new file mode 100644 index 00000000..bd951400 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Services/fetch_service.stub @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Services/list_service.stub b/app/Classes/CodeGenerator/Stubs/Services/list_service.stub new file mode 100644 index 00000000..36a72e12 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Services/list_service.stub @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Services/update_service.stub b/app/Classes/CodeGenerator/Stubs/Services/update_service.stub new file mode 100644 index 00000000..9460c608 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Services/update_service.stub @@ -0,0 +1,19 @@ +handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Validator/request_validation.stub b/app/Classes/CodeGenerator/Stubs/Validator/request_validation.stub new file mode 100644 index 00000000..cee7a46c --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Validator/request_validation.stub @@ -0,0 +1,39 @@ + +
+
+
+ $FIELD_NAME$ +
+
+
+
+
+
+ {{$MODEL_NAME_CAMEL$.$FIELD_NAME$}} +
+
+
+ \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/Views/view.stub b/app/Classes/CodeGenerator/Stubs/Views/view.stub new file mode 100644 index 00000000..a5da7a2c --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/Views/view.stub @@ -0,0 +1,31 @@ +@extends('layouts.base_portal') +@section('inner_content') +
+
+
+
+
+

$MODEL_NAME_PLURAL_HUMAN$

+
+
+
+ + + + +
+
+
+ + + +
+
+
+ + <$MODEL_NAME_DASHED$-filters-component section="$MODEL_NAME_CAMEL$Section"> +@endsection \ No newline at end of file diff --git a/app/Classes/CodeGenerator/Stubs/VueJs/element_component.stub b/app/Classes/CodeGenerator/Stubs/VueJs/element_component.stub new file mode 100644 index 00000000..6fffd407 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/VueJs/element_component.stub @@ -0,0 +1,41 @@ + + diff --git a/app/Classes/CodeGenerator/Stubs/VueJs/filter_component.stub b/app/Classes/CodeGenerator/Stubs/VueJs/filter_component.stub new file mode 100644 index 00000000..41aa3cc9 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/VueJs/filter_component.stub @@ -0,0 +1,49 @@ + + diff --git a/app/Classes/CodeGenerator/Stubs/VueJs/form_component.stub b/app/Classes/CodeGenerator/Stubs/VueJs/form_component.stub new file mode 100644 index 00000000..2b9e5668 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/VueJs/form_component.stub @@ -0,0 +1,63 @@ + + diff --git a/app/Classes/CodeGenerator/Stubs/base_repository.stub b/app/Classes/CodeGenerator/Stubs/base_repository.stub new file mode 100644 index 00000000..cc17ad67 --- /dev/null +++ b/app/Classes/CodeGenerator/Stubs/base_repository.stub @@ -0,0 +1,193 @@ +app = $app; + $this->makeModel(); + } + + /** + * Get searchable fields array + * + * @return array + */ + abstract public function getFieldsSearchable(); + + /** + * Configure the Model + * + * @return string + */ + abstract public function model(); + + /** + * Make Model instance + * + * @throws \Exception + * + * @return Model + */ + public function makeModel() + { + $model = $this->app->make($this->model()); + + if (!$model instanceof Model) { + throw new \Exception("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model"); + } + + return $this->model = $model; + } + + /** + * Paginate records for scaffold. + * + * @param int $perPage + * @param array $columns + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator + */ + public function paginate($perPage, $columns = ['*']) + { + $query = $this->allQuery(); + + return $query->paginate($perPage, $columns); + } + + /** + * Build a query for retrieving all records. + * + * @param array $search + * @param int|null $skip + * @param int|null $limit + * @return \Illuminate\Database\Eloquent\Builder + */ + public function allQuery($search = [], $skip = null, $limit = null) + { + $query = $this->model->newQuery(); + + if (count($search)) { + foreach($search as $key => $value) { + if (in_array($key, $this->getFieldsSearchable())) { + $query->where($key, $value); + } + } + } + + if (!is_null($skip)) { + $query->skip($skip); + } + + if (!is_null($limit)) { + $query->limit($limit); + } + + return $query; + } + + /** + * Retrieve all records with given filter criteria + * + * @param array $search + * @param int|null $skip + * @param int|null $limit + * @param array $columns + * + * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection + */ + public function all($search = [], $skip = null, $limit = null, $columns = ['*']) + { + $query = $this->allQuery($search, $skip, $limit); + + return $query->get($columns); + } + + /** + * Create model record + * + * @param array $input + * + * @return Model + */ + public function create($input) + { + $model = $this->model->newInstance($input); + + $model->save(); + + return $model; + } + + /** + * Find model record for given id + * + * @param int $id + * @param array $columns + * + * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|Model|null + */ + public function find($id, $columns = ['*']) + { + $query = $this->model->newQuery(); + + return $query->find($id, $columns); + } + + /** + * Update model record for given id + * + * @param array $input + * @param int $id + * + * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|Model + */ + public function update($input, $id) + { + $query = $this->model->newQuery(); + + $model = $query->findOrFail($id); + + $model->fill($input); + + $model->save(); + + return $model; + } + + /** + * @param int $id + * + * @throws \Exception + * + * @return bool|mixed|null + */ + public function delete($id) + { + $query = $this->model->newQuery(); + + $model = $query->findOrFail($id); + + return $model->delete(); + } +} diff --git a/app/Classes/CodeGenerator/Utils/FileUtil.php b/app/Classes/CodeGenerator/Utils/FileUtil.php new file mode 100644 index 00000000..a5b31b93 --- /dev/null +++ b/app/Classes/CodeGenerator/Utils/FileUtil.php @@ -0,0 +1,37 @@ + db_type html_type(optional) options(optional) + * Options are to skip the field from certain criteria like searchable, fillable, not in form, not in index + * Searchable (s), Fillable (f), In Form (if), In Index (ii) + * Sample Field Inputs + * + * title string text + * body text textarea + * name string,20 text + * post_id integer:unsigned:nullable + * post_id integer:unsigned:nullable:foreign,posts,id + * password string text if,ii,s - options will skip field from being added in form, in index and searchable + */ + + $fieldInputsArr = explode(' ', $fieldInput); + + $field = new GeneratorField(); + $field->name = $fieldInputsArr[0]; + $field->parseDBType($fieldInputsArr[1]); + + if (count($fieldInputsArr) > 2) { + $field->parseHtmlInput($fieldInputsArr[2]); + } + + if (count($fieldInputsArr) > 3) { + $field->parseOptions($fieldInputsArr[3]); + } + + $field->validations = $validations; + + return $field; + } + + public static function prepareKeyValueArrayStr($arr) + { + $arrStr = '['; + foreach ($arr as $key => $item) { + $arrStr .= "'$item' => '$key', "; + } + + $arrStr = substr($arrStr, 0, strlen($arrStr) - 2); + + $arrStr .= ']'; + + return $arrStr; + } + + public static function prepareValuesArrayStr($arr) + { + $arrStr = '['; + foreach ($arr as $item) { + $arrStr .= "'$item', "; + } + + $arrStr = substr($arrStr, 0, strlen($arrStr) - 2); + + $arrStr .= ']'; + + return $arrStr; + } + + public static function prepareKeyValueArrFromLabelValueStr($values) + { + $arr = []; + + foreach ($values as $value) { + $labelValue = explode(':', $value); + + if (count($labelValue) > 1) { + $arr[$labelValue[0]] = $labelValue[1]; + } else { + $arr[$labelValue[0]] = $labelValue[0]; + } + } + + return $arr; + } +} diff --git a/app/Classes/CodeGenerator/Utils/HTMLFieldGenerator.php b/app/Classes/CodeGenerator/Utils/HTMLFieldGenerator.php new file mode 100644 index 00000000..9ff77ac0 --- /dev/null +++ b/app/Classes/CodeGenerator/Utils/HTMLFieldGenerator.php @@ -0,0 +1,85 @@ +htmlType) { + case 'text': + case 'number': + case 'checkbox': + $fieldTemplate = $generatorHelpers->get_template('Fields.text'); + break; + case 'textarea': + case 'date': + case 'file': + case 'email': + case 'password': + $fieldTemplate = $generatorHelpers->get_template('Fields.'.$field->htmlType); + break; + case 'select': + case 'enum': + $fieldTemplate = $generatorHelpers->get_template('Fields.select'); + $radioLabels = GeneratorFieldsInputUtil::prepareKeyValueArrFromLabelValueStr($field->htmlValues); + + $fieldTemplate = str_replace( + '$INPUT_ARR$', + GeneratorFieldsInputUtil::prepareKeyValueArrayStr($radioLabels), + $fieldTemplate + ); + break; + case 'selectTable': + $inputArr = explode(',', $field->htmlValues[1]); + + $selectTable = $field->htmlValues[0]; + + $fieldTemplate = $generatorHelpers->get_template('Fields.selectable'); + $fieldTemplate = str_replace('$SELECT_TABLE$', str::singular($selectTable),$fieldTemplate); + $fieldTemplate = str_replace('$SELECT_TABLE_CAMEL$', str::singular(str::camel($selectTable)),$fieldTemplate); + $fieldTemplate = str_replace('$LABEL_COLUMN$',$inputArr[0],$fieldTemplate); + $fieldTemplate = str_replace('$VALUE_COLUMN$',$inputArr[1],$fieldTemplate); + + break; + + case 'checkbox_2': + $fieldTemplate = $generatorHelpers->get_template('Fields.checkbox'); + if (count($field->htmlValues) > 0) { + $checkboxValue = $field->htmlValues[0]; + } else { + $checkboxValue = 1; + } + $fieldTemplate = str_replace('$CHECKBOX_VALUE$', $checkboxValue, $fieldTemplate); + break; + case 'radio': + $fieldTemplate = $generatorHelpers->get_template('Fields.radio_group'); + $radioTemplate = $generatorHelpers->get_template('Fields.radio'); + + $radioLabels = GeneratorFieldsInputUtil::prepareKeyValueArrFromLabelValueStr($field->htmlValues); + + $radioButtons = []; + foreach ($radioLabels as $label => $value) { + $radioButtonTemplate = str_replace('$LABEL$', $label, $radioTemplate); + $radioButtonTemplate = str_replace('$VALUE$', $value, $radioButtonTemplate); + $radioButtons[] = $radioButtonTemplate; + } + $fieldTemplate = str_replace('$RADIO_BUTTONS$', implode("\n", $radioButtons), $fieldTemplate); + break; + case 'toggle-switch': + $fieldTemplate = $generatorHelpers->get_template('Fields.toggle-switch'); + break; + } + + return $fieldTemplate; + } +} diff --git a/app/Classes/CodeGenerator/Utils/ResponseUtil.php b/app/Classes/CodeGenerator/Utils/ResponseUtil.php new file mode 100644 index 00000000..8e79391f --- /dev/null +++ b/app/Classes/CodeGenerator/Utils/ResponseUtil.php @@ -0,0 +1,41 @@ + true, + 'data' => $data, + 'message' => $message, + ]; + } + + /** + * @param string $message + * @param array $data + * + * @return array + */ + public static function makeError($message, array $data = []) + { + $res = [ + 'success' => false, + 'message' => $message, + ]; + + if (!empty($data)) { + $res['data'] = $data; + } + + return $res; + } +} diff --git a/app/Classes/CodeGenerator/Utils/SchemaUtil.php b/app/Classes/CodeGenerator/Utils/SchemaUtil.php new file mode 100644 index 00000000..6c0cb4ac --- /dev/null +++ b/app/Classes/CodeGenerator/Utils/SchemaUtil.php @@ -0,0 +1,42 @@ +'.$fieldType."('".$fieldName."'"; + + if (count($fieldTypeParams) > 0) { + $fieldStr .= ', '.implode(' ,', $fieldTypeParams); + } + if ($fieldType == 'enum') { + $inputsArr = explode(',', $field['htmlTypeInputs']); + $inputArrStr = GeneratorFieldsInputUtil::prepareValuesArrayStr($inputsArr); + $fieldStr .= ', '.$inputArrStr; + } + + $fieldStr .= ')'; + + if (count($databaseInputs) > 0) { + foreach ($databaseInputs as $databaseInput) { + $databaseInput = explode(',', $databaseInput); + $type = array_shift($databaseInput); + $fieldStr .= "->$type(".implode(',', $databaseInput).')'; + } + } + + $fieldStr .= ';'; + + return $fieldStr; + } +} diff --git a/app/Classes/CodeGenerator/Utils/TableFieldsGenerator.php b/app/Classes/CodeGenerator/Utils/TableFieldsGenerator.php new file mode 100644 index 00000000..3c6bb21f --- /dev/null +++ b/app/Classes/CodeGenerator/Utils/TableFieldsGenerator.php @@ -0,0 +1,541 @@ +tableName = $tableName; + $this->ignoredFields = $ignoredFields; + + if (!empty($connection)) { + $this->schemaManager = DB::connection($connection)->getDoctrineSchemaManager(); + } else { + $this->schemaManager = DB::getDoctrineSchemaManager(); + } + + $platform = $this->schemaManager->getDatabasePlatform(); + $defaultMappings = [ + 'enum' => 'string', + 'json' => 'text', + 'bit' => 'boolean', + ]; + + $mappings = []; + $mappings = array_merge($mappings, $defaultMappings); + foreach ($mappings as $dbType => $doctrineType) { + $platform->registerDoctrineTypeMapping($dbType, $doctrineType); + } + + $columns = $this->schemaManager->listTableColumns($tableName); + + $this->columns = []; + foreach ($columns as $column) { + if (!in_array($column->getName(), $ignoredFields)) { + $this->columns[] = $column; + } + } + + $this->primaryKey = $this->getPrimaryKeyOfTable($tableName); + $this->timestamps = static::getTimestampFieldNames(); + $this->defaultSearchable = false; + } + + /** + * Prepares array of GeneratorField from table columns. + */ + public function prepareFieldsFromTable() + { + foreach ($this->columns as $column) { + $type = $column->getType()->getName(); + + switch ($type) { + case 'integer': + $field = $this->generateIntFieldInput($column, 'integer'); + break; + case 'smallint': + $field = $this->generateIntFieldInput($column, 'smallInteger'); + break; + case 'bigint': + $field = $this->generateIntFieldInput($column, 'bigInteger'); + break; + case 'boolean': + $name = Str::title(str_replace('_', ' ', $column->getName())); + $field = $this->generateField($column, 'boolean', 'checkbox,1'); + break; + case 'datetime': + $field = $this->generateField($column, 'datetime', 'date'); + break; + case 'datetimetz': + $field = $this->generateField($column, 'dateTimeTz', 'date'); + break; + case 'date': + $field = $this->generateField($column, 'date', 'date'); + break; + case 'time': + $field = $this->generateField($column, 'time', 'text'); + break; + case 'decimal': + $field = $this->generateNumberInput($column, 'decimal'); + break; + case 'float': + $field = $this->generateNumberInput($column, 'float'); + break; + case 'string': + $field = $this->generateField($column, 'string', 'text'); + break; + case 'text': + $field = $this->generateField($column, 'text', 'textarea'); + break; + default: + $field = $this->generateField($column, 'string', 'text'); + break; + } + + if (strtolower($field->name) == 'password') { + $field->htmlType = 'password'; + } elseif (strtolower($field->name) == 'email') { + $field->htmlType = 'email'; + } elseif (in_array($field->name, $this->timestamps)) { + $field->isSearchable = false; + $field->isFillable = false; + $field->inForm = false; + $field->inIndex = false; + $field->inView = false; + } + $field->isNotNull = (bool) $column->getNotNull(); + $field->description = $column->getComment(); // get comments from table + + $this->fields[] = $field; + } + } + + /** + * Get primary key of given table. + * + * @param string $tableName + * + * @return string|null The column name of the (simple) primary key + */ + public function getPrimaryKeyOfTable($tableName) + { + $column = $this->schemaManager->listTableDetails($tableName)->getPrimaryKey(); + + return $column ? $column->getColumns()[0] : ''; + } + + /** + * Get timestamp columns from config. + * + * @return array the set of [created_at column name, updated_at column name] + */ + public static function getTimestampFieldNames() + { + $createdAtName = 'created_at'; + $updatedAtName = 'updated_at'; + $deletedAtName = 'deleted_at'; + + return [$createdAtName, $updatedAtName, $deletedAtName]; + } + + /** + * Generates integer text field for database. + * + * @param string $dbType + * @param Column $column + * + * @return GeneratorField + */ + private function generateIntFieldInput($column, $dbType) + { + $field = new GeneratorField(); + $field->name = $column->getName(); + $field->parseDBType($dbType); + $field->htmlType = 'number'; + + if ($column->getAutoincrement()) { + $field->dbInput .= ',true'; + } else { + $field->dbInput .= ',false'; + } + + if ($column->getUnsigned()) { + $field->dbInput .= ',true'; + } + + return $this->checkForPrimary($field); + } + + /** + * Check if key is primary key and sets field options. + * + * @param GeneratorField $field + * + * @return GeneratorField + */ + private function checkForPrimary(GeneratorField $field) + { + if ($field->name == $this->primaryKey) { + $field->isPrimary = true; + $field->isFillable = false; + $field->isSearchable = false; + $field->inIndex = false; + $field->inForm = false; + $field->inView = false; + } + + return $field; + } + + /** + * Generates field. + * + * @param Column $column + * @param $dbType + * @param $htmlType + * + * @return GeneratorField + */ + private function generateField($column, $dbType, $htmlType) + { + $field = new GeneratorField(); + $field->name = $column->getName(); + $field->parseDBType($dbType, $column); + $field->parseHtmlInput($htmlType); + + return $this->checkForPrimary($field); + } + + /** + * Generates number field. + * + * @param Column $column + * @param string $dbType + * + * @return GeneratorField + */ + private function generateNumberInput($column, $dbType) + { + $field = new GeneratorField(); + $field->name = $column->getName(); + $field->parseDBType($dbType.','.$column->getPrecision().','.$column->getScale()); + $field->htmlType = 'number'; + + return $this->checkForPrimary($field); + } + + /** + * Prepares relations (GeneratorFieldRelation) array from table foreign keys. + */ + public function prepareRelations() + { + $foreignKeys = $this->prepareForeignKeys(); + $this->checkForRelations($foreignKeys); + } + + /** + * Prepares foreign keys from table with required details. + * + * @return GeneratorTable[] + */ + public function prepareForeignKeys() + { + $tables = $this->schemaManager->listTables(); + + $fields = []; + + foreach ($tables as $table) { + $primaryKey = $table->getPrimaryKey(); + if ($primaryKey) { + $primaryKey = $primaryKey->getColumns()[0]; + } + $formattedForeignKeys = []; + $tableForeignKeys = $table->getForeignKeys(); + foreach ($tableForeignKeys as $tableForeignKey) { + $generatorForeignKey = new GeneratorForeignKey(); + $generatorForeignKey->name = $tableForeignKey->getName(); + $generatorForeignKey->localField = $tableForeignKey->getLocalColumns()[0]; + $generatorForeignKey->foreignField = $tableForeignKey->getForeignColumns()[0]; + $generatorForeignKey->foreignTable = $tableForeignKey->getForeignTableName(); + $generatorForeignKey->onUpdate = $tableForeignKey->onUpdate(); + $generatorForeignKey->onDelete = $tableForeignKey->onDelete(); + + $formattedForeignKeys[] = $generatorForeignKey; + } + + $generatorTable = new GeneratorTable(); + $generatorTable->primaryKey = $primaryKey; + $generatorTable->foreignKeys = $formattedForeignKeys; + + $fields[$table->getName()] = $generatorTable; + } + + return $fields; + } + + /** + * Prepares relations array from table foreign keys. + * + * @param GeneratorTable[] $tables + */ + private function checkForRelations($tables) + { + // get Model table name and table details from tables list + $modelTableName = $this->tableName; + $modelTable = $tables[$modelTableName]; + unset($tables[$modelTableName]); + + $this->relations = []; + + // detects many to one rules for model table + $manyToOneRelations = $this->detectManyToOne($tables, $modelTable); + + if (count($manyToOneRelations) > 0) { + $this->relations = array_merge($this->relations, $manyToOneRelations); + } + + foreach ($tables as $tableName => $table) { + $foreignKeys = $table->foreignKeys; + $primary = $table->primaryKey; + + // if foreign key count is 2 then check if many to many relationship is there + if (count($foreignKeys) == 2) { + $manyToManyRelation = $this->isManyToMany($tables, $tableName, $modelTable, $modelTableName); + if ($manyToManyRelation) { + $this->relations[] = $manyToManyRelation; + continue; + } + } + + // iterate each foreign key and check for relationship + foreach ($foreignKeys as $foreignKey) { + // check if foreign key is on the model table for which we are using generator command + if ($foreignKey->foreignTable == $modelTableName) { + + // detect if one to one relationship is there + $isOneToOne = $this->isOneToOne($primary, $foreignKey, $modelTable->primaryKey); + if ($isOneToOne) { + $modelName = model_name_from_table_name($tableName); + $this->relations[] = GeneratorFieldRelation::parseRelation('1t1,'.$modelName); + continue; + } + + // detect if one to many relationship is there + $isOneToMany = $this->isOneToMany($primary, $foreignKey, $modelTable->primaryKey); + if ($isOneToMany) { + $modelName = model_name_from_table_name($tableName); + $this->relations[] = GeneratorFieldRelation::parseRelation( + '1tm,'.$modelName.','.$foreignKey->localField + ); + continue; + } + } + } + } + } + + /** + * Detects many to many relationship + * If table has only two foreign keys + * Both foreign keys are primary key in foreign table + * Also one is from model table and one is from diff table. + * + * @param GeneratorTable[] $tables + * @param string $tableName + * @param GeneratorTable $modelTable + * @param string $modelTableName + * + * @return bool|GeneratorFieldRelation + */ + private function isManyToMany($tables, $tableName, $modelTable, $modelTableName) + { + // get table details + $table = $tables[$tableName]; + + $isAnyKeyOnModelTable = false; + + // many to many model table name + $manyToManyTable = ''; + + $foreignKeys = $table->foreignKeys; + $primary = $table->primaryKey; + + // check if any foreign key is there from model table + foreach ($foreignKeys as $foreignKey) { + if ($foreignKey->foreignTable == $modelTableName) { + $isAnyKeyOnModelTable = true; + } + } + + // if foreign key is there + if (!$isAnyKeyOnModelTable) { + return false; + } + + foreach ($foreignKeys as $foreignKey) { + $foreignField = $foreignKey->foreignField; + $foreignTableName = $foreignKey->foreignTable; + + // if foreign table is model table + if ($foreignTableName == $modelTableName) { + $foreignTable = $modelTable; + } else { + $foreignTable = $tables[$foreignTableName]; + // get the many to many model table name + $manyToManyTable = $foreignTableName; + } + + // if foreign field is not primary key of foreign table + // then it can not be many to many + if ($foreignField != $foreignTable->primaryKey) { + return false; + break; + } + + // if foreign field is primary key of this table + // then it can not be many to many + if ($foreignField == $primary) { + return false; + } + } + + if (empty($manyToManyTable)) { + return false; + } + + $modelName = model_name_from_table_name($manyToManyTable); + + return GeneratorFieldRelation::parseRelation('mtm,'.$modelName.','.$tableName); + } + + /** + * Detects if one to one relationship is there + * If foreign key of table is primary key of foreign table + * Also foreign key field is primary key of this table. + * + * @param string $primaryKey + * @param GeneratorForeignKey $foreignKey + * @param string $modelTablePrimary + * + * @return bool + */ + private function isOneToOne($primaryKey, $foreignKey, $modelTablePrimary) + { + if ($foreignKey->foreignField == $modelTablePrimary) { + if ($foreignKey->localField == $primaryKey) { + return true; + } + } + + return false; + } + + /** + * Detects if one to many relationship is there + * If foreign key of table is primary key of foreign table + * Also foreign key field is not primary key of this table. + * + * @param string $primaryKey + * @param GeneratorForeignKey $foreignKey + * @param string $modelTablePrimary + * + * @return bool + */ + private function isOneToMany($primaryKey, $foreignKey, $modelTablePrimary) + { + if ($foreignKey->foreignField == $modelTablePrimary) { + if ($foreignKey->localField != $primaryKey) { + return true; + } + } + + return false; + } + + /** + * Detect many to one relationship on model table + * If foreign key of model table is primary key of foreign table. + * + * @param GeneratorTable[] $tables + * @param GeneratorTable $modelTable + * + * @return array + */ + private function detectManyToOne($tables, $modelTable) + { + $manyToOneRelations = []; + + $foreignKeys = $modelTable->foreignKeys; + + foreach ($foreignKeys as $foreignKey) { + $foreignTable = $foreignKey->foreignTable; + $foreignField = $foreignKey->foreignField; + + if (!isset($tables[$foreignTable])) { + continue; + } + + if ($foreignField == $tables[$foreignTable]->primaryKey) { + $modelName = model_name_from_table_name($foreignTable); + $manyToOneRelations[] = GeneratorFieldRelation::parseRelation( + 'mt1,'.$modelName.','.$foreignKey->localField + ); + } + } + + return $manyToOneRelations; + } +} diff --git a/app/Classes/Exceptions/AccessForbiddenException.php b/app/Classes/Exceptions/AccessForbiddenException.php new file mode 100644 index 00000000..8d7e09aa --- /dev/null +++ b/app/Classes/Exceptions/AccessForbiddenException.php @@ -0,0 +1,12 @@ +httpStatusCode = $httpStatusCode; + } +} diff --git a/app/Classes/General/Abstracts/AbstractControllerLogic.php b/app/Classes/General/Abstracts/AbstractControllerLogic.php new file mode 100644 index 00000000..4a0366b2 --- /dev/null +++ b/app/Classes/General/Abstracts/AbstractControllerLogic.php @@ -0,0 +1,87 @@ +notification()['title'] ? $this->notification()['title']: Notifications::UNDEFINED['title']; + } + + /** + * @return string + */ + private function getNotificationMessage():string { + return $this->notification()['message'] ? $this->notification()['message']: Notifications::UNDEFINED['message']; + } + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + abstract protected function logic(Request $request) : JsonResponse; + + /** + * @param Request $request + * @return JsonResponse + */ + public function execute(Request $request) : JsonResponse { + + try { + + return $this->logic($request); + + } catch (ErrorException $exception){ + return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(), $exception->getCode()))->handler(); + + } + } + + /** + * @param array|null $data + * @return JsonResponse + */ + public function response(?array $data = []) : JsonResponse { + + return (new ApiResponseObject($this->getNotificationTitle().' Successful', + $this->getNotificationMessage(), + HttpStatus::OK_WITH_MESSAGE, $data))->handler(); + } + + /** + * @param JsonResource $resource + * @return JsonResponse + */ + public function resourceResponse(JsonResource $resource){ + return $this->response(['data' => $resource]); + } + + /** + * @param ResourceCollection $collection + * @return JsonResponse + */ + public function collectionResponse(ResourceCollection $collection){ + return $this->response(json_decode($collection->response()->getContent(), true)); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Abstracts/AbstractRule.php b/app/Classes/General/Abstracts/AbstractRule.php new file mode 100644 index 00000000..a4506ba2 --- /dev/null +++ b/app/Classes/General/Abstracts/AbstractRule.php @@ -0,0 +1,46 @@ +authorized()){ + throw new AccessForbiddenException('You don\'t have permission to preform this action'); + } + + $this->validators($object); + $this->criteria($object); + + return true; + + } catch(AccessForbiddenException $exception){ + throw new AccessForbiddenException('You don\'t have permission to preform this action'); + } catch(\Exception $exception){ + throw new RequestValidationException($exception->getMessage()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/General/Abstracts/AbstractService.php b/app/Classes/General/Abstracts/AbstractService.php new file mode 100644 index 00000000..03a2e8cc --- /dev/null +++ b/app/Classes/General/Abstracts/AbstractService.php @@ -0,0 +1,42 @@ +handler($model); + + if($model->save()){ + return $model; + } + + + + } catch (QueryException $exception){ + throw new MalformedRequestException('Unable to update the record due to unexpected error'); + } + + } + + abstract function getModel(Model $model); + abstract function handler(Model $model); + + +} \ No newline at end of file diff --git a/app/Classes/General/Abstracts/AbstractValidation.php b/app/Classes/General/Abstracts/AbstractValidation.php new file mode 100644 index 00000000..11d22935 --- /dev/null +++ b/app/Classes/General/Abstracts/AbstractValidation.php @@ -0,0 +1,49 @@ +validator = $validator; + } + + + abstract protected function data($object): array; + + abstract protected function rules(): array; + + abstract protected function messages(): array; + + + /** + * @param DataTransferObject $object + * @return bool + * @throws RequestValidationException + */ + public function validate(DataTransferObject $object){ + + $validator = $this->validator::make($this->data($object), $this->rules(), $this->messages()); + + if($validator->fails()){ + throw new RequestValidationException($validator->messages()->first()); + } + + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/AbstractDeleteRecord.php b/app/Classes/General/Eloquent/AbstractDeleteRecord.php new file mode 100644 index 00000000..76648842 --- /dev/null +++ b/app/Classes/General/Eloquent/AbstractDeleteRecord.php @@ -0,0 +1,32 @@ +delete()){ + return []; + } + + } catch (QueryException|\Exception $exception){ + dd($exception->getMessage()); + throw new MalformedRequestException('Unable to update the record due to unexpected error'); + } + } + + + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/AbstractFetchRecord.php b/app/Classes/General/Eloquent/AbstractFetchRecord.php new file mode 100644 index 00000000..1fbd39da --- /dev/null +++ b/app/Classes/General/Eloquent/AbstractFetchRecord.php @@ -0,0 +1,37 @@ +handler($filters); + + } + + + /** + * @param Builder $query + * @return Model + * @throws ResourceNotFoundException + */ + public function getResults(Builder $query): Model { + if(!$query->exists()){ + throw new ResourceNotFoundException('Unable to find any record based on the criteria provided'); + } + + return $query->first(); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/AbstractGetRecord.php b/app/Classes/General/Eloquent/AbstractGetRecord.php new file mode 100644 index 00000000..f927d818 --- /dev/null +++ b/app/Classes/General/Eloquent/AbstractGetRecord.php @@ -0,0 +1,70 @@ +filters->except(self::DECORATION_FILTERS); + } + + /** + * @return Collection + */ + public function getDecorationFilters(){ + return $this->filters->only(self::DECORATION_FILTERS); + } + + /** + * @param null|string $json + * @return array + */ + public function deserializeFilters(?string $json): array { + return $json !== null ? collect(json_decode($json))->toArray() : []; + } + + /** + * @return Builder + */ + private function applyFiltersToQuery(): Builder + { + return (new ApplyFiltersToQuery())->execute($this->getRepository(), $this->getQueryFilters()->toArray()); + } + + /** + * @param array $filters + * @return mixed + */ + public function handler(array $filters){ + $this->filters = collect($filters); + return $this->getResults($this->applyFiltersToQuery()); + } + + + /** + * @return Builder + */ + abstract function getRepository(): Builder; + + /** + * @param Builder $query + * @return mixed + */ + abstract function getResults(Builder $query); + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/AbstractListRecord.php b/app/Classes/General/Eloquent/AbstractListRecord.php new file mode 100644 index 00000000..fec2ee3b --- /dev/null +++ b/app/Classes/General/Eloquent/AbstractListRecord.php @@ -0,0 +1,49 @@ +handler($filters); + + } catch (QueryException $exception){ + throw new MalformedRequestException('Unable to fetch the list of records due to unexpected error'); + } + + } + + /** + * @param Builder $query + * @return mixed + */ + public function getResults(Builder $query) { + $filters = $this->getDecorationFilters(); + if($filters->has('order_by')){ + $query = $query->orderBy($filters->get('order_by')->column, $filters->get('order_by')->DESC ? 'DESC': 'ASC'); + } + + if($filters->has('per_page')){ + return $query->paginate($filters->get('per_page')); + } + + return $query->get(); + + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/AbstractUpdateRecord.php b/app/Classes/General/Eloquent/AbstractUpdateRecord.php new file mode 100644 index 00000000..fae9d52d --- /dev/null +++ b/app/Classes/General/Eloquent/AbstractUpdateRecord.php @@ -0,0 +1,31 @@ +save()){ + return $model; + } + + } catch (QueryException $exception){ + throw new MalformedRequestException('Unable to update the record due to unexpected error'); + } + } + + + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/ApplyFiltersToQuery.php b/app/Classes/General/Eloquent/ApplyFiltersToQuery.php new file mode 100644 index 00000000..7531a2cf --- /dev/null +++ b/app/Classes/General/Eloquent/ApplyFiltersToQuery.php @@ -0,0 +1,41 @@ + $value){ + $decorator = static::createFilterDecorator($filterName); + + if (static::isValidDecorator($decorator)) { + $query = $decorator::apply($query, $value); + } + } + + return $query; + } + + private static function createFilterDecorator($name) + { + return __NAMESPACE__ . '\Filters\\' . Str::studly($name); + } + + private static function isValidDecorator($decorator) + { + return class_exists($decorator); + } + + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Active.php b/app/Classes/General/Eloquent/Filters/Active.php new file mode 100644 index 00000000..7bc21e5e --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Active.php @@ -0,0 +1,20 @@ +where('active', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Email.php b/app/Classes/General/Eloquent/Filters/Email.php new file mode 100644 index 00000000..c03ffe09 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Email.php @@ -0,0 +1,20 @@ +where('email', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Filter.php b/app/Classes/General/Eloquent/Filters/Filter.php new file mode 100644 index 00000000..42810e8b --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Filter.php @@ -0,0 +1,19 @@ +where('id', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Milestone.php b/app/Classes/General/Eloquent/Filters/Milestone.php new file mode 100644 index 00000000..2c1c6a2d --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Milestone.php @@ -0,0 +1,21 @@ +where('milestone_id', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/ModuleType.php b/app/Classes/General/Eloquent/Filters/ModuleType.php new file mode 100644 index 00000000..cdea613f --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/ModuleType.php @@ -0,0 +1,21 @@ +where('module_type', ModularTypes::MODULAR_MODULES[$value]); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Name.php b/app/Classes/General/Eloquent/Filters/Name.php new file mode 100644 index 00000000..92d27f01 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Name.php @@ -0,0 +1,20 @@ +where('name', 'LIKE', '%' . $value . '%'); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/ProjectType.php b/app/Classes/General/Eloquent/Filters/ProjectType.php new file mode 100644 index 00000000..dc3a7ff8 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/ProjectType.php @@ -0,0 +1,21 @@ +where('project_type', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Status.php b/app/Classes/General/Eloquent/Filters/Status.php new file mode 100644 index 00000000..19b23b9d --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Status.php @@ -0,0 +1,20 @@ +where('status', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/Token.php b/app/Classes/General/Eloquent/Filters/Token.php new file mode 100644 index 00000000..8093fc61 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/Token.php @@ -0,0 +1,20 @@ +where('token', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/UserName.php b/app/Classes/General/Eloquent/Filters/UserName.php new file mode 100644 index 00000000..6cf60e7f --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/UserName.php @@ -0,0 +1,22 @@ +where(function($query) use ($value) { + $query->where('first_name', 'LIKE', '%' . $value . '%')->orWhere('last_name', 'LIKE', '%' . $value . '%'); + }); + } + +} \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/WithUser.php b/app/Classes/General/Eloquent/Filters/WithUser.php new file mode 100644 index 00000000..b731c621 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/WithUser.php @@ -0,0 +1,20 @@ +with('user'); + } +} \ No newline at end of file diff --git a/app/Classes/General/Wrapper/Hasher.php b/app/Classes/General/Wrapper/Hasher.php new file mode 100644 index 00000000..d02b05eb --- /dev/null +++ b/app/Classes/General/Wrapper/Hasher.php @@ -0,0 +1,23 @@ +encode(...$args); + } + public static function decode($enc) + { + if (is_int($enc)) { + return $enc; + } + return app(Hashids::class)->decode($enc)[0]; + } + +} \ No newline at end of file diff --git a/app/Classes/Interfaces/DataTransferObject.php b/app/Classes/Interfaces/DataTransferObject.php new file mode 100644 index 00000000..43b44d7d --- /dev/null +++ b/app/Classes/Interfaces/DataTransferObject.php @@ -0,0 +1,9 @@ +attempt = $attempt; + } + + + public function handle() + { + try { + + (new ExpiresPasswordReset())->execute($this->attempt); + + } catch (MalformedRequestException $exception){ + + } + + } +} diff --git a/app/Classes/Jobs/SendResetPasswordEmail.php b/app/Classes/Jobs/SendResetPasswordEmail.php new file mode 100644 index 00000000..1a8d2488 --- /dev/null +++ b/app/Classes/Jobs/SendResetPasswordEmail.php @@ -0,0 +1,42 @@ +user = $user; + $this->attempt = $attempt; + } + + + public function handle() + { + $this->user->notify(new ResetPasswordEmail($this->user, $this->attempt)); + + } +} diff --git a/app/Classes/Modules/Accounts/ControllersLogic/AuthenticateUserLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/AuthenticateUserLogic.php new file mode 100644 index 00000000..3b14f6c2 --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/AuthenticateUserLogic.php @@ -0,0 +1,69 @@ +canAuthenticateUser = $canAuthenticateUser; + $this->authenticatesUser = $authenticatesUser; + $this->authenticationRedirect = $authenticationRedirect; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + protected function logic(Request $request): JsonResponse { + + try { + $object = new AuthenticationCredentialsObject($request->input('email'), + $request->input('password'), $request->input('remember_me')); + + if($this->canAuthenticateUser->passes($object)){ + + $token = $this->authenticatesUser->execute($object); + + return $this->response(['access_token' => $token, 'redirect_url' => $this->authenticationRedirect->url()]); + + } + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/ControllersLogic/CheckEmailLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/CheckEmailLogic.php new file mode 100644 index 00000000..6c0a7444 --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/CheckEmailLogic.php @@ -0,0 +1,59 @@ + 'User found', + 'message' => 'Account Already Exists' + ]; + } + + /** @var FetchesUser */ + private $fetchesUser; + + + /** + * CheckEmailLogic constructor. + * @param FetchesUser $fetchesUser + */ + public function __construct(FetchesUser $fetchesUser) + { + $this->fetchesUser = $fetchesUser; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + protected function logic(Request $request): JsonResponse { + + try { + + $this->fetchesUser->execute(['email' => $request->input('email')]); + + return $this->response(); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/ControllersLogic/GeneratePasswordResetLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/GeneratePasswordResetLogic.php new file mode 100644 index 00000000..508f5f38 --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/GeneratePasswordResetLogic.php @@ -0,0 +1,85 @@ +canGeneratePasswordReset = $canGeneratePasswordReset; + $this->fetchesUser = $fetchesUser; + $this->generatesPasswordReset = $generatesPasswordReset; + $this->passwordResetTokenExpiration = $passwordResetTokenExpiration; + $this->sendResetPasswordEmail = $sendResetPasswordEmail; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function logic(Request $request): JsonResponse { + + $object = new GeneratePasswordResetObject($request->input('email')); + + if($this->canGeneratePasswordReset->passes($object)) { + $user = $this->fetchesUser->execute(['email' => $object->getEmail()]); + + $attempt = $this->generatesPasswordReset->execute($user); + + $this->passwordResetTokenExpiration::dispatch($attempt)->delay(now()->addHours(24)); + $this->sendResetPasswordEmail::dispatch($user, $attempt); + + return $this->response(['email' => $object->getEmail()]); + } + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/ControllersLogic/ListUsersControllerLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/ListUsersControllerLogic.php new file mode 100644 index 00000000..d2e8415a --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/ListUsersControllerLogic.php @@ -0,0 +1,59 @@ + 'List Users', + 'message' => 'You have successfully retrieved a list of users' + ]; + } + + /** @var CanListUsers */ + private $canListUser; + + /** @var ListsUsers */ + private $listsUsers; + + /** + * ListUsersControllerLogic constructor. + * @param CanListUsers $canListUser + * @param ListsUsers $listsUsers + */ + public function __construct(CanListUsers $canListUser, ListsUsers $listsUsers) + { + $this->canListUser = $canListUser; + $this->listsUsers = $listsUsers; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + */ + public function logic(Request $request) : JsonResponse + { + + if($this->canListUser->passes()){ + $filters = json_decode($request->input('filters')); + return UserResource::collection($this->listsUsers->execute(collect($filters)->toArray()))->response(); + } + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/ControllersLogic/ResetPasswordLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/ResetPasswordLogic.php new file mode 100644 index 00000000..9f90ff89 --- /dev/null +++ b/app/Classes/Modules/Accounts/ControllersLogic/ResetPasswordLogic.php @@ -0,0 +1,83 @@ +canResetPassword = $canResetPassword; + $this->fetchesPasswordReset = $fetchesPasswordReset; + $this->changePassword = $changePassword; + $this->completesPasswordResetToken = $completesPasswordResetToken; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws \App\Classes\Exceptions\AccessForbiddenException + * @throws \App\Classes\Exceptions\InternalServerErrorException + * @throws \App\Classes\Exceptions\MalformedRequestException + * @throws \App\Classes\Exceptions\RequestValidationException + * @throws \App\Classes\Exceptions\ResourceNotFoundException + */ + public function logic(Request $request): JsonResponse { + + $object = new PasswordResetObject($request->input('token'), + new NewPasswordObject($request->input('password'), $request->input('confirmPassword'))); + + if($this->canResetPassword->passes($object)) { + /** @var PasswordReset $passwordReset */ + $passwordReset = $this->fetchesPasswordReset->execute(['token' => $object->getToken(), 'with_user']); + $this->changePassword->execute($passwordReset->user, $object->getNewPassword()); + $this->completesPasswordResetToken->execute($passwordReset); + + return $this->response(); + } + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/DataTransferObjects/AuthenticationCredentialsObject.php b/app/Classes/Modules/Accounts/DataTransferObjects/AuthenticationCredentialsObject.php new file mode 100644 index 00000000..874c25fa --- /dev/null +++ b/app/Classes/Modules/Accounts/DataTransferObjects/AuthenticationCredentialsObject.php @@ -0,0 +1,59 @@ +email = $email; + $this->password = $password; + $this->rememberUser = $rememberUser; + } + + /** + * @return string + */ + public function getEmail(): string + { + return $this->email; + } + + /** + * @return string + */ + public function getPassword(): string + { + return $this->password; + } + + /** + * @return bool + */ + public function isRememberUser(): bool + { + return $this->rememberUser; + } + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/DataTransferObjects/GeneratePasswordResetObject.php b/app/Classes/Modules/Accounts/DataTransferObjects/GeneratePasswordResetObject.php new file mode 100644 index 00000000..3f0a4f72 --- /dev/null +++ b/app/Classes/Modules/Accounts/DataTransferObjects/GeneratePasswordResetObject.php @@ -0,0 +1,34 @@ +email = $email; + } + + /** + * @return string + */ + public function getEmail(): string + { + return $this->email; + } + + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/DataTransferObjects/NewPasswordObject.php b/app/Classes/Modules/Accounts/DataTransferObjects/NewPasswordObject.php new file mode 100644 index 00000000..e7056677 --- /dev/null +++ b/app/Classes/Modules/Accounts/DataTransferObjects/NewPasswordObject.php @@ -0,0 +1,45 @@ +password = $password; + $this->ConfirmPassword = $ConfirmPassword; + } + + /** + * @return String + */ + public function getPassword(): String + { + return $this->password; + } + + /** + * @return String + */ + public function getConfirmPassword(): String + { + return $this->ConfirmPassword; + } + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/DataTransferObjects/PasswordResetObject.php b/app/Classes/Modules/Accounts/DataTransferObjects/PasswordResetObject.php new file mode 100644 index 00000000..c01ce782 --- /dev/null +++ b/app/Classes/Modules/Accounts/DataTransferObjects/PasswordResetObject.php @@ -0,0 +1,44 @@ +token = $token; + $this->newPassword = $newPassword; + } + + /** + * @return String + */ + public function getToken(): String + { + return $this->token; + } + + /** + * @return NewPasswordObject + */ + public function getNewPassword(): NewPasswordObject + { + return $this->newPassword; + } + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/AuthenticatesUser.php b/app/Classes/Modules/Accounts/Services/AuthenticatesUser.php new file mode 100644 index 00000000..40a89cce --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/AuthenticatesUser.php @@ -0,0 +1,27 @@ + $object->getEmail(), 'password' => $object->getPassword()])) { + throw new AccessUnauthorisedException('These credentials do not match our records.'); + } + + return $token; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/AuthenticationRedirect.php b/app/Classes/Modules/Accounts/Services/AuthenticationRedirect.php new file mode 100644 index 00000000..0c2fb7ee --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/AuthenticationRedirect.php @@ -0,0 +1,19 @@ +user()->role_id; + + return $userRole === Roles::ADMIN || $userRole === Roles::SUPER_ADMIN ? route('account.dashboard') : route('company.profile', ['id' => 1]); + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/ChangesPassword.php b/app/Classes/Modules/Accounts/Services/ChangesPassword.php new file mode 100644 index 00000000..f22334ca --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/ChangesPassword.php @@ -0,0 +1,32 @@ +password = Hash::make($object->getPassword()); + return $user->save(); + + } catch (QueryException $exception){ + throw new InternalServerErrorException($exception->getMessage()); + } + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/CompletesPasswordReset.php b/app/Classes/Modules/Accounts/Services/CompletesPasswordReset.php new file mode 100644 index 00000000..633849c2 --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/CompletesPasswordReset.php @@ -0,0 +1,35 @@ +is_complete = true; + $attempt->save(); + + return; + + } catch (QueryException $exception){ + + throw new MalformedRequestException($exception->getMessage()); + + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/ExpiresPasswordReset.php b/app/Classes/Modules/Accounts/Services/ExpiresPasswordReset.php new file mode 100644 index 00000000..f924fabe --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/ExpiresPasswordReset.php @@ -0,0 +1,33 @@ +is_expired = true; + $attempt->save(); + + } catch (QueryException $exception){ + throw new MalformedRequestException($exception->getMessage()); + } + + + } + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/FetchesPasswordReset.php b/app/Classes/Modules/Accounts/Services/FetchesPasswordReset.php new file mode 100644 index 00000000..2f0a18bc --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/FetchesPasswordReset.php @@ -0,0 +1,34 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/FetchesUser.php b/app/Classes/Modules/Accounts/Services/FetchesUser.php new file mode 100644 index 00000000..0c43c2a9 --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/FetchesUser.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/GeneratesPasswordReset.php b/app/Classes/Modules/Accounts/Services/GeneratesPasswordReset.php new file mode 100644 index 00000000..5762b6be --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/GeneratesPasswordReset.php @@ -0,0 +1,37 @@ +passwordReset()->create([ + 'token' => Str::random(60), + 'is_expired' => false, + 'is_complete' => false + ]); + + return $passwordReset; + + } catch (QueryException $exception){ + throw new MalformedRequestException($exception->getMessage()); + } + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Services/ListsUsers.php b/app/Classes/Modules/Accounts/Services/ListsUsers.php new file mode 100644 index 00000000..95d4bfbf --- /dev/null +++ b/app/Classes/Modules/Accounts/Services/ListsUsers.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Criteria/PasswordResetTokenExists.php b/app/Classes/Modules/Accounts/Standards/Criteria/PasswordResetTokenExists.php new file mode 100644 index 00000000..2ba48718 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Criteria/PasswordResetTokenExists.php @@ -0,0 +1,39 @@ +repository = $repository; + } + + + /** + * @param string $token + * @return bool + * @throws ResourceNotFoundException + */ + public function execute(string $token){ + + if(!$this->repository->active()->where('token', $token)->first()){ + throw new ResourceNotFoundException('The reset password token has expired or doesn\'t exist'); + } + return true; + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Criteria/UserEmailExists.php b/app/Classes/Modules/Accounts/Standards/Criteria/UserEmailExists.php new file mode 100644 index 00000000..9b65263d --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Criteria/UserEmailExists.php @@ -0,0 +1,40 @@ +repository = $repository; + } + + + /** + * @param string $email + * @return bool + * @throws ResourceNotFoundException + */ + public function execute(string $email){ + + if(!$this->repository->where('email', $email)->first()){ + throw new ResourceNotFoundException('Unable to find any record that matches the email address provided'); + } + + return true; + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Rules/CanAuthenticateUser.php b/app/Classes/Modules/Accounts/Standards/Rules/CanAuthenticateUser.php new file mode 100644 index 00000000..ad2be911 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Rules/CanAuthenticateUser.php @@ -0,0 +1,57 @@ +userAuthenticationValidation = $userAuthenticationValidation; + } + + /** + * @return bool + */ + protected function authorized(): bool + { + return true; + + } + + + /** + * @param AuthenticationCredentialsObject $object + * @return bool + * @throws RequestValidationException + */ + protected function validators($object): bool + { + return $this->userAuthenticationValidation->validate($object); + + } + + + /** + * @param AuthenticationCredentialsObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Rules/CanGeneratePasswordReset.php b/app/Classes/Modules/Accounts/Standards/Rules/CanGeneratePasswordReset.php new file mode 100644 index 00000000..8a9b8226 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Rules/CanGeneratePasswordReset.php @@ -0,0 +1,65 @@ +generatePasswordResetValidation = $generatePasswordResetValidation; + $this->userEmailExists = $userEmailExists; + } + + /** + * @return bool + */ + protected function authorized(): bool + { + return true; + + } + + + /** + * @param GeneratePasswordResetObject $object + * @return bool + * @throws RequestValidationException + */ + protected function validators($object): bool + { + return $this->generatePasswordResetValidation->validate($object); + } + + + /** + * @param GeneratePasswordResetObject $object + * @return bool + * @throws ResourceNotFoundException + */ + protected function criteria($object): bool + { + return $this->userEmailExists->execute($object->getEmail()); + } + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Rules/CanListUsers.php b/app/Classes/Modules/Accounts/Standards/Rules/CanListUsers.php new file mode 100644 index 00000000..0039de25 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Rules/CanListUsers.php @@ -0,0 +1,46 @@ +resetPasswordValidation = $resetPasswordValidation; + $this->passwordResetTokenExists = $passwordResetTokenExists; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + return true; + + } + + /** + * @param PasswordResetObject $object + * @return bool + * @throws RequestValidationException + */ + protected function validators($object): bool + { + return $this->resetPasswordValidation->validate($object); + + } + + + /** + * @param PasswordResetObject $object + * @return bool + * @throws ResourceNotFoundException + */ + protected function criteria($object): bool + { + return $this->passwordResetTokenExists->execute($object->getToken()); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Validators/GeneratePasswordResetValidation.php b/app/Classes/Modules/Accounts/Standards/Validators/GeneratePasswordResetValidation.php new file mode 100644 index 00000000..e4deb0ea --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Validators/GeneratePasswordResetValidation.php @@ -0,0 +1,42 @@ + $object->getEmail() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'email' => 'required|email' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Validators/ResetPasswordValidation.php b/app/Classes/Modules/Accounts/Standards/Validators/ResetPasswordValidation.php new file mode 100644 index 00000000..7963dc10 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Validators/ResetPasswordValidation.php @@ -0,0 +1,50 @@ + $object->getToken(), + 'password' => $object->getNewPassword()->getPassword(), + 'confirm_password' => $object->getNewPassword()->getConfirmPassword() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'token' => 'required', + 'password' => 'required|min:6', + 'confirm_password' => 'same:password' + + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return [ + 'confirm_password' => [ + 'same' => 'The :attribute and :other must match.' + ] + ]; + } + + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/Standards/Validators/UserAuthenticationValidation.php b/app/Classes/Modules/Accounts/Standards/Validators/UserAuthenticationValidation.php new file mode 100644 index 00000000..6142f769 --- /dev/null +++ b/app/Classes/Modules/Accounts/Standards/Validators/UserAuthenticationValidation.php @@ -0,0 +1,43 @@ + $object->getEmail(), + 'password' => $object->getPassword() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'email' => 'required|email', + 'password' => 'required' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/ControllerLogic/CreateAddressControllerLogic.php b/app/Classes/Modules/Addresses/ControllerLogic/CreateAddressControllerLogic.php new file mode 100644 index 00000000..c66c9dce --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllerLogic/CreateAddressControllerLogic.php @@ -0,0 +1,69 @@ + 'Created Address', + 'message' => 'You have successfully created a new Address' + ]; + } + + /** @var CanCreateAddress */ + private $canCreateAddress; + + /** @var CreatesAddress */ + private $createsAddress; + + /** + * CreateAddressControllerLogic constructor. + * @param CanCreateAddress $canCreateAddress + * @param CreatesAddress $createsAddress + */ + public function __construct(CanCreateAddress $canCreateAddress, CreatesAddress $createsAddress) + { + $this->canCreateAddress = $canCreateAddress; + $this->createsAddress = $createsAddress; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new AddressObject($request->input('company_id'), $request->input('street_one'), $request->input('street_two'), $request->input('city'), $request->input('state'), $request->input('post_code'), $request->input('country'), $request->input('default'), $request->input('billing')); + + $this->canCreateAddress->passes($object); + + $query = $this->createsAddress->execute($object); + + return $this->resourceResponse(new AddressResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/ControllerLogic/DeleteAddressControllerLogic.php b/app/Classes/Modules/Addresses/ControllerLogic/DeleteAddressControllerLogic.php new file mode 100644 index 00000000..d511a00f --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllerLogic/DeleteAddressControllerLogic.php @@ -0,0 +1,73 @@ + 'Deleted Address', + 'message' => 'You have successfully deleted a Address' + ]; + } + + + /** @var CanDeleteAddress */ + private $canDeleteAddress; + + /** @var DeletesAddress */ + private $deletesAddress; + + /** @var FetchesAddress */ + private $fetchesAddress; + + /** + * DeleteAddressControllerLogic constructor. + * @param CanDeleteAddress $canDeleteAddress + * @param DeletesAddress $deletesAddress + * @param FetchesAddress $fetchesAddress + */ + public function __construct(CanDeleteAddress $canDeleteAddress, DeletesAddress $deletesAddress, FetchesAddress $fetchesAddress) + { + $this->canDeleteAddress = $canDeleteAddress; + $this->deletesAddress = $deletesAddress; + $this->fetchesAddress = $fetchesAddress; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canDeleteAddress->passes(); + + $query = $this->fetchesAddress->execute(['id' => $request->route('id')]); + + $this->deletesAddress->execute($query); + + return $this->response([]); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/ControllerLogic/FetchAddressControllerLogic.php b/app/Classes/Modules/Addresses/ControllerLogic/FetchAddressControllerLogic.php new file mode 100644 index 00000000..4d6547e3 --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllerLogic/FetchAddressControllerLogic.php @@ -0,0 +1,67 @@ + 'Retrieved Address', + 'message' => 'You have successfully retrieved a Address' + ]; + } + + /** @var CanFetchAddress */ + private $canFetchAddress; + + /** @var FetchesAddress */ + private $fetchesAddress; + + /** + * FetchAddressControllerLogic constructor. + * @param CanFetchAddress $canFetchAddress + * @param FetchesAddress $fetchesAddress + */ + public function __construct(CanFetchAddress $canFetchAddress, FetchesAddress $fetchesAddress) + { + $this->canFetchAddress = $canFetchAddress; + $this->fetchesAddress = $fetchesAddress; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canFetchAddress->passes(); + + $query = $this->fetchesAddress->execute(['id' => $request->route('id')]); + + return $this->resourceResponse(new AddressResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/ControllerLogic/ListAddressesControllerLogic.php b/app/Classes/Modules/Addresses/ControllerLogic/ListAddressesControllerLogic.php new file mode 100644 index 00000000..d079285e --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllerLogic/ListAddressesControllerLogic.php @@ -0,0 +1,66 @@ + 'Retrieved Addresses', + 'message' => 'You have successfully retrieved a list of Addresses' + ]; + } + + /** @var CanListAddresses */ + private $canListAddresses; + + /** @var ListsAddresses */ + private $listsAddresses; + + /** + * ListAddressesControllerLogic constructor. + * @param CanListAddresses $canListAddresses + * @param ListsAddresses $listsAddresses + */ + public function __construct(CanListAddresses $canListAddresses, ListsAddresses $listsAddresses) + { + $this->canListAddresses = $canListAddresses; + $this->listsAddresses = $listsAddresses; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canListAddresses->passes(); + + $query = $this->listsAddresses->execute($this->listsAddresses->deserializeFilters($request->input('filters'))); + + return $this->collectionResponse(AddressResource::collection($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/ControllerLogic/UpdateAddressControllerLogic.php b/app/Classes/Modules/Addresses/ControllerLogic/UpdateAddressControllerLogic.php new file mode 100644 index 00000000..2bcefae0 --- /dev/null +++ b/app/Classes/Modules/Addresses/ControllerLogic/UpdateAddressControllerLogic.php @@ -0,0 +1,78 @@ + 'Updated Address', + 'message' => 'You have successfully updated the Address' + ]; + } + + /** @var CanUpdateAddress */ + private $canUpdateAddress; + + /** @var UpdatesAddress */ + private $updatesAddress; + + /** @var FetchesAddress */ + private $fetchesAddress; + + /** + * UpdateAddressControllerLogic constructor. + * @param CanUpdateAddress $canUpdateAddress + * @param UpdatesAddress $updatesAddress + * @param FetchesAddress $fetchesAddress + */ + public function __construct(CanUpdateAddress $canUpdateAddress, UpdatesAddress $updatesAddress, FetchesAddress $fetchesAddress) + { + $this->canUpdateAddress = $canUpdateAddress; + $this->updatesAddress = $updatesAddress; + $this->fetchesAddress = $fetchesAddress; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new AddressObject($request->input('company_id'), $request->input('street_one'), $request->input('street_two'), $request->input('city'), $request->input('state'), $request->input('post_code'), $request->input('country'), $request->input('default'), $request->input('billing')); + + $this->canUpdateAddress->passes($object); + + $query = $this->fetchesAddress->execute(['id' => $request->route('id')]); + + $query = $this->updatesAddress->execute($query, $object); + + return $this->resourceResponse(new AddressResource($query)); + + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/DataTransferObjects/AddressObject.php b/app/Classes/Modules/Addresses/DataTransferObjects/AddressObject.php new file mode 100644 index 00000000..abacaa67 --- /dev/null +++ b/app/Classes/Modules/Addresses/DataTransferObjects/AddressObject.php @@ -0,0 +1,135 @@ +companyId = $companyId; + $this->streetOne = $streetOne; + $this->streetTwo = $streetTwo; + $this->city = $city; + $this->state = $state; + $this->postCode = $postCode; + $this->country = $country; + $this->default = $default; + $this->billing = $billing; + } + + /** + * @return int + */ + public function getCompanyId(): int + { + return $this->companyId; + } + + /** + * @return string + */ + public function getStreetOne(): string + { + return $this->streetOne; + } + + /** + * @return null|string + */ + public function getStreetTwo(): ?string + { + return $this->streetTwo; + } + + /** + * @return string + */ + public function getCity(): string + { + return $this->city; + } + + /** + * @return string + */ + public function getState(): string + { + return $this->state; + } + + /** + * @return string + */ + public function getPostCode(): string + { + return $this->postCode; + } + + /** + * @return string + */ + public function getCountry(): string + { + return $this->country; + } + + /** + * @return int + */ + public function getDefault(): int + { + return $this->default; + } + + /** + * @return int + */ + public function getBilling(): int + { + return $this->billing; + } + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Services/CreatesAddress.php b/app/Classes/Modules/Addresses/Services/CreatesAddress.php new file mode 100644 index 00000000..3c6bea7b --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/CreatesAddress.php @@ -0,0 +1,27 @@ +company_id = $object->getCompanyId(); + $model->street_one = $object->getStreetOne(); + $model->street_two = $object->getStreetTwo(); + $model->city = $object->getCity(); + $model->state = $object->getState(); + $model->post_code = $object->getPostCode(); + $model->country = $object->getCountry(); + $model->default = $object->getDefault(); + $model->billing = $object->getBilling(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Services/DeletesAddress.php b/app/Classes/Modules/Addresses/Services/DeletesAddress.php new file mode 100644 index 00000000..75cbbca8 --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/DeletesAddress.php @@ -0,0 +1,15 @@ +handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Services/FetchesAddress.php b/app/Classes/Modules/Addresses/Services/FetchesAddress.php new file mode 100644 index 00000000..a91900b7 --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/FetchesAddress.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Services/ListsAddresses.php b/app/Classes/Modules/Addresses/Services/ListsAddresses.php new file mode 100644 index 00000000..7a0f1213 --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/ListsAddresses.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Services/UpdatesAddress.php b/app/Classes/Modules/Addresses/Services/UpdatesAddress.php new file mode 100644 index 00000000..523b3000 --- /dev/null +++ b/app/Classes/Modules/Addresses/Services/UpdatesAddress.php @@ -0,0 +1,27 @@ +company_id = $object->getCompanyId(); + $model->street_one = $object->getStreetOne(); + $model->street_two = $object->getStreetTwo(); + $model->city = $object->getCity(); + $model->state = $object->getState(); + $model->post_code = $object->getPostCode(); + $model->country = $object->getCountry(); + $model->default = $object->getDefault(); + $model->billing = $object->getBilling(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Standards/Rules/CanCreateAddress.php b/app/Classes/Modules/Addresses/Standards/Rules/CanCreateAddress.php new file mode 100644 index 00000000..42508b1d --- /dev/null +++ b/app/Classes/Modules/Addresses/Standards/Rules/CanCreateAddress.php @@ -0,0 +1,57 @@ +addressValidation = $addressValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param AddressObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->addressValidation->validate($object); + + } + + + /** + * @param AddressObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Standards/Rules/CanDeleteAddress.php b/app/Classes/Modules/Addresses/Standards/Rules/CanDeleteAddress.php new file mode 100644 index 00000000..c13a890c --- /dev/null +++ b/app/Classes/Modules/Addresses/Standards/Rules/CanDeleteAddress.php @@ -0,0 +1,43 @@ +addressValidation = $addressValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param AddressObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->addressValidation->validate($object); + + } + + + /** + * @param AddressObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Addresses/Standards/Validators/AddressValidation.php b/app/Classes/Modules/Addresses/Standards/Validators/AddressValidation.php new file mode 100644 index 00000000..6d4e873c --- /dev/null +++ b/app/Classes/Modules/Addresses/Standards/Validators/AddressValidation.php @@ -0,0 +1,54 @@ + $object->getCompanyId(), + 'street_one' => $object->getStreetOne(), + 'street_two' => $object->getStreetTwo(), + 'city' => $object->getCity(), + 'state' => $object->getState(), + 'post_code' => $object->getPostCode(), + 'country' => $object->getCountry(), + 'default' => $object->getDefault(), + 'billing' => $object->getBilling() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'company_id' => 'required', + 'street_one' => 'required', + 'city' => 'required', + 'state' => 'required', + 'post_code' => 'required', + 'country' => 'required', + 'default' => 'required', + 'billing' => 'required' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllerLogic/CreateCompanyControllerLogic.php b/app/Classes/Modules/Companies/ControllerLogic/CreateCompanyControllerLogic.php new file mode 100644 index 00000000..ff0902cd --- /dev/null +++ b/app/Classes/Modules/Companies/ControllerLogic/CreateCompanyControllerLogic.php @@ -0,0 +1,69 @@ + 'Created Company', + 'message' => 'You have successfully created a new Company' + ]; + } + + /** @var CanCreateCompany */ + private $canCreateCompany; + + /** @var CreatesCompany */ + private $createsCompany; + + /** + * CreateCompanyControllerLogic constructor. + * @param CanCreateCompany $canCreateCompany + * @param CreatesCompany $createsCompany + */ + public function __construct(CanCreateCompany $canCreateCompany, CreatesCompany $createsCompany) + { + $this->canCreateCompany = $canCreateCompany; + $this->createsCompany = $createsCompany; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new CompanyObject($request->input('reference_no'), $request->input('name'), $request->input('type')); + + $this->canCreateCompany->passes($object); + + $query = $this->createsCompany->execute($object); + + return $this->resourceResponse(new CompanyResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllerLogic/DeleteCompanyControllerLogic.php b/app/Classes/Modules/Companies/ControllerLogic/DeleteCompanyControllerLogic.php new file mode 100644 index 00000000..afa5a332 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllerLogic/DeleteCompanyControllerLogic.php @@ -0,0 +1,73 @@ + 'Deleted Company', + 'message' => 'You have successfully deleted a Company' + ]; + } + + + /** @var CanDeleteCompany */ + private $canDeleteCompany; + + /** @var DeletesCompany */ + private $deletesCompany; + + /** @var FetchesCompany */ + private $fetchesCompany; + + /** + * DeleteCompanyControllerLogic constructor. + * @param CanDeleteCompany $canDeleteCompany + * @param DeletesCompany $deletesCompany + * @param FetchesCompany $fetchesCompany + */ + public function __construct(CanDeleteCompany $canDeleteCompany, DeletesCompany $deletesCompany, FetchesCompany $fetchesCompany) + { + $this->canDeleteCompany = $canDeleteCompany; + $this->deletesCompany = $deletesCompany; + $this->fetchesCompany = $fetchesCompany; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canDeleteCompany->passes(); + + $query = $this->fetchesCompany->execute(['id' => $request->route('id')]); + + $this->deletesCompany->execute($query); + + return $this->response([]); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllerLogic/FetchCompanyControllerLogic.php b/app/Classes/Modules/Companies/ControllerLogic/FetchCompanyControllerLogic.php new file mode 100644 index 00000000..eae90f70 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllerLogic/FetchCompanyControllerLogic.php @@ -0,0 +1,67 @@ + 'Retrieved Company', + 'message' => 'You have successfully retrieved a Company' + ]; + } + + /** @var CanFetchCompany */ + private $canFetchCompany; + + /** @var FetchesCompany */ + private $fetchesCompany; + + /** + * FetchCompanyControllerLogic constructor. + * @param CanFetchCompany $canFetchCompany + * @param FetchesCompany $fetchesCompany + */ + public function __construct(CanFetchCompany $canFetchCompany, FetchesCompany $fetchesCompany) + { + $this->canFetchCompany = $canFetchCompany; + $this->fetchesCompany = $fetchesCompany; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canFetchCompany->passes(); + + $query = $this->fetchesCompany->execute(['id' => $request->route('id')]); + + return $this->resourceResponse(new CompanyResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllerLogic/ListCompaniesControllerLogic.php b/app/Classes/Modules/Companies/ControllerLogic/ListCompaniesControllerLogic.php new file mode 100644 index 00000000..41813263 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllerLogic/ListCompaniesControllerLogic.php @@ -0,0 +1,66 @@ + 'Retrieved Companies', + 'message' => 'You have successfully retrieved a list of Companies' + ]; + } + + /** @var CanListCompanies */ + private $canListCompanies; + + /** @var ListsCompanies */ + private $listsCompanies; + + /** + * ListCompaniesControllerLogic constructor. + * @param CanListCompanies $canListCompanies + * @param ListsCompanies $listsCompanies + */ + public function __construct(CanListCompanies $canListCompanies, ListsCompanies $listsCompanies) + { + $this->canListCompanies = $canListCompanies; + $this->listsCompanies = $listsCompanies; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canListCompanies->passes(); + + $query = $this->listsCompanies->execute($this->listsCompanies->deserializeFilters($request->input('filters'))); + + return $this->collectionResponse(CompanyResource::collection($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/ControllerLogic/UpdateCompanyControllerLogic.php b/app/Classes/Modules/Companies/ControllerLogic/UpdateCompanyControllerLogic.php new file mode 100644 index 00000000..caa3b4e7 --- /dev/null +++ b/app/Classes/Modules/Companies/ControllerLogic/UpdateCompanyControllerLogic.php @@ -0,0 +1,78 @@ + 'Updated Company', + 'message' => 'You have successfully updated the Company' + ]; + } + + /** @var CanUpdateCompany */ + private $canUpdateCompany; + + /** @var UpdatesCompany */ + private $updatesCompany; + + /** @var FetchesCompany */ + private $fetchesCompany; + + /** + * UpdateCompanyControllerLogic constructor. + * @param CanUpdateCompany $canUpdateCompany + * @param UpdatesCompany $updatesCompany + * @param FetchesCompany $fetchesCompany + */ + public function __construct(CanUpdateCompany $canUpdateCompany, UpdatesCompany $updatesCompany, FetchesCompany $fetchesCompany) + { + $this->canUpdateCompany = $canUpdateCompany; + $this->updatesCompany = $updatesCompany; + $this->fetchesCompany = $fetchesCompany; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new CompanyObject($request->input('reference_no'), $request->input('name'), $request->input('type')); + + $this->canUpdateCompany->passes($object); + + $query = $this->fetchesCompany->execute(['id' => $request->route('id')]); + + $query = $this->updatesCompany->execute($query, $object); + + return $this->resourceResponse(new CompanyResource($query)); + + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/DataTransferObjects/CompanyObject.php b/app/Classes/Modules/Companies/DataTransferObjects/CompanyObject.php new file mode 100644 index 00000000..3615803c --- /dev/null +++ b/app/Classes/Modules/Companies/DataTransferObjects/CompanyObject.php @@ -0,0 +1,58 @@ +referenceNo = $referenceNo; + $this->name = $name; + $this->type = $type; + } + + /** + * @return integer + */ + public function getReferenceNo(): integer + { + return $this->referenceNo; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @return integer + */ + public function getType(): integer + { + return $this->type; + } + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/CreatesCompany.php b/app/Classes/Modules/Companies/Services/CreatesCompany.php new file mode 100644 index 00000000..0cd92ed1 --- /dev/null +++ b/app/Classes/Modules/Companies/Services/CreatesCompany.php @@ -0,0 +1,21 @@ +reference_no = $object->getReferenceNo(); + $model->name = $object->getName(); + $model->type = $object->getType(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/DeletesCompany.php b/app/Classes/Modules/Companies/Services/DeletesCompany.php new file mode 100644 index 00000000..3818a893 --- /dev/null +++ b/app/Classes/Modules/Companies/Services/DeletesCompany.php @@ -0,0 +1,15 @@ +handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/FetchesCompany.php b/app/Classes/Modules/Companies/Services/FetchesCompany.php new file mode 100644 index 00000000..126f7ef8 --- /dev/null +++ b/app/Classes/Modules/Companies/Services/FetchesCompany.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/ListsCompanies.php b/app/Classes/Modules/Companies/Services/ListsCompanies.php new file mode 100644 index 00000000..179704e7 --- /dev/null +++ b/app/Classes/Modules/Companies/Services/ListsCompanies.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/UpdatesCompany.php b/app/Classes/Modules/Companies/Services/UpdatesCompany.php new file mode 100644 index 00000000..0ffb47be --- /dev/null +++ b/app/Classes/Modules/Companies/Services/UpdatesCompany.php @@ -0,0 +1,21 @@ +reference_no = $object->getReferenceNo(); + $model->name = $object->getName(); + $model->type = $object->getType(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Standards/Rules/CanCreateCompany.php b/app/Classes/Modules/Companies/Standards/Rules/CanCreateCompany.php new file mode 100644 index 00000000..9e06253b --- /dev/null +++ b/app/Classes/Modules/Companies/Standards/Rules/CanCreateCompany.php @@ -0,0 +1,57 @@ +companyValidation = $companyValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param CompanyObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->companyValidation->validate($object); + + } + + + /** + * @param CompanyObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Standards/Rules/CanDeleteCompany.php b/app/Classes/Modules/Companies/Standards/Rules/CanDeleteCompany.php new file mode 100644 index 00000000..b2621b4f --- /dev/null +++ b/app/Classes/Modules/Companies/Standards/Rules/CanDeleteCompany.php @@ -0,0 +1,43 @@ +companyValidation = $companyValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param CompanyObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->companyValidation->validate($object); + + } + + + /** + * @param CompanyObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Standards/Validators/CompanyValidation.php b/app/Classes/Modules/Companies/Standards/Validators/CompanyValidation.php new file mode 100644 index 00000000..f147f206 --- /dev/null +++ b/app/Classes/Modules/Companies/Standards/Validators/CompanyValidation.php @@ -0,0 +1,43 @@ + $object->getReferenceNo(), + 'name' => $object->getName(), + 'type' => $object->getType() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'reference_no' => 'required', + 'name' => 'required', + 'type' => 'required' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/ControllerLogic/CreateContactControllerLogic.php b/app/Classes/Modules/Contacts/ControllerLogic/CreateContactControllerLogic.php new file mode 100644 index 00000000..bbd17f5e --- /dev/null +++ b/app/Classes/Modules/Contacts/ControllerLogic/CreateContactControllerLogic.php @@ -0,0 +1,70 @@ + 'Created Contact', + 'message' => 'You have successfully created a new Contact' + ]; + } + + /** @var CanCreateContact */ + private $canCreateContact; + + /** @var CreatesContact */ + private $createsContact; + + /** + * CreateContactControllerLogic constructor. + * @param CanCreateContact $canCreateContact + * @param CreatesContact $createsContact + */ + public function __construct(CanCreateContact $canCreateContact, CreatesContact $createsContact) + { + $this->canCreateContact = $canCreateContact; + $this->createsContact = $createsContact; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + dd($request->all()); + try { + + $object = new ContactObject($request->input('company_id'), $request->input('name'), $request->input('designation'), $request->input('email'), $request->input('phone'), $request->input('wechat_id')); + + $this->canCreateContact->passes($object); + + $query = $this->createsContact->execute($object); + + return $this->resourceResponse(new ContactResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/ControllerLogic/DeleteContactControllerLogic.php b/app/Classes/Modules/Contacts/ControllerLogic/DeleteContactControllerLogic.php new file mode 100644 index 00000000..fb3f6aa5 --- /dev/null +++ b/app/Classes/Modules/Contacts/ControllerLogic/DeleteContactControllerLogic.php @@ -0,0 +1,73 @@ + 'Deleted Contact', + 'message' => 'You have successfully deleted a Contact' + ]; + } + + + /** @var CanDeleteContact */ + private $canDeleteContact; + + /** @var DeletesContact */ + private $deletesContact; + + /** @var FetchesContact */ + private $fetchesContact; + + /** + * DeleteContactControllerLogic constructor. + * @param CanDeleteContact $canDeleteContact + * @param DeletesContact $deletesContact + * @param FetchesContact $fetchesContact + */ + public function __construct(CanDeleteContact $canDeleteContact, DeletesContact $deletesContact, FetchesContact $fetchesContact) + { + $this->canDeleteContact = $canDeleteContact; + $this->deletesContact = $deletesContact; + $this->fetchesContact = $fetchesContact; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canDeleteContact->passes(); + + $query = $this->fetchesContact->execute(['id' => $request->route('id')]); + + $this->deletesContact->execute($query); + + return $this->response([]); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/ControllerLogic/FetchContactControllerLogic.php b/app/Classes/Modules/Contacts/ControllerLogic/FetchContactControllerLogic.php new file mode 100644 index 00000000..70380905 --- /dev/null +++ b/app/Classes/Modules/Contacts/ControllerLogic/FetchContactControllerLogic.php @@ -0,0 +1,67 @@ + 'Retrieved Contact', + 'message' => 'You have successfully retrieved a Contact' + ]; + } + + /** @var CanFetchContact */ + private $canFetchContact; + + /** @var FetchesContact */ + private $fetchesContact; + + /** + * FetchContactControllerLogic constructor. + * @param CanFetchContact $canFetchContact + * @param FetchesContact $fetchesContact + */ + public function __construct(CanFetchContact $canFetchContact, FetchesContact $fetchesContact) + { + $this->canFetchContact = $canFetchContact; + $this->fetchesContact = $fetchesContact; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canFetchContact->passes(); + + $query = $this->fetchesContact->execute(['id' => $request->route('id')]); + + return $this->resourceResponse(new ContactResource($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/ControllerLogic/ListContactsControllerLogic.php b/app/Classes/Modules/Contacts/ControllerLogic/ListContactsControllerLogic.php new file mode 100644 index 00000000..b7670af3 --- /dev/null +++ b/app/Classes/Modules/Contacts/ControllerLogic/ListContactsControllerLogic.php @@ -0,0 +1,66 @@ + 'Retrieved Contacts', + 'message' => 'You have successfully retrieved a list of Contacts' + ]; + } + + /** @var CanListContacts */ + private $canListContacts; + + /** @var ListsContacts */ + private $listsContacts; + + /** + * ListContactsControllerLogic constructor. + * @param CanListContacts $canListContacts + * @param ListsContacts $listsContacts + */ + public function __construct(CanListContacts $canListContacts, ListsContacts $listsContacts) + { + $this->canListContacts = $canListContacts; + $this->listsContacts = $listsContacts; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $this->canListContacts->passes(); + + $query = $this->listsContacts->execute($this->listsContacts->deserializeFilters($request->input('filters'))); + + return $this->collectionResponse(ContactResource::collection($query)); + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/ControllerLogic/UpdateContactControllerLogic.php b/app/Classes/Modules/Contacts/ControllerLogic/UpdateContactControllerLogic.php new file mode 100644 index 00000000..cfd98cfd --- /dev/null +++ b/app/Classes/Modules/Contacts/ControllerLogic/UpdateContactControllerLogic.php @@ -0,0 +1,78 @@ + 'Updated Contact', + 'message' => 'You have successfully updated the Contact' + ]; + } + + /** @var CanUpdateContact */ + private $canUpdateContact; + + /** @var UpdatesContact */ + private $updatesContact; + + /** @var FetchesContact */ + private $fetchesContact; + + /** + * UpdateContactControllerLogic constructor. + * @param CanUpdateContact $canUpdateContact + * @param UpdatesContact $updatesContact + * @param FetchesContact $fetchesContact + */ + public function __construct(CanUpdateContact $canUpdateContact, UpdatesContact $updatesContact, FetchesContact $fetchesContact) + { + $this->canUpdateContact = $canUpdateContact; + $this->updatesContact = $updatesContact; + $this->fetchesContact = $fetchesContact; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws ErrorException + */ + public function logic(Request $request) : JsonResponse + { + try { + + $object = new ContactObject($request->input('company_id'), $request->input('name'), $request->input('designation'), $request->input('email'), $request->input('phone'), $request->input('wechat_id')); + + $this->canUpdateContact->passes($object); + + $query = $this->fetchesContact->execute(['id' => $request->route('id')]); + + $query = $this->updatesContact->execute($query, $object); + + return $this->resourceResponse(new ContactResource($query)); + + + } catch (\Exception $exception){ + throw new ErrorException($exception->getMessage(), $exception->getCode()); + } + + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/DataTransferObjects/ContactObject.php b/app/Classes/Modules/Contacts/DataTransferObjects/ContactObject.php new file mode 100644 index 00000000..28506f77 --- /dev/null +++ b/app/Classes/Modules/Contacts/DataTransferObjects/ContactObject.php @@ -0,0 +1,97 @@ +companyId = $companyId; + $this->name = $name; + $this->designation = $designation; + $this->email = $email; + $this->phone = $phone; + $this->wechatId = $wechatId; + } + + /** + * @return int + */ + public function getCompanyId(): int + { + return $this->companyId; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @return null|string + */ + public function getDesignation(): ?string + { + return $this->designation; + } + + /** + * @return null|string + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @return null|string + */ + public function getPhone(): ?string + { + return $this->phone; + } + + /** + * @return null|string + */ + public function getWechatId(): ?string + { + return $this->wechatId; + } + + + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Services/CreatesContact.php b/app/Classes/Modules/Contacts/Services/CreatesContact.php new file mode 100644 index 00000000..f895685d --- /dev/null +++ b/app/Classes/Modules/Contacts/Services/CreatesContact.php @@ -0,0 +1,24 @@ +company_id = $object->getCompanyId(); + $model->name = $object->getName(); + $model->designation = $object->getDesignation(); + $model->email = $object->getEmail(); + $model->phone = $object->getPhone(); + $model->wechat_id = $object->getWechatId(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Services/DeletesContact.php b/app/Classes/Modules/Contacts/Services/DeletesContact.php new file mode 100644 index 00000000..80edd83e --- /dev/null +++ b/app/Classes/Modules/Contacts/Services/DeletesContact.php @@ -0,0 +1,15 @@ +handler($model); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Services/FetchesContact.php b/app/Classes/Modules/Contacts/Services/FetchesContact.php new file mode 100644 index 00000000..1aee5687 --- /dev/null +++ b/app/Classes/Modules/Contacts/Services/FetchesContact.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + public function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Services/ListsContacts.php b/app/Classes/Modules/Contacts/Services/ListsContacts.php new file mode 100644 index 00000000..cbfa35ce --- /dev/null +++ b/app/Classes/Modules/Contacts/Services/ListsContacts.php @@ -0,0 +1,33 @@ +repository = $repository; + } + + + /** + * @return Builder + */ + function getRepository(): Builder + { + return $this->repository->newQuery(); + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Services/UpdatesContact.php b/app/Classes/Modules/Contacts/Services/UpdatesContact.php new file mode 100644 index 00000000..3c17a6f8 --- /dev/null +++ b/app/Classes/Modules/Contacts/Services/UpdatesContact.php @@ -0,0 +1,24 @@ +company_id = $object->getCompanyId(); + $model->name = $object->getName(); + $model->designation = $object->getDesignation(); + $model->email = $object->getEmail(); + $model->phone = $object->getPhone(); + $model->wechat_id = $object->getWechatId(); + + return $this->handler($model); + + } +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Standards/Rules/CanCreateContact.php b/app/Classes/Modules/Contacts/Standards/Rules/CanCreateContact.php new file mode 100644 index 00000000..cb935b7e --- /dev/null +++ b/app/Classes/Modules/Contacts/Standards/Rules/CanCreateContact.php @@ -0,0 +1,57 @@ +contactValidation = $contactValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param ContactObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->contactValidation->validate($object); + + } + + + /** + * @param ContactObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Standards/Rules/CanDeleteContact.php b/app/Classes/Modules/Contacts/Standards/Rules/CanDeleteContact.php new file mode 100644 index 00000000..29800e6d --- /dev/null +++ b/app/Classes/Modules/Contacts/Standards/Rules/CanDeleteContact.php @@ -0,0 +1,43 @@ +contactValidation = $contactValidation; + } + + + /** + * @return bool + */ + protected function authorized(): bool + { + // TODO Set Authorization rules + return true; + + } + + /** + * @param ContactObject $object + * @return bool + * @throws \App\Classes\Exceptions\RequestValidationException + */ + protected function validators($object): bool + { + return $this->contactValidation->validate($object); + + } + + + /** + * @param ContactObject $object + * @return bool + */ + protected function criteria($object): bool + { + return true; + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Contacts/Standards/Validators/ContactValidation.php b/app/Classes/Modules/Contacts/Standards/Validators/ContactValidation.php new file mode 100644 index 00000000..01261737 --- /dev/null +++ b/app/Classes/Modules/Contacts/Standards/Validators/ContactValidation.php @@ -0,0 +1,45 @@ + $object->getCompanyId(), + 'name' => $object->getName(), + 'designation' => $object->getDesignation(), + 'email' => $object->getEmail(), + 'phone' => $object->getPhone(), + 'wechat_id' => $object->getWechatId() + ]; + } + + /** + * @return array + */ + protected function rules(): array { + return [ + 'company_id' => 'required', + 'name' => 'required' + ]; + } + + /** + * @return array + */ + protected function messages(): array { + return []; + } + +} \ No newline at end of file diff --git a/app/Classes/Notifications/AbstractEmail.php b/app/Classes/Notifications/AbstractEmail.php new file mode 100644 index 00000000..83efa01c --- /dev/null +++ b/app/Classes/Notifications/AbstractEmail.php @@ -0,0 +1,15 @@ +user = $user; + $this->attempt = $attempt; + } + + public function toMail() + { + return (new MailMessage) + ->subject('Reset Password') + ->view('emails.account.reset_password', ['user' => $this->user, 'attempt' => $this->attempt]); + } + + +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/AccountStatus.php b/app/Classes/ValueObjects/Constants/AccountStatus.php new file mode 100644 index 00000000..abddb71f --- /dev/null +++ b/app/Classes/ValueObjects/Constants/AccountStatus.php @@ -0,0 +1,20 @@ + 'Pending Verification', + 1 => 'Active', + 2 => 'Suspended', + ]; + +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/HttpStatus.php b/app/Classes/ValueObjects/Constants/HttpStatus.php new file mode 100644 index 00000000..9a95658a --- /dev/null +++ b/app/Classes/ValueObjects/Constants/HttpStatus.php @@ -0,0 +1,29 @@ + self::CLIENT_MODULE, + 'project' => self::PROJECT_MODULE, + 'task' => self::TASK_MODULE, + 'ticket' => self::TICKET_MODULE, + 'document' => self::DOCUMENT_MODULE, + 'field' => self::FIELD_MODULE, + 'status' => self::STATUS_LIST, + ]; + + public const STATUS_LIST= 21; + +} diff --git a/app/Classes/ValueObjects/Constants/Notifications.php b/app/Classes/ValueObjects/Constants/Notifications.php new file mode 100644 index 00000000..0bc263a0 --- /dev/null +++ b/app/Classes/ValueObjects/Constants/Notifications.php @@ -0,0 +1,29 @@ + 'Unknown Action', + 'message' => 'unknown message..' + ]; + + public const AUTHENTICATION = [ + 'title' => 'Authentication', + 'message' => 'You have successfully logged in to your account' + ]; + + public const RESET_PASSWORD = [ + 'title' => 'Reset Password', + 'message' => 'You have successfully sent you an email to reset your password' + ]; + + public const CHANGE_PASSWORD = [ + 'title' => 'Change Password', + 'message' => 'You password has changed successfully' + ]; + +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Constants/Roles.php b/app/Classes/ValueObjects/Constants/Roles.php new file mode 100644 index 00000000..a4da942f --- /dev/null +++ b/app/Classes/ValueObjects/Constants/Roles.php @@ -0,0 +1,20 @@ + 'User', + 1 => 'Admin', + 2 => 'Super Admin', + ]; + +} \ No newline at end of file diff --git a/app/Classes/ValueObjects/Response/ApiResponseObject.php b/app/Classes/ValueObjects/Response/ApiResponseObject.php new file mode 100644 index 00000000..a63c6efb --- /dev/null +++ b/app/Classes/ValueObjects/Response/ApiResponseObject.php @@ -0,0 +1,79 @@ +title = $title; + $this->message = $message; + $this->statusCode = $statusCode; + $this->data = $data; + + } + + /** + * @return JsonResponse + */ + public function handler(){ + return new JsonResponse(['title' => $this->getTitle(), 'message' => $this->getMessage(), 'payload' => $this->getData()], $this->getStatusCode()); + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + + /** + * @return int + */ + public function getStatusCode(): int + { + return $this->statusCode; + } + + /** + * @return array + */ + public function getData(): array + { + return $this->data; + } +} \ No newline at end of file diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php new file mode 100644 index 00000000..541fd37e --- /dev/null +++ b/app/Console/Kernel.php @@ -0,0 +1,46 @@ +command('inspire')->hourly(); + } + + /** + * Register the commands for the application. + * + * @return void + */ + protected function commands() + { + $this->load(__DIR__.'/Commands'); + + require base_path('routes/console.php'); + } +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php new file mode 100644 index 00000000..8ca61ac2 --- /dev/null +++ b/app/Exceptions/Handler.php @@ -0,0 +1,67 @@ +view('pages.errors.maintenance'); + } + + if ($exception instanceof AuthenticationException) { + return (new ApiResponseObject('Authentication', 'To keep your account secure we need to re-validate your account', HttpStatus::ACCESS_UNAUTHORISED))->handler(); + } + + return parent::render($request, $exception); + } +} diff --git a/app/Http/Controllers/Account/Authentication/CheckEmailController.php b/app/Http/Controllers/Account/Authentication/CheckEmailController.php new file mode 100644 index 00000000..2cc37ac9 --- /dev/null +++ b/app/Http/Controllers/Account/Authentication/CheckEmailController.php @@ -0,0 +1,21 @@ +execute($request); + } + +} diff --git a/app/Http/Controllers/Account/Authentication/GeneratePasswordResetController.php b/app/Http/Controllers/Account/Authentication/GeneratePasswordResetController.php new file mode 100644 index 00000000..079adba4 --- /dev/null +++ b/app/Http/Controllers/Account/Authentication/GeneratePasswordResetController.php @@ -0,0 +1,22 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Account/Authentication/ResetPasswordController.php b/app/Http/Controllers/Account/Authentication/ResetPasswordController.php new file mode 100644 index 00000000..fb12c863 --- /dev/null +++ b/app/Http/Controllers/Account/Authentication/ResetPasswordController.php @@ -0,0 +1,22 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Account/Authentication/UserAuthenticationController.php b/app/Http/Controllers/Account/Authentication/UserAuthenticationController.php new file mode 100644 index 00000000..c1fda0f5 --- /dev/null +++ b/app/Http/Controllers/Account/Authentication/UserAuthenticationController.php @@ -0,0 +1,21 @@ +execute($request); + } + +} diff --git a/app/Http/Controllers/Account/User/ListUsersController.php b/app/Http/Controllers/Account/User/ListUsersController.php new file mode 100644 index 00000000..b2c815fa --- /dev/null +++ b/app/Http/Controllers/Account/User/ListUsersController.php @@ -0,0 +1,30 @@ +listsUsers = $listsUsers; + } + + + public function list(Request $request, ListUsersControllerLogic $logic): JsonResponse { + return $logic->execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Addresses/CreateAddressController.php b/app/Http/Controllers/Addresses/CreateAddressController.php new file mode 100644 index 00000000..936b5f3c --- /dev/null +++ b/app/Http/Controllers/Addresses/CreateAddressController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Addresses/DeleteAddressController.php b/app/Http/Controllers/Addresses/DeleteAddressController.php new file mode 100644 index 00000000..380a8c41 --- /dev/null +++ b/app/Http/Controllers/Addresses/DeleteAddressController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Addresses/FetchAddressController.php b/app/Http/Controllers/Addresses/FetchAddressController.php new file mode 100644 index 00000000..a348a9a1 --- /dev/null +++ b/app/Http/Controllers/Addresses/FetchAddressController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Addresses/ListAddressesController.php b/app/Http/Controllers/Addresses/ListAddressesController.php new file mode 100644 index 00000000..c6e03d5c --- /dev/null +++ b/app/Http/Controllers/Addresses/ListAddressesController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Addresses/UpdateAddressController.php b/app/Http/Controllers/Addresses/UpdateAddressController.php new file mode 100644 index 00000000..1fd3f356 --- /dev/null +++ b/app/Http/Controllers/Addresses/UpdateAddressController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Companies/CreateCompanyController.php b/app/Http/Controllers/Companies/CreateCompanyController.php new file mode 100644 index 00000000..67a7e30f --- /dev/null +++ b/app/Http/Controllers/Companies/CreateCompanyController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Companies/DeleteCompanyController.php b/app/Http/Controllers/Companies/DeleteCompanyController.php new file mode 100644 index 00000000..0eae86b5 --- /dev/null +++ b/app/Http/Controllers/Companies/DeleteCompanyController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Companies/FetchCompanyController.php b/app/Http/Controllers/Companies/FetchCompanyController.php new file mode 100644 index 00000000..4e02d14a --- /dev/null +++ b/app/Http/Controllers/Companies/FetchCompanyController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Companies/ListCompaniesController.php b/app/Http/Controllers/Companies/ListCompaniesController.php new file mode 100644 index 00000000..9bd2f2b0 --- /dev/null +++ b/app/Http/Controllers/Companies/ListCompaniesController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Companies/UpdateCompanyController.php b/app/Http/Controllers/Companies/UpdateCompanyController.php new file mode 100644 index 00000000..33ad8338 --- /dev/null +++ b/app/Http/Controllers/Companies/UpdateCompanyController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Contacts/CreateContactController.php b/app/Http/Controllers/Contacts/CreateContactController.php new file mode 100644 index 00000000..3dd089aa --- /dev/null +++ b/app/Http/Controllers/Contacts/CreateContactController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Contacts/DeleteContactController.php b/app/Http/Controllers/Contacts/DeleteContactController.php new file mode 100644 index 00000000..3ca4c209 --- /dev/null +++ b/app/Http/Controllers/Contacts/DeleteContactController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Contacts/FetchContactController.php b/app/Http/Controllers/Contacts/FetchContactController.php new file mode 100644 index 00000000..7fd48a27 --- /dev/null +++ b/app/Http/Controllers/Contacts/FetchContactController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Contacts/ListContactsController.php b/app/Http/Controllers/Contacts/ListContactsController.php new file mode 100644 index 00000000..179bd117 --- /dev/null +++ b/app/Http/Controllers/Contacts/ListContactsController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Contacts/UpdateContactController.php b/app/Http/Controllers/Contacts/UpdateContactController.php new file mode 100644 index 00000000..4f36d823 --- /dev/null +++ b/app/Http/Controllers/Contacts/UpdateContactController.php @@ -0,0 +1,20 @@ +execute($request); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 00000000..a0a2a8a3 --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,13 @@ +company_id = $request->company_id; + } + +} \ No newline at end of file diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php new file mode 100644 index 00000000..94a92925 --- /dev/null +++ b/app/Http/Kernel.php @@ -0,0 +1,76 @@ + [ + EncryptCookies::class, + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, + \Illuminate\Session\Middleware\StartSession::class, + // \Illuminate\Session\Middleware\AuthenticateSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + VerifyCsrfToken::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + + 'api' => [ + 'throttle:60,1', + \Illuminate\Routing\Middleware\SubstituteBindings::class, + ], + ]; + + /** + * The application's route middleware. + * + * These middleware may be assigned to groups or used individually. + * + * @var array + */ + protected $routeMiddleware = [ + 'auth' => Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + 'valid.token' => ValidateToken::class + ]; +} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php new file mode 100644 index 00000000..704089a7 --- /dev/null +++ b/app/Http/Middleware/Authenticate.php @@ -0,0 +1,21 @@ +expectsJson()) { + return route('login'); + } + } +} diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/CheckForMaintenanceMode.php new file mode 100644 index 00000000..35b9824b --- /dev/null +++ b/app/Http/Middleware/CheckForMaintenanceMode.php @@ -0,0 +1,17 @@ +check()) { + return redirect(RouteServiceProvider::HOME); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php new file mode 100644 index 00000000..5a50e7b5 --- /dev/null +++ b/app/Http/Middleware/TrimStrings.php @@ -0,0 +1,18 @@ +allSubdomainsOfApplicationUrl(), + ]; + } +} diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php new file mode 100644 index 00000000..14befceb --- /dev/null +++ b/app/Http/Middleware/TrustProxies.php @@ -0,0 +1,23 @@ +authenticate(); + } catch (Exception $exception) { + return (new ApiResponseObject('Authentication', 'To keep your account secure we need to re-validate your account', HttpStatus::ACCESS_UNAUTHORISED))->handler(); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php new file mode 100644 index 00000000..0c13b854 --- /dev/null +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -0,0 +1,17 @@ + $this->id, + 'company_id' => $this->company_id, + 'street_one' => $this->street_one, + 'street_two' => $this->street_two, + 'city' => $this->city, + 'state' => $this->state, + 'post_code' => $this->post_code, + 'country' => $this->country, + 'default' => $this->default, + 'billing' => $this->billing + ]; + } +} diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php new file mode 100644 index 00000000..f78c2326 --- /dev/null +++ b/app/Http/Resources/CompanyResource.php @@ -0,0 +1,27 @@ + $this->id, + 'account_no' => $this->reference_no, + 'name' => $this->name, + 'type' => $this->type, + 'status' => AccountStatus::STATUS[$this->status], + 'delivery_address' => new AddressResource($this->deliveryAddress) + ]; + } +} diff --git a/app/Http/Resources/ContactResource.php b/app/Http/Resources/ContactResource.php new file mode 100644 index 00000000..aac052ee --- /dev/null +++ b/app/Http/Resources/ContactResource.php @@ -0,0 +1,27 @@ + $this->id, + 'company_id' => $this->company_id, + 'name' => $this->name, + 'designation' => $this->designation, + 'email' => $this->email, + 'phone' => $this->phone, + 'wechat_id' => $this->wechat_id + ]; + } +} diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php new file mode 100644 index 00000000..a427f17e --- /dev/null +++ b/app/Http/Resources/UserResource.php @@ -0,0 +1,23 @@ + $this->first_name.' '.$this->last_name, + 'email' => $this->email, + 'role_id' => (int) $this->role_id, + 'role_name' => Roles::ROLES_NAMES[$this->role_id], + 'created_at' =>Carbon::parse($this->created_at)->format('d/m/Y') + ]; + } + +} \ No newline at end of file diff --git a/app/Models/AbstractModel.php b/app/Models/AbstractModel.php new file mode 100644 index 00000000..7a7c9c06 --- /dev/null +++ b/app/Models/AbstractModel.php @@ -0,0 +1,13 @@ + 'string', + 'street_two' => 'string', + 'city' => 'string', + 'state' => 'string', + 'post_code' => 'string', + 'country' => 'string', + 'default' => 'integer', + 'billing' => 'integer' + ]; + + /** + * Validation rules + * + * @var array + */ + public static $rules = [ + 'company_id' => 'required', + 'street_one' => 'required', + 'city' => 'required', + 'state' => 'required', + 'post_code' => 'required', + 'country' => 'required', + 'default' => 'required', + 'billing' => 'required' + ]; + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasOne + **/ + public function company(): HasOne + { + return $this->hasOne(\App\Models\Company::class, 'company_id', 'id'); + } + +} diff --git a/app/Models/Company.php b/app/Models/Company.php new file mode 100644 index 00000000..4f37c7bf --- /dev/null +++ b/app/Models/Company.php @@ -0,0 +1,71 @@ + 'integer', + 'name' => 'string', + 'type' => 'integer' + ]; + + /** + * Validation rules + * + * @var array + */ + public static $rules = [ + 'reference_no' => 'required', + 'name' => 'required', + 'type' => 'required' + ]; + + public function addresses(): hasMany + { + return $this->hasMany(Address::class, 'company_id', 'id'); + } + + public function deliveryAddress(): hasOne { + return $this->hasOne(Address::class)->where('default', 1); + } + + + +} diff --git a/app/Models/Contact.php b/app/Models/Contact.php new file mode 100644 index 00000000..f51a08ed --- /dev/null +++ b/app/Models/Contact.php @@ -0,0 +1,74 @@ + 'string', + 'designation' => 'string', + 'email' => 'string', + 'phone' => 'string', + 'wechat_id' => 'string' + ]; + + /** + * Validation rules + * + * @var array + */ + public static $rules = [ + 'company_id' => 'required', + 'name' => 'required' + ]; + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasOne + **/ + public function company(): HasOne + { + return $this->hasOne(\App\Models\Company::class, 'company_id', 'id'); + } + +} diff --git a/app/Models/Order.php b/app/Models/Order.php new file mode 100644 index 00000000..7c07ddfa --- /dev/null +++ b/app/Models/Order.php @@ -0,0 +1,46 @@ +where('is_expired', false)->where('is_complete', false); + } + + public function user(): BelongsTo { + return $this->belongsTo(User::class, 'user_id', 'id'); + } +} diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 00000000..906553c1 --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,76 @@ + 'datetime', + ]; + + /** + * Get the identifier that will be stored in the subject claim of the JWT. + * + * @return mixed + */ + public function getJWTIdentifier() + { + return $this->getKey(); + } + + /** + * Return a key value array, containing any custom claims to be added to the JWT. + * + * @return array + */ + public function getJWTCustomClaims() + { + return []; + } + + public function passwordReset(): HasMany { + return $this->hasMany(PasswordReset::class, 'user_id', 'id'); + } + + +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100644 index 00000000..8802ed7a --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,29 @@ + 'App\Policies\ModelPolicy', + ]; + + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } +} diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php new file mode 100644 index 00000000..395c518b --- /dev/null +++ b/app/Providers/BroadcastServiceProvider.php @@ -0,0 +1,21 @@ + [ + SendEmailVerificationNotification::class, + ], + ]; + + /** + * Register any events for your application. + * + * @return void + */ + public function boot() + { + parent::boot(); + + // + } +} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php new file mode 100644 index 00000000..540d17b4 --- /dev/null +++ b/app/Providers/RouteServiceProvider.php @@ -0,0 +1,80 @@ +mapApiRoutes(); + + $this->mapWebRoutes(); + + // + } + + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + * + * @return void + */ + protected function mapWebRoutes() + { + Route::middleware('web') + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); + } + + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + * + * @return void + */ + protected function mapApiRoutes() + { + Route::prefix('api') + ->middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); + } +} diff --git a/artisan b/artisan new file mode 100644 index 00000000..5c23e2e2 --- /dev/null +++ b/artisan @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once Artisan has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 00000000..037e17df --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,55 @@ +singleton( + Illuminate\Contracts\Http\Kernel::class, + App\Http\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Return The Application +|-------------------------------------------------------------------------- +| +| This script returns the application instance. The instance is given to +| the calling script so we can separate the building of the instances +| from the actual running of the application and sending responses. +| +*/ + +return $app; diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..f28aa35c --- /dev/null +++ b/composer.json @@ -0,0 +1,66 @@ +{ + "name": "laravel/laravel", + "type": "project", + "description": "The Laravel Framework.", + "keywords": [ + "framework", + "laravel" + ], + "license": "MIT", + "require": { + "php": "^7.2.5", + "ext-json": "^1.6", + "fideloper/proxy": "^4.2", + "fruitcake/laravel-cors": "^1.0", + "guzzlehttp/guzzle": "^6.3", + "laravel/framework": "^7.0", + "laravel/tinker": "^2.0", + "spatie/laravel-activitylog": "^3.14", + "tymon/jwt-auth": "^1.0" + }, + "require-dev": { + "facade/ignition": "^2.0", + "fzaninotto/faker": "^1.9.1", + "mockery/mockery": "^1.3.1", + "nunomaduro/collision": "^4.1", + "phpunit/phpunit": "^8.5" + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "autoload": { + "psr-4": { + "App\\": "app/" + }, + "classmap": [ + "database/seeds", + "database/factories" + ] + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover --ansi" + ], + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate --ansi" + ] + } +} diff --git a/config/activitylog.php b/config/activitylog.php new file mode 100644 index 00000000..a6558ecb --- /dev/null +++ b/config/activitylog.php @@ -0,0 +1,52 @@ + env('ACTIVITY_LOGGER_ENABLED', true), + + /* + * When the clean-command is executed, all recording activities older than + * the number of days specified here will be deleted. + */ + 'delete_records_older_than_days' => 365, + + /* + * If no log name is passed to the activity() helper + * we use this default log name. + */ + 'default_log_name' => 'default', + + /* + * You can specify an auth driver here that gets user models. + * If this is null we'll use the default Laravel auth driver. + */ + 'default_auth_driver' => null, + + /* + * If set to true, the subject returns soft deleted models. + */ + 'subject_returns_soft_deleted_models' => false, + + /* + * This model will be used to log activity. + * It should be implements the Spatie\Activitylog\Contracts\Activity interface + * and extend Illuminate\Database\Eloquent\Model. + */ + 'activity_model' => \Spatie\Activitylog\Models\Activity::class, + + /* + * This is the name of the table that will be created by the migration and + * used by the Activity model shipped with this package. + */ + 'table_name' => 'activity_log', + + /* + * This is the database connection that will be used by the migration and + * the Activity model shipped with this package. In case it's not set + * Laravel database.default will be used instead. + */ + 'database_connection' => env('ACTIVITY_LOGGER_DB_CONNECTION'), +]; diff --git a/config/app.php b/config/app.php new file mode 100644 index 00000000..8409e00e --- /dev/null +++ b/config/app.php @@ -0,0 +1,232 @@ + env('APP_NAME', 'Laravel'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + 'asset_url' => env('ASSET_URL', null), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. We have gone + | ahead and set this to a sensible default for you out of the box. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by the translation service provider. You are free to set this value + | to any of the locales which will be supported by the application. + | + */ + + 'locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Application Fallback Locale + |-------------------------------------------------------------------------- + | + | The fallback locale determines the locale to use when the current one + | is not available. You may change the value to correspond to any of + | the language folders that are provided through your application. + | + */ + + 'fallback_locale' => 'en', + + /* + |-------------------------------------------------------------------------- + | Faker Locale + |-------------------------------------------------------------------------- + | + | This locale will be used by the Faker PHP library when generating fake + | data for your database seeds. For example, this will be used to get + | localized telephone numbers, street address information and more. + | + */ + + 'faker_locale' => 'en_US', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => env('APP_KEY'), + + 'cipher' => 'AES-256-CBC', + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + + /* + * Laravel Framework Service Providers... + */ + Illuminate\Auth\AuthServiceProvider::class, + Illuminate\Broadcasting\BroadcastServiceProvider::class, + Illuminate\Bus\BusServiceProvider::class, + Illuminate\Cache\CacheServiceProvider::class, + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + Illuminate\Cookie\CookieServiceProvider::class, + Illuminate\Database\DatabaseServiceProvider::class, + Illuminate\Encryption\EncryptionServiceProvider::class, + Illuminate\Filesystem\FilesystemServiceProvider::class, + Illuminate\Foundation\Providers\FoundationServiceProvider::class, + Illuminate\Hashing\HashServiceProvider::class, + Illuminate\Mail\MailServiceProvider::class, + Illuminate\Notifications\NotificationServiceProvider::class, + Illuminate\Pagination\PaginationServiceProvider::class, + Illuminate\Pipeline\PipelineServiceProvider::class, + Illuminate\Queue\QueueServiceProvider::class, + Illuminate\Redis\RedisServiceProvider::class, + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + Illuminate\Session\SessionServiceProvider::class, + Illuminate\Translation\TranslationServiceProvider::class, + Illuminate\Validation\ValidationServiceProvider::class, + Illuminate\View\ViewServiceProvider::class, + + /* + * Package Service Providers... + */ + + /* + * Application Service Providers... + */ + App\Providers\AppServiceProvider::class, + App\Providers\AuthServiceProvider::class, + // App\Providers\BroadcastServiceProvider::class, + App\Providers\EventServiceProvider::class, + App\Providers\RouteServiceProvider::class, + + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + + 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Http' => Illuminate\Support\Facades\Http::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Notification' => Illuminate\Support\Facades\Notification::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + + ], + +]; diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 00000000..3a2555c1 --- /dev/null +++ b/config/auth.php @@ -0,0 +1,117 @@ + [ + 'guard' => 'api', + 'passwords' => 'users', + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | here which uses session storage and the Eloquent user provider. + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | Supported: "session", "token" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + + 'api' => [ + 'driver' => 'jwt', + 'provider' => 'users', + 'hash' => false, + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication drivers have a user provider. This defines how the + | users are actually retrieved out of your database or other storage + | mechanisms used by this application to persist your user's data. + | + | If you have multiple user tables or models you may configure multiple + | sources which represent each model / table. These sources may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => App\Models\User::class, + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | You may specify multiple password reset configurations if you have more + | than one user table or model in the application and you want to have + | separate password reset settings based on the specific user types. + | + | The expire time is the number of minutes that the reset token should be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => 'password_resets', + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + +]; diff --git a/config/broadcasting.php b/config/broadcasting.php new file mode 100644 index 00000000..3bba1103 --- /dev/null +++ b/config/broadcasting.php @@ -0,0 +1,59 @@ + env('BROADCAST_DRIVER', 'null'), + + /* + |-------------------------------------------------------------------------- + | Broadcast Connections + |-------------------------------------------------------------------------- + | + | Here you may define all of the broadcast connections that will be used + | to broadcast events to other systems or over websockets. Samples of + | each available type of connection are provided inside this array. + | + */ + + 'connections' => [ + + 'pusher' => [ + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), + 'options' => [ + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'useTLS' => true, + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + + ], + +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 00000000..4f41fdf9 --- /dev/null +++ b/config/cache.php @@ -0,0 +1,104 @@ + env('CACHE_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + */ + + 'stores' => [ + + 'apc' => [ + 'driver' => 'apc', + ], + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'cache', + 'connection' => null, + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'cache', + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing a RAM based store such as APC or Memcached, there might + | be other applications utilizing the same cache. So, we'll specify a + | value to get prefixed to all our keys so we can avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), + +]; diff --git a/config/cors.php b/config/cors.php new file mode 100644 index 00000000..558369dc --- /dev/null +++ b/config/cors.php @@ -0,0 +1,34 @@ + ['api/*'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => false, + +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 00000000..b42d9b30 --- /dev/null +++ b/config/database.php @@ -0,0 +1,147 @@ + env('DB_CONNECTION', 'mysql'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run in the database. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => [ + + 'client' => env('REDIS_CLIENT', 'phpredis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + ], + + 'default' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), + ], + + 'cache' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), + ], + + ], + +]; diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 00000000..94c81126 --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,85 @@ + env('FILESYSTEM_DRIVER', 'local'), + + /* + |-------------------------------------------------------------------------- + | Default Cloud Filesystem Disk + |-------------------------------------------------------------------------- + | + | Many applications store files both locally and in the cloud. For this + | reason, you may specify a default "cloud" driver here. This driver + | will be bound as the Cloud disk implementation in the container. + | + */ + + 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Here you may configure as many filesystem "disks" as you wish, and you + | may even configure multiple disks of the same driver. Defaults have + | been setup for each driver as an example of the required options. + | + | Supported Drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', + 'visibility' => 'public', + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/config/hashing.php b/config/hashing.php new file mode 100644 index 00000000..84257708 --- /dev/null +++ b/config/hashing.php @@ -0,0 +1,52 @@ + 'bcrypt', + + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'argon' => [ + 'memory' => 1024, + 'threads' => 2, + 'time' => 2, + ], + +]; diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 00000000..088c204e --- /dev/null +++ b/config/logging.php @@ -0,0 +1,104 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Out of + | the box, Laravel uses the Monolog PHP logging library. This gives + | you a variety of powerful log handlers / formatters to utilize. + | + | Available Drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", + | "custom", "stack" + | + */ + + 'channels' => [ + 'stack' => [ + 'driver' => 'stack', + 'channels' => ['single'], + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 14, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => 'Laravel Log', + 'emoji' => ':boom:', + 'level' => 'critical', + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => 'debug', + 'handler' => SyslogUdpHandler::class, + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + ], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'handler' => StreamHandler::class, + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'with' => [ + 'stream' => 'php://stderr', + ], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => 'debug', + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => 'debug', + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + ], + +]; diff --git a/config/mail.php b/config/mail.php new file mode 100644 index 00000000..54299aab --- /dev/null +++ b/config/mail.php @@ -0,0 +1,110 @@ + env('MAIL_MAILER', 'smtp'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers to be used while + | sending an e-mail. You will specify which one you are using for your + | mailers below. You are free to add additional mailers as required. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" + | + */ + + 'mailers' => [ + 'smtp' => [ + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'auth_mode' => null, + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'mailgun' => [ + 'transport' => 'mailgun', + ], + + 'postmark' => [ + 'transport' => 'postmark', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => '/usr/sbin/sendmail -bs', + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + ], + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', 'Example'), + ], + + /* + |-------------------------------------------------------------------------- + | Markdown Mail Settings + |-------------------------------------------------------------------------- + | + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! + | + */ + + 'markdown' => [ + 'theme' => 'default', + + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], + +]; diff --git a/config/queue.php b/config/queue.php new file mode 100644 index 00000000..00b76d65 --- /dev/null +++ b/config/queue.php @@ -0,0 +1,89 @@ + env('QUEUE_CONNECTION', 'sync'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection information for each server that + | is used by your application. A default configuration has been added + | for each back-end shipped with Laravel. You are free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', + 'retry_after' => 90, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', + 'retry_after' => 90, + 'block_for' => 0, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => 90, + 'block_for' => null, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control which database and table are used to store the jobs that + | have failed. You may change them to any database / table you wish. + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), + 'database' => env('DB_CONNECTION', 'mysql'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/services.php b/config/services.php new file mode 100644 index 00000000..2a1d616c --- /dev/null +++ b/config/services.php @@ -0,0 +1,33 @@ + [ + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), + ], + + 'postmark' => [ + 'token' => env('POSTMARK_TOKEN'), + ], + + 'ses' => [ + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + ], + +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 00000000..4e0f66cd --- /dev/null +++ b/config/session.php @@ -0,0 +1,201 @@ + env('SESSION_DRIVER', 'file'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to immediately expire on the browser closing, set that option. + | + */ + + 'lifetime' => env('SESSION_LIFETIME', 120), + + 'expire_on_close' => false, + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it is stored. All encryption will be run + | automatically by Laravel and you can use the Session like normal. + | + */ + + 'encrypt' => false, + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When using the native session driver, we need a location where session + | files may be stored. A default has been set for you but a different + | location may be specified. This is only needed for file sessions. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION', null), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table we + | should use to manage the sessions. Of course, a sensible default is + | provided for you; however, you are free to change this as needed. + | + */ + + 'table' => 'sessions', + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | While using one of the framework's cache driven session backends you may + | list a cache store that should be used for these sessions. This value + | must match with one of the application's configured cache "stores". + | + | Affects: "apc", "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE', null), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the cookie used to identify a session + | instance by ID. The name specified here will get used every time a + | new session cookie is created by the framework for every driver. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application but you are free to change this when necessary. + | + */ + + 'path' => '/', + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | Here you may change the domain of the cookie used to identify a session + | in your application. This will determine which domains the cookie is + | available to in your application. A sensible default has been set. + | + */ + + 'domain' => env('SESSION_DOMAIN', null), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you if it can not be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. You are free to modify this option if needed. + | + */ + + 'http_only' => true, + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" since this is a secure default value. + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => 'lax', + +]; diff --git a/config/view.php b/config/view.php new file mode 100644 index 00000000..22b8a18d --- /dev/null +++ b/config/view.php @@ -0,0 +1,36 @@ + [ + resource_path('views'), + ], + + /* + |-------------------------------------------------------------------------- + | Compiled View Path + |-------------------------------------------------------------------------- + | + | This option determines where all the compiled Blade templates will be + | stored for your application. Typically, this is within the storage + | directory. However, as usual, you are free to change this value. + | + */ + + 'compiled' => env( + 'VIEW_COMPILED_PATH', + realpath(storage_path('framework/views')) + ), + +]; diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 00000000..97fc9767 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1,2 @@ +*.sqlite +*.sqlite-journal diff --git a/database/factories/AddressFactory.php b/database/factories/AddressFactory.php new file mode 100644 index 00000000..6f3569c4 --- /dev/null +++ b/database/factories/AddressFactory.php @@ -0,0 +1,20 @@ +define(App\Models\Address::class, function (Faker $faker) { + + return [ + 'company_id' => $faker->numberBetween(1, 30), + 'street_one' => $faker->streetAddress, + 'street_two' => $faker->streetAddress, + 'city' => $faker->city, + 'state' => $faker->state, + 'post_code' => $faker->postcode, + 'country' => $faker->country, + 'default' => 1, + 'billing' => 1 + ]; +}); diff --git a/database/factories/CompanyFactory.php b/database/factories/CompanyFactory.php new file mode 100644 index 00000000..a6874a3e --- /dev/null +++ b/database/factories/CompanyFactory.php @@ -0,0 +1,14 @@ +define(App\Models\Company::class, function (Faker $faker) { + + return [ + 'reference_no' => $faker->numerify('##########'), + 'name' => $faker->company.' '.$faker->companySuffix, + 'type' => $faker->randomDigitNotNull + ]; +}); diff --git a/database/factories/ContactFactory.php b/database/factories/ContactFactory.php new file mode 100644 index 00000000..08f5808c --- /dev/null +++ b/database/factories/ContactFactory.php @@ -0,0 +1,17 @@ +define(App\Models\Contact::class, function (Faker $faker) { + + return [ + 'company_id' => $faker->word, + 'name' => $faker->word, + 'designation' => $faker->word, + 'email' => $faker->word, + 'phone' => $faker->word, + 'wechat_id' => $faker->word + ]; +}); diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 00000000..56a734d1 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,30 @@ +define(User::class, function (Faker $faker) { + return [ + 'name' => $faker->name, + 'role_id' => Roles::USER, + 'email' => $faker->unique()->safeEmail, + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', + 'remember_token' => Str::random(10), + ]; +}); diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php new file mode 100644 index 00000000..ee5d11ac --- /dev/null +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -0,0 +1,39 @@ +id(); + $table->string('name'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->smallInteger('role_id'); + $table->boolean('active')->default(true); + $table->rememberToken(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +} diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php new file mode 100644 index 00000000..9bddee36 --- /dev/null +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -0,0 +1,35 @@ +id(); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('failed_jobs'); + } +} diff --git a/database/migrations/2020_07_30_022600_create_password_resets_table.php b/database/migrations/2020_07_30_022600_create_password_resets_table.php new file mode 100644 index 00000000..f465e56d --- /dev/null +++ b/database/migrations/2020_07_30_022600_create_password_resets_table.php @@ -0,0 +1,37 @@ +id(); + $table->bigInteger('user_id')->unsigned(); + $table->string('token'); + $table->boolean('is_expired')->default(true); + $table->boolean('is_complete')->default(false); + $table->timestamps(); + + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +} diff --git a/database/migrations/2020_07_30_022724_create_jobs_table.php b/database/migrations/2020_07_30_022724_create_jobs_table.php new file mode 100644 index 00000000..a8e8b3b2 --- /dev/null +++ b/database/migrations/2020_07_30_022724_create_jobs_table.php @@ -0,0 +1,35 @@ +id(); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('jobs'); + } +} diff --git a/database/migrations/2020_07_30_023042_create_activity_log_table.php b/database/migrations/2020_07_30_023042_create_activity_log_table.php new file mode 100644 index 00000000..107cf045 --- /dev/null +++ b/database/migrations/2020_07_30_023042_create_activity_log_table.php @@ -0,0 +1,42 @@ +id(); + $table->string('log_name')->nullable(); + $table->text('description'); + $table->unsignedBigInteger('subject_id')->nullable(); + $table->string('subject_type')->nullable(); + $table->unsignedBigInteger('causer_id')->nullable(); + $table->string('causer_type')->nullable(); + $table->text('properties')->nullable(); + $table->timestamps(); + + $table->index('log_name'); + $table->index(['subject_id', 'subject_type'], 'subject'); + $table->index(['causer_id', 'causer_type'], 'causer'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('activity_log'); + } +} diff --git a/database/migrations/2020_08_04_042142_create_companies_table.php b/database/migrations/2020_08_04_042142_create_companies_table.php new file mode 100644 index 00000000..567482b8 --- /dev/null +++ b/database/migrations/2020_08_04_042142_create_companies_table.php @@ -0,0 +1,37 @@ +id(); + $table->bigInteger('reference_no')->unique(); + $table->string('name'); + $table->integer('type'); + $table->integer('status')->default(0); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('companies'); + } +} diff --git a/database/migrations/2020_08_04_043647_create_addresses_table.php b/database/migrations/2020_08_04_043647_create_addresses_table.php new file mode 100644 index 00000000..5de29ab5 --- /dev/null +++ b/database/migrations/2020_08_04_043647_create_addresses_table.php @@ -0,0 +1,45 @@ +id(); + $table->foreignId('company_id'); + $table->string('street_one'); + $table->string('street_two')->nullable(); + $table->string('city'); + $table->string('state'); + $table->string('post_code'); + $table->string('country'); + $table->integer('default'); + $table->integer('billing'); + + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('company_id')->references('id')->on('companies'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('addresses'); + } +} diff --git a/database/migrations/2020_08_05_223808_create_order_table.php b/database/migrations/2020_08_05_223808_create_order_table.php new file mode 100644 index 00000000..b724079d --- /dev/null +++ b/database/migrations/2020_08_05_223808_create_order_table.php @@ -0,0 +1,43 @@ +id(); + $table->foreignId('company_id'); + $table->string('marking')->unique(); + $table->foreignId('forwarder_id'); + $table->foreignId('address_id'); + $table->string('current_step')->nullable(); + $table->boolean('multiple_batch')->default(0); + $table->boolean('complete')->default(0); + $table->softDeletes(); + $table->timestamps(); + + $table->foreign('company_id')->references('id')->on('companies'); + $table->foreign('forwarder_id')->references('id')->on('companies'); + $table->foreign('address_id')->references('id')->on('addresses'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('order'); + } +} diff --git a/database/migrations/2020_08_05_224625_create_contacts_table.php b/database/migrations/2020_08_05_224625_create_contacts_table.php new file mode 100644 index 00000000..d602e1f6 --- /dev/null +++ b/database/migrations/2020_08_05_224625_create_contacts_table.php @@ -0,0 +1,40 @@ +id(); + $table->foreignId('company_id'); + $table->string('name'); + $table->string('designation')->nullable(); + $table->string('email')->nullable(); + $table->string('phone')->nullable(); + $table->string('wechat_id')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->foreign('company_id')->references('id')->on('companies'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('contacts'); + } +} diff --git a/database/migrations/2020_08_06_035532_create_orders_table.php b/database/migrations/2020_08_06_035532_create_orders_table.php new file mode 100644 index 00000000..52eace3c --- /dev/null +++ b/database/migrations/2020_08_06_035532_create_orders_table.php @@ -0,0 +1,43 @@ +id(); + $table->foreignId('company_id'); + $table->string('marking')->unique(); + $table->foreignId('forwarder_id'); + $table->foreignId('address_id'); + $table->string('current_step')->nullable(); + $table->boolean('multiple_batch')->default(0); + $table->boolean('complete')->default(0); + $table->softDeletes(); + $table->timestamps(); + + $table->foreign('company_id')->references('id')->on('companies'); + $table->foreign('forwarder_id')->references('id')->on('companies'); + $table->foreign('address_id')->references('id')->on('addresses'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('orders'); + } +} diff --git a/database/migrations/2020_08_06_035655_create_order_warehouses_table.php b/database/migrations/2020_08_06_035655_create_order_warehouses_table.php new file mode 100644 index 00000000..e7209c87 --- /dev/null +++ b/database/migrations/2020_08_06_035655_create_order_warehouses_table.php @@ -0,0 +1,36 @@ +id(); + $table->foreignId('order_id'); + $table->foreignId('warehouse_id'); + $table->timestamps(); + + $table->foreign('order_id')->references('id')->on('orders'); + $table->foreign('warehouse_id')->references('id')->on('companies'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('order_warehouses'); + } +} diff --git a/database/seeds/AddressesTableSeeder.php b/database/seeds/AddressesTableSeeder.php new file mode 100644 index 00000000..e704ec95 --- /dev/null +++ b/database/seeds/AddressesTableSeeder.php @@ -0,0 +1,16 @@ +create(); + } +} diff --git a/database/seeds/CompaniesTableSeeder.php b/database/seeds/CompaniesTableSeeder.php new file mode 100644 index 00000000..eacee77f --- /dev/null +++ b/database/seeds/CompaniesTableSeeder.php @@ -0,0 +1,16 @@ +create(); + } +} diff --git a/database/seeds/ContactsTableSeeder.php b/database/seeds/ContactsTableSeeder.php new file mode 100644 index 00000000..12cf6dbb --- /dev/null +++ b/database/seeds/ContactsTableSeeder.php @@ -0,0 +1,16 @@ +create(); + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php new file mode 100644 index 00000000..2a197ad8 --- /dev/null +++ b/database/seeds/DatabaseSeeder.php @@ -0,0 +1,17 @@ +call(UsersTableSeeder::class); + $this->call(CompaniesTableSeeder::class); + } +} diff --git a/database/seeds/UsersTableSeeder.php b/database/seeds/UsersTableSeeder.php new file mode 100644 index 00000000..29cd02e7 --- /dev/null +++ b/database/seeds/UsersTableSeeder.php @@ -0,0 +1,41 @@ +insert([ + [ + 'name' => 'Omair Saleh', + 'email' => 'omair@izyim.com', + 'password' => Hash::make('123456abcabc'), + 'email_verified_at' => \Carbon\Carbon::now(), + 'role_id' => Roles::SUPER_ADMIN, + 'created_at' => \Carbon\Carbon::now(), + 'updated_at' => \Carbon\Carbon::now() + ], + [ + 'name' => 'Development User', + 'email' => env('EMAIL_DEVELOPMENT', 'dev@izyim.com'), + 'password' => Hash::make('123456abcabc'), + 'email_verified_at' => \Carbon\Carbon::now(), + 'role_id' => Roles::ADMIN, + 'created_at' => \Carbon\Carbon::now(), + 'updated_at' => \Carbon\Carbon::now() + ] + ]); + + factory(App\Models\User::class, 30)->create(); + } +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..7f1221bf --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,101 @@ +const pkg = require('./package.json'); +const gulp = require('gulp'); +const del = require('del'); +const plugins = require('gulp-load-plugins')({pattern: ['*'], scope: ['devDependencies']}); +let uglifyEs = require('gulp-uglify-es').default; + +const onError = (error) => { + console.log(error); +}; + +const sassOptions = {style: 'compressed'}; + +// compile vendor dependencies +gulp.task('vendorJs', () => { + plugins.fancyLog('Compiling vendor JS dependencies'); + return gulp.src(pkg.globs.vendorJs) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(plugins.concat('vendor.js')) + .pipe(plugins.uglify()) + .pipe(gulp.dest(pkg.paths.build.js)); +}); + +gulp.task('vendorCss', () => { + plugins.fancyLog('Compiling vendor CSS dependencies'); + return gulp.src(pkg.globs.vendorCss) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(plugins.concatCss('vendor.css')) + .pipe(plugins.cleanCss()) + .pipe(plugins.replace('../../../font-awesome/', './')) + .pipe(plugins.replace('../../jquery-ui-dist/', '')) + .pipe(gulp.dest(pkg.paths.build.css)); +}); + +gulp.task('vendorFonts', () => { + plugins.fancyLog('Copying vendor fonts for dependencies'); + return gulp.src(pkg.globs.vendorFonts) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(gulp.dest(pkg.paths.build.fonts)); +}); + +gulp.task('vendorImages', () => { + plugins.fancyLog('Copying vendor images for dependencies'); + return gulp.src(pkg.globs.vendorImages) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(gulp.dest(pkg.paths.build.images)); +}); + +// compile source scss +gulp.task('sourceCss', () => { + plugins.fancyLog('Compiling source CSS files'); + return gulp.src(pkg.globs.sourceCss) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(plugins.sass(sassOptions).on('error', plugins.sass.logError)) + .pipe(plugins.autoprefixer()) + .pipe(plugins.concatCss('site.css')) + .pipe(gulp.dest(pkg.paths.build.css)); +}); + +gulp.task('sourceJs', () => { + plugins.fancyLog('Compiling source JS dependencies'); + return gulp.src(pkg.globs.sourceJs) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(plugins.concat('site.js')) + .pipe(uglifyEs()) + .pipe(gulp.dest(pkg.paths.build.js)); +}); + +gulp.task('sourceImages', () => { + plugins.fancyLog('Compiling source image files'); + return gulp.src(pkg.globs.sourceImages) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(gulp.dest(pkg.paths.build.images)); +}); +gulp.task('sourceFonts', () => { + plugins.fancyLog('Compiling source font files'); + return gulp.src(pkg.globs.sourceFonts) + .pipe(plugins.plumber({errorHandler: onError})) + .pipe(plugins.print()) + .pipe(gulp.dest(pkg.paths.build.fonts)); +}); +gulp.task('clean', () => { + return del([pkg.paths.build.css + '/*', pkg.paths.build.js + '/*', !pkg.paths.build.js + '/app.js', pkg.paths.build.images + '/*', pkg.paths.build.fonts + '/*']); +}); + +gulp.task('vendor', ['vendorJs', 'vendorCss', 'vendorFonts', 'vendorImages']); +gulp.task('source', ['sourceCss', 'sourceImages', 'sourceJs', 'sourceFonts']); +gulp.task('build', ['clean', 'vendor', 'source']); + +gulp.task('watch', () => { + gulp.watch(pkg.globs.sourceCss, ['sourceCss']); + gulp.watch(pkg.globs.sourceImages, ['sourceImages']); + gulp.watch(pkg.globs.sourceJs, ['sourceJs']); + gulp.watch(pkg.globs.sourceJs, ['sourceFonts']); +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..af09d038 --- /dev/null +++ b/package.json @@ -0,0 +1,120 @@ +{ + "private": true, + "scripts": { + "dev": "npm run development", + "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "watch": "npm run development -- --watch", + "watch-poll": "npm run watch -- --watch-poll", + "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", + "prod": "npm run production", + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" + }, + "dependencies": { + "animate.css": "^3.7.2", + "bootstrap": "^4.0.0", + "bootstrap-datepicker": "^1.7.1", + "chart.js": "^2.8.0", + "epic-spinners": "^1.1.0", + "font-awesome": "^4.7.0", + "intro.js": "^2.9.3", + "jquery": "^3.2", + "jquery-validation": "^1.17.0", + "jquery.scrollbar": "^0.2.11", + "noty": "^3.2.0-beta", + "perfect-scrollbar": "^1.5.0", + "popper.js": "^1.12", + "sass-loader": "7.*", + "select2": "^4.0.6-rc.1", + "vue": "^2.6.10", + "vue-avatar": "^2.1.8", + "vue-template-compiler": "^2.6.10", + "vuelidate": "^0.7.4", + "vuex": "^3.1.1" + }, + "devDependencies": { + "axios": "^0.19", + "cross-env": "^5.1", + "del": "^3.0.0", + "fancy-log": "^1.3.0", + "gulp": "^3.9.1", + "gulp-autoprefixer": "^4.0.0", + "gulp-clean-css": "^3.7.0", + "gulp-concat": "^2.6.1", + "gulp-concat-css": "^2.3.0", + "gulp-copy": "^1.0.1", + "gulp-livereload": "^3.8.1", + "gulp-load-plugins": "^1.5.0", + "gulp-newer": "^1.3.0", + "gulp-plumber": "^1.1.0", + "gulp-print": "^2.0.1", + "gulp-rename": "^1.2.2", + "gulp-replace": "^0.6.1", + "gulp-sass": "^3.1.0", + "gulp-streamify": "^1.0.2", + "gulp-uglify": "^3.0.0", + "gulp-uglify-es": "^1.0.4", + "laravel-mix": "^4.0.7", + "lodash": "^4.17.13", + "resolve-url-loader": "^2.3.1" + }, + "paths": { + "build": { + "css": "./public/css/", + "js": "./public/js/", + "images": "./public/images/", + "fonts": "./public/fonts/", + "main": "./public/" + } + }, + "globs": { + "vendorJs": [ + "./node_modules/jquery/dist/jquery.min.js", + "./node_modules/popper.js/dist/umd/popper.min.js", + "./node_modules/bootstrap/dist/js/bootstrap.min.js", + "./node_modules/jquery.scrollbar/jquery.scrollbar.min.js", + "./node_modules/jquery-validation/dist/jquery.validate.js", + "./node_modules/select2/dist/js/select2.full.min.js", + "./node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js", + "./node_modules/chart.js/dist/Chart.js", + "./node_modules/noty/lib/noty.js", + "./node_modules/intro.js/intro.js", + "./node_modules/vue/dist/vue.min.js" + ], + "vendorCss": [ + "./node_modules/font-awesome/css/font-awesome.min.css", + "./node_modules/jquery.scrollbar/jquery.scrollbar.css", + "./node_modules/select2/dist/css/select2.min.css", + "./node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css", + "./node_modules/noty/lib/noty.css", + "./node_modules/noty/lib/themes/*.css", + "./node_modules/animate.css/animate.css", + "./node_modules/chart.js/dist/Chart.css", + "./node_modules/intro.js/introjs.css", + "./node_modules/bootstrap/dist/css/bootstrap.min.css" + ], + "vendorFonts": [ + "./node_modules/font-awesome/fonts/**/*" + ], + "vendorImages": [ + "./node_modules/jquery-ui-dist/images/**/*.png", + "./node_modules/datatables.net-dt/images/**/*.png" + ], + "sourceCss": [ + "./resources/assets/sass/**/*.scss", + "./resources/assets/css/**/*.css" + ], + "sourceImages": [ + "./resources/assets/images/**/*" + ], + "sourceJs": [ + "./resources/assets/js/pages*.js", + "./resources/assets/js/three.r92.min.js", + "./resources/assets/js/vanta.birds.min.js", + "./resources/assets/js/validation.js", + "./resources/assets/js/scripts.js" + ], + "sourceFonts": [ + "./resources/assets/fonts/**/*" + ] + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..964ff0c5 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,31 @@ + + + + + ./tests/Unit + + + ./tests/Feature + + + + + ./app + + + + + + + + + + + + + + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 00000000..3aec5e27 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..e69de29b diff --git a/public/index.php b/public/index.php new file mode 100644 index 00000000..4584cbcd --- /dev/null +++ b/public/index.php @@ -0,0 +1,60 @@ + + */ + +define('LARAVEL_START', microtime(true)); + +/* +|-------------------------------------------------------------------------- +| Register The Auto Loader +|-------------------------------------------------------------------------- +| +| Composer provides a convenient, automatically generated class loader for +| our application. We just need to utilize it! We'll simply require it +| into the script here so that we don't have to worry about manual +| loading any of our classes later on. It feels great to relax. +| +*/ + +require __DIR__.'/../vendor/autoload.php'; + +/* +|-------------------------------------------------------------------------- +| Turn On The Lights +|-------------------------------------------------------------------------- +| +| We need to illuminate PHP development, so let us turn on the lights. +| This bootstraps the framework and gets it ready for use, then it +| will load up this application so that we can run it and send +| the responses back to the browser and delight our users. +| +*/ + +$app = require_once __DIR__.'/../bootstrap/app.php'; + +/* +|-------------------------------------------------------------------------- +| Run The Application +|-------------------------------------------------------------------------- +| +| Once we have the application, we can handle the incoming request +| through the kernel, and send the associated response back to +| the client's browser allowing them to enjoy the creative +| and wonderful application we have prepared for them. +| +*/ + +$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); + +$response = $kernel->handle( + $request = Illuminate\Http\Request::capture() +); + +$response->send(); + +$kernel->terminate($request, $response); diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 00000000..eb053628 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/public/web.config b/public/web.config new file mode 100644 index 00000000..d3711d7c --- /dev/null +++ b/public/web.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/assets/fonts/montserrat/Montserrat-Bold.ttf b/resources/assets/fonts/montserrat/Montserrat-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b4c25f449814d8fb5b64d211ed2f20a03462c9a5 GIT binary patch literal 54864 zcmd442Vhi19zQW^kqwMJ(010p1^O*+yxiSdG_?=PXLOKvCXIE z&7M9haE~F84efFa13uoW@pZDkC`}d5Q$1GXAY8?_QEI5q2F&FD4^@??e(+zi#zf7l1x{ag6}Ff;io}-lTSvo zOjg49g6Yc_F^jmv0s-+PpFjJ2x+dGvQ;PV%g>mN*(Xy32$v);LzJy=EAL2WeUdpY? zBg%_vxq7SmykM(0)s;%92 zC0}B@*>;!h5!;itH*BBVefBN(kL`OL2FLl18yvSfUUhuvOmxn0E^$8Qe98GA%px}M z1Ix$neu2Gg06w*W1FSCaBU{Vj*zUmhESALterEQ-jm!~vfu-PXe&91!hHK4%qik*9 z1NLO#ID3_u*&EEk4&i<(iwhiM&cIJ-y@#dYcShhK%fz)xeD51L!Wskn@bpgBg8z?Z zv)TB-A=U~w+HkEMJ#^suM6{WN5he!?vratw7*^v6!1QEbKSqnkXtS{z@wgKUi2enL z_6vww11H#2v|Ahah;3yVcqR(Z9K|!Gc%~2A4IW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g(~JR#7)7J353Bc#QHb*- z_T4Chp;NMm4wJ%k*g}hO!5!dG=f8xN8?GaX!r=>dVsuaCx(`dNW69z`6NZlm+QtkW vm1C*wI~{f%R$a>vcrk`TAfNF%Wue$GDJtU$5x7w`-iAJ-63O6C@XucW@XUC} literal 0 HcmV?d00001 diff --git a/resources/assets/fonts/montserrat/Montserrat-Regular.ttf b/resources/assets/fonts/montserrat/Montserrat-Regular.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7648363a038d248cec56001e848e7af2cbecc1c3 GIT binary patch literal 54988 zcmdSCcYIV;`agcoz0)UUY9^%5Od6yBsiY8w03i^N7D56fBnSvdiGUFsHgvJ9SXkS- zEAG0wySj?5h`sl9byckEB5MH@1f+=wGvD`f?!D6zbU&}x@1GwbW$r!qobx>AIZr#! z^IXOmV@~|gv0-CpOc;+(`0(M&_-$%xYMp%MzL8^bsUDv*#*ZD>#4DHqpWE>{XZ+MD zGX_syJsF?ZqLWw0&zRY`?8Y@48FL5d{*)O*%l`CCC;oPK<8$|!%X@lXd;8gM@%eei zuxCMNYx$FmJ#i=QS1rZ`<7+xR^Tc+1&Rx8G&DvRWs~*Sa;{Y&i*~&9} z4nLYPg0W{^j7hfTJ!^ZVTI(l_J)evAIV*aWFWh%v;~;zn%*L~OSFT<&;@aXL8GCID z+P~DhYGLoSTkG-nhr`hRMtl?Y*jvjVo=LyoJW%kc_`GpJt+y3RTn`yS`EAwpgot9clujOrPf_15Ni}lTfV(XTK>l1EEcr#&7;>5(46W>hANSdFt zA?d~Bgyb`lFG_yZ#%w-5-&SmEvQ4thx2>^VV0+%4W*=s6uurwWYTs$!Wk2r7a?EwC zaBOkB==coqB!s?X`JkYh(6_7(-}RvbtRb|UZD5IP5AIo+HS`^GhAwBW&^9&*EwV#D zu>8<_Y$#f`hK{lgp|{v0p@ZyD=n!+W#LzM3#uL;sJ+zNy;!YN>Rp9dov~I$^me3J4 zh0SF%Lf@l@uUR{K>IfZXvqO8?9Q>Y(>)m+f5j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YKQZY~I6*A7D1%>yCq=7SJ+3qT0FYe5LRg&>4oe2O(FIWKmg{7HVzi%Rfw zr3K*XMJ!Y$4!yWUFGh25KvG*FQp>g%d!WwFebxVn0eNxi&iOhJ>AIs>7indR%dW*- zS^BEfp;aq7%YY-AZ*H#W1(qd?!zulu>ZY3-?R7JyA`K-eN4Y`hvQhky+CZICuW-0B z8k~CN$Du;P27q3Ls-X0I&84++%LEHIPfxenThSBrqt8a4hvr%-L|Q8HuSOS=4(Z2# zg`%(UmIS9=c1>%TMp`usuQivEhHgfhz|wR-H)eNt{{^X;wCoGAz?9|la0h2aSBd

mK*R{6<>ay*~p#|lF zqjEud%VYvVxFh{55fgHG};{G`xoSVASS9@P_$dg&m2y z1gFuVSC>TIEJ<{uL$4{Bh77T=Orts8lrgHsrI#Row_+CyV1&CYTz0ey7aEB{<0f<# z=%D8%HB#P>7sb})1mpLSKIR+uD-HI#Y}=yxw)w&|dYBmzrh2*jHs(B&7%sOM z8^BJ+VW6LJ81OL;1G^Z<3t%_nFtCSl7}(1=4D4f^jR07})R7Yv z+@aUcqfW3#p-w7@QEyWaqlO$8a2GT(GxC(^)}U_6>pI3mjgv6Rez6A=5OE5fvN5fm zoS`Vs1Ep@% z8Pj0XOac3zv|^3e>^?bwITQjhOZHu|5e)Fg6+a>7KBJpIk1?Z34NjQJ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/assets/fonts/montserrat/montserrat-regular-webfont.svg b/resources/assets/fonts/montserrat/montserrat-regular-webfont.svg new file mode 100644 index 00000000..66cffa36 --- /dev/null +++ b/resources/assets/fonts/montserrat/montserrat-regular-webfont.svg @@ -0,0 +1,1317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/assets/images/accounts-graphic.png b/resources/assets/images/accounts-graphic.png new file mode 100644 index 0000000000000000000000000000000000000000..d7fc0bed3858ee79c2ed6b59b942621ab081bd25 GIT binary patch literal 72579 zcmZs?XH=70)GZurpr~|FP(xij*-UWhm5}G2t1nD(F z1p=W80YV7nd*Gb+yLY_fI>s3~&X1kF*IsL`IpGG0 z`9G9pg288{BWSO=xjRs2&vt2h_kb*i_9x$NkbqcLL2;C5rYy$>AJ?tQnN~aN!Pe;2 z(}T|lDnm+8Zm9>_Zo9#b;4+Z`fwYxL*t=jDLQK!23@%O>o?bi26t#M zqOn7!`^IHZ2pb0R3V}k;2AuYP1+V$vzI^^8l$Qm!>wF?RJ@4Q$b;ZDIg=UvPv|N~I zSgH@*A?3+I!*Jx$mGbMLce$74_By4E{A>laue?Y=yW3?YDuO^k9{J^--@+4x9Lh|2~!LJcMo?4j<(+$%!_2m~1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