From ee54c46065b400b3d2929d8262f4d988ec918768 Mon Sep 17 00:00:00 2001 From: MuchQuak Date: Tue, 10 Dec 2024 12:54:40 -0800 Subject: [PATCH] add pint with formating fixes --- .github/workflows/lint.yml | 33 + app/Actions/Fortify/CreateNewUser.php | 6 +- .../Fortify/PasswordValidationRules.php | 6 +- app/Actions/Fortify/ResetUserPassword.php | 6 +- app/Actions/Fortify/UpdateUserPassword.php | 6 +- .../Fortify/UpdateUserProfileInformation.php | 9 +- app/Console/Commands/Log/ClearLogFile.php | 6 +- app/Console/Kernel.php | 11 +- app/Exceptions/Handler.php | 6 +- app/Faker/TaxonomyProvider.php | 34 +- app/Http/Controllers/CollectionController.php | 285 +-- app/Http/Controllers/Controller.php | 5 +- app/Http/Controllers/DuplicateController.php | 91 +- .../Controllers/InstallationController.php | 764 ++++---- app/Http/Controllers/InventoryController.php | 337 ++-- .../InventoryPackageController.php | 79 +- app/Http/Controllers/LoginController.php | 21 +- app/Http/Controllers/MarkdownController.php | 15 +- app/Http/Controllers/MediaController.php | 680 ++++---- app/Http/Controllers/MorphologyController.php | 87 +- .../OccurrenceAnnotationController.php | 461 ++--- app/Http/Controllers/OccurrenceController.php | 1530 +++++++++-------- .../Controllers/RegistrationController.php | 25 +- app/Http/Controllers/TaxonomyController.php | 552 +++--- .../TaxonomyDescriptionController.php | 222 +-- app/Http/Kernel.php | 7 +- app/Http/Middleware/Authenticate.php | 6 +- app/Http/Middleware/EncryptCookies.php | 3 +- .../PreventRequestsDuringMaintenance.php | 3 +- .../Middleware/RedirectIfAuthenticated.php | 6 +- app/Http/Middleware/SetLanguage.php | 7 +- app/Http/Middleware/TrimStrings.php | 3 +- app/Http/Middleware/TrustHosts.php | 6 +- app/Http/Middleware/TrustProxies.php | 3 +- app/Http/Middleware/ValidateSignature.php | 3 +- app/Http/Middleware/VerifyCsrfToken.php | 3 +- app/Models/Collection.php | 29 +- app/Models/Institution.php | 13 +- app/Models/Inventory.php | 22 +- app/Models/Media.php | 127 +- app/Models/MorphologyCharacter.php | 19 +- app/Models/Occurrence.php | 145 +- app/Models/OccurrenceAnnotationExternal.php | 26 +- app/Models/OccurrenceAnnotationInternal.php | 25 +- app/Models/OccurrenceIdentification.php | 22 +- app/Models/PortalIndex.php | 34 +- app/Models/PortalOccurrence.php | 27 +- app/Models/PortalPublication.php | 18 +- app/Models/Taxonomy.php | 37 +- app/Models/TaxonomyDescription.php | 18 +- app/Models/TaxonomyDescriptionStatement.php | 12 +- app/Models/User.php | 9 +- app/Models/UserAccessToken.php | 22 +- app/Models/UserRole.php | 22 +- app/Providers/AppServiceProvider.php | 20 +- app/Providers/AuthServiceProvider.php | 6 +- app/Providers/BroadcastServiceProvider.php | 6 +- app/Providers/EventServiceProvider.php | 9 +- app/Providers/FakerServiceProvider.php | 4 +- app/Providers/FortifyServiceProvider.php | 28 +- app/Providers/RouteServiceProvider.php | 3 +- app/Socialite/Orcid/Provider.php | 12 +- composer.json | 2 +- composer.lock | 22 +- config/app.php | 1 - config/broadcasting.php | 2 +- config/cache.php | 2 +- config/database.php | 2 +- config/filesystems.php | 2 +- config/logging.php | 2 +- config/session.php | 2 +- database/factories/CollectionFactory.php | 1 + database/factories/InstitutionFactory.php | 2 +- database/factories/OccurrenceFactory.php | 3 +- database/factories/UserFactory.php | 3 +- ...9_24_194122_create_actionrequest_table.php | 9 +- ..._194122_create_actionrequesttype_table.php | 9 +- ..._09_24_194122_create_adminconfig_table.php | 9 +- ..._24_194122_create_adminlanguages_table.php | 9 +- ...4_09_24_194122_create_adminstats_table.php | 9 +- ...22_create_agentdeterminationlink_table.php | 9 +- ...4_09_24_194122_create_agentlinks_table.php | 9 +- ...4_09_24_194122_create_agentnames_table.php | 9 +- ...194122_create_agentnumberpattern_table.php | 9 +- ...94122_create_agentoccurrencelink_table.php | 9 +- ..._24_194122_create_agentrelations_table.php | 9 +- .../2024_09_24_194122_create_agents_table.php | 9 +- ..._24_194122_create_agentsfulltext_table.php | 9 +- ...4_09_24_194122_create_agentteams_table.php | 9 +- ...09_24_194122_create_chotomouskey_table.php | 9 +- ...4_09_24_194122_create_configpage_table.php | 9 +- ...4122_create_configpageattributes_table.php | 9 +- ..._24_194122_create_ctcontrolvocab_table.php | 9 +- ...194122_create_ctcontrolvocabterm_table.php | 9 +- ..._09_24_194122_create_ctnametypes_table.php | 9 +- ...94122_create_ctrelationshiptypes_table.php | 9 +- ..._09_24_194122_create_failed_jobs_table.php | 9 +- ...09_24_194122_create_fmchecklists_table.php | 9 +- ...4_194122_create_fmchklstchildren_table.php | 9 +- ...94122_create_fmchklstcoordinates_table.php | 9 +- ...4_194122_create_fmchklstprojlink_table.php | 9 +- ...4_194122_create_fmchklsttaxalink_table.php | 9 +- ...94122_create_fmdynamicchecklists_table.php | 9 +- ...24_194122_create_fmdyncltaxalink_table.php | 9 +- ...94122_create_fmprojectcategories_table.php | 9 +- ...4_09_24_194122_create_fmprojects_table.php | 9 +- ...4_09_24_194122_create_fmvouchers_table.php | 9 +- ..._194122_create_geographicpolygon_table.php | 9 +- ...94122_create_geographicthesaurus_table.php | 9 +- ...024_09_24_194122_create_glossary_table.php | 9 +- ...4_194122_create_glossarycategory_table.php | 9 +- ...4122_create_glossarycategorylink_table.php | 9 +- ..._24_194122_create_glossaryimages_table.php | 9 +- ...24_194122_create_glossarysources_table.php | 9 +- ...4_194122_create_glossarytaxalink_table.php | 9 +- ...4_194122_create_glossarytermlink_table.php | 9 +- ...4_09_24_194122_create_guidimages_table.php | 9 +- ...2_create_guidoccurdeterminations_table.php | 9 +- ...24_194122_create_guidoccurrences_table.php | 9 +- ...4_194122_create_igsnverification_table.php | 9 +- ...4_194122_create_imageannotations_table.php | 9 +- ...9_24_194122_create_imagekeywords_table.php | 9 +- ...4_194122_create_imageprojectlink_table.php | 9 +- ...9_24_194122_create_imageprojects_table.php | 9 +- .../2024_09_24_194122_create_images_table.php | 9 +- ...024_09_24_194122_create_imagetag_table.php | 9 +- ...9_24_194122_create_imagetaggroup_table.php | 9 +- ..._09_24_194122_create_imagetagkey_table.php | 9 +- ...09_24_194122_create_institutions_table.php | 9 +- ...24_194122_create_kmcharacterlang_table.php | 9 +- ...09_24_194122_create_kmcharacters_table.php | 9 +- ...4_194122_create_kmchardependance_table.php | 9 +- ...9_24_194122_create_kmcharheading_table.php | 9 +- ..._194122_create_kmcharheadinglang_table.php | 9 +- ..._24_194122_create_kmchartaxalink_table.php | 9 +- .../2024_09_24_194122_create_kmcs_table.php | 9 +- ...4_09_24_194122_create_kmcsimages_table.php | 9 +- ...024_09_24_194122_create_kmcslang_table.php | 9 +- ...2024_09_24_194122_create_kmdescr_table.php | 9 +- ...4_194122_create_kmdescrdeletions_table.php | 9 +- ..._09_24_194122_create_lkupcountry_table.php | 9 +- ...4_09_24_194122_create_lkupcounty_table.php | 9 +- ...4_194122_create_lkupmunicipality_table.php | 9 +- ..._194122_create_lkupstateprovince_table.php | 9 +- .../2024_09_24_194122_create_media_table.php | 9 +- ...4_194122_create_omcollcategories_table.php | 9 +- ...9_24_194122_create_omcollcatlink_table.php | 9 +- ...9_24_194122_create_omcollections_table.php | 9 +- ..._194122_create_omcollectionstats_table.php | 9 +- ...4_194122_create_omcollproperties_table.php | 9 +- ...194122_create_omcollpublications_table.php | 9 +- ...194122_create_omcollpuboccurlink_table.php | 9 +- ...24_194122_create_omcollsecondary_table.php | 9 +- ...4122_create_omcrowdsourcecentral_table.php | 9 +- ...4122_create_omcrowdsourceproject_table.php | 9 +- ...194122_create_omcrowdsourcequeue_table.php | 9 +- ...194122_create_omexsiccatinumbers_table.php | 9 +- ...194122_create_omexsiccatiocclink_table.php | 9 +- ..._194122_create_omexsiccatititles_table.php | 9 +- ...4_194122_create_ommaterialsample_table.php | 9 +- ...9_24_194122_create_omoccuraccess_table.php | 9 +- ..._194122_create_omoccuraccesslink_table.php | 9 +- ...4122_create_omoccuraccesssummary_table.php | 9 +- ..._create_omoccuraccesssummarylink_table.php | 9 +- ..._24_194122_create_omoccurarchive_table.php | 9 +- ...94122_create_omoccurassociations_table.php | 9 +- ...24_194122_create_omoccurcomments_table.php | 9 +- ...194122_create_omoccurdatasetlink_table.php | 9 +- ...24_194122_create_omoccurdatasets_table.php | 9 +- ...122_create_omoccurdeterminations_table.php | 9 +- ...4122_create_omoccurduplicatelink_table.php | 9 +- ..._194122_create_omoccurduplicates_table.php | 9 +- ...4_194122_create_omoccureditlocks_table.php | 9 +- ...09_24_194122_create_omoccuredits_table.php | 9 +- ...24_194122_create_omoccurexchange_table.php | 9 +- ..._24_194122_create_omoccurgenetic_table.php | 9 +- ...24_194122_create_omoccurgeoindex_table.php | 9 +- ...194122_create_omoccuridentifiers_table.php | 9 +- ...09_24_194122_create_omoccurloans_table.php | 9 +- ...22_create_omoccurloansattachment_table.php | 9 +- ...4_194122_create_omoccurloanslink_table.php | 9 +- ...24_194122_create_omoccurloanuser_table.php | 9 +- ...09_24_194122_create_omoccurpaleo_table.php | 9 +- ...24_194122_create_omoccurpaleogts_table.php | 9 +- ...9_24_194122_create_omoccurpoints_table.php | 9 +- ...9_24_194122_create_omoccurrences_table.php | 9 +- ...122_create_omoccurrencesfulltext_table.php | 9 +- ..._194122_create_omoccurrencetypes_table.php | 9 +- ...24_194122_create_omoccurresource_table.php | 9 +- ...4_194122_create_omoccurrevisions_table.php | 9 +- ...94122_create_omoccurverification_table.php | 9 +- ...122_create_password_reset_tokens_table.php | 9 +- ...22_create_personal_access_tokens_table.php | 9 +- ..._09_24_194122_create_portalindex_table.php | 9 +- ..._194122_create_portaloccurrences_table.php | 9 +- ...194122_create_portalpublications_table.php | 9 +- ...94122_create_referenceagentlinks_table.php | 9 +- ...94122_create_referenceauthorlink_table.php | 9 +- ...4_194122_create_referenceauthors_table.php | 9 +- ...22_create_referencechecklistlink_table.php | 9 +- ...2_create_referencechklsttaxalink_table.php | 9 +- ...2_create_referencecollectionlink_table.php | 9 +- ...4122_create_referencedatasetlink_table.php | 9 +- ...24_194122_create_referenceobject_table.php | 9 +- ...194122_create_referenceoccurlink_table.php | 9 +- ..._194122_create_referencetaxalink_table.php | 9 +- ...9_24_194122_create_referencetype_table.php | 9 +- ..._24_194122_create_salixwordstats_table.php | 9 +- ...9_24_194122_create_schemaversion_table.php | 9 +- ...122_create_specprocessorprojects_table.php | 9 +- ...22_create_specprocessorrawlabels_table.php | 9 +- ...e_specprocessorrawlabelsfulltext_table.php | 9 +- ..._09_24_194122_create_specprocnlp_table.php | 9 +- ...24_194122_create_specprocnlpfrag_table.php | 9 +- ...194122_create_specprocnlpversion_table.php | 9 +- ...24_194122_create_specprococrfrag_table.php | 9 +- ..._24_194122_create_specprocstatus_table.php | 9 +- .../2024_09_24_194122_create_taxa_table.php | 9 +- ..._24_194122_create_taxadescrblock_table.php | 9 +- ...4_194122_create_taxadescrprofile_table.php | 9 +- ..._24_194122_create_taxadescrstmts_table.php | 9 +- ...09_24_194122_create_taxaenumtree_table.php | 9 +- ...24_09_24_194122_create_taxalinks_table.php | 9 +- ...024_09_24_194122_create_taxamaps_table.php | 9 +- ..._24_194122_create_taxanestedtree_table.php | 9 +- ...22_create_taxaprofilepubdesclink_table.php | 9 +- ...2_create_taxaprofilepubimagelink_table.php | 9 +- ...122_create_taxaprofilepubmaplink_table.php | 9 +- ...24_194122_create_taxaprofilepubs_table.php | 9 +- ..._194122_create_taxaresourcelinks_table.php | 9 +- ...09_24_194122_create_taxauthority_table.php | 9 +- ...24_194122_create_taxavernaculars_table.php | 9 +- ...4_09_24_194122_create_taxonunits_table.php | 9 +- ...24_09_24_194122_create_taxstatus_table.php | 9 +- ...09_24_194122_create_tmattributes_table.php | 9 +- ...024_09_24_194122_create_tmstates_table.php | 9 +- ...94122_create_tmtraitdependencies_table.php | 9 +- ...024_09_24_194122_create_tmtraits_table.php | 9 +- ...24_194122_create_tmtraittaxalink_table.php | 9 +- ...24_194122_create_unknowncomments_table.php | 9 +- ...9_24_194122_create_unknownimages_table.php | 9 +- ...024_09_24_194122_create_unknowns_table.php | 9 +- ...4_194122_create_uploaddetermtemp_table.php | 9 +- ..._24_194122_create_uploadglossary_table.php | 9 +- ...24_194122_create_uploadimagetemp_table.php | 9 +- ...9_24_194122_create_uploadspecmap_table.php | 9 +- ...4122_create_uploadspecparameters_table.php | 9 +- ..._24_194122_create_uploadspectemp_table.php | 9 +- ...4_09_24_194122_create_uploadtaxa_table.php | 9 +- ...4_194122_create_useraccesstokens_table.php | 9 +- ...24_09_24_194122_create_userlogin_table.php | 9 +- ...24_09_24_194122_create_userroles_table.php | 9 +- .../2024_09_24_194122_create_users_table.php | 9 +- ...ate_users_table_add_two_factor_columns.php | 9 +- ...09_24_194122_create_usertaxonomy_table.php | 9 +- ...24_create_insertGeographicPolygon_proc.php | 15 +- ...24_create_updateGeographicPolygon_proc.php | 15 +- ...dd_foreign_keys_to_actionrequest_table.php | 9 +- ..._add_foreign_keys_to_adminconfig_table.php | 9 +- ...5_add_foreign_keys_to_adminstats_table.php | 9 +- ...n_keys_to_agentdeterminationlink_table.php | 9 +- ...5_add_foreign_keys_to_agentlinks_table.php | 9 +- ...5_add_foreign_keys_to_agentnames_table.php | 9 +- ...reign_keys_to_agentnumberpattern_table.php | 9 +- ...eign_keys_to_agentoccurrencelink_table.php | 9 +- ...d_foreign_keys_to_agentrelations_table.php | 9 +- ...94125_add_foreign_keys_to_agents_table.php | 9 +- ...5_add_foreign_keys_to_agentteams_table.php | 9 +- ...add_foreign_keys_to_chotomouskey_table.php | 9 +- ...ign_keys_to_configpageattributes_table.php | 9 +- ...d_foreign_keys_to_ctcontrolvocab_table.php | 9 +- ...reign_keys_to_ctcontrolvocabterm_table.php | 9 +- ...add_foreign_keys_to_fmchecklists_table.php | 9 +- ...foreign_keys_to_fmchklstchildren_table.php | 9 +- ...eign_keys_to_fmchklstcoordinates_table.php | 9 +- ...foreign_keys_to_fmchklstprojlink_table.php | 9 +- ...foreign_keys_to_fmchklsttaxalink_table.php | 9 +- ..._foreign_keys_to_fmdyncltaxalink_table.php | 9 +- ...eign_keys_to_fmprojectcategories_table.php | 9 +- ...5_add_foreign_keys_to_fmprojects_table.php | 9 +- ...5_add_foreign_keys_to_fmvouchers_table.php | 9 +- ...eign_keys_to_geographicthesaurus_table.php | 9 +- ...125_add_foreign_keys_to_glossary_table.php | 9 +- ...foreign_keys_to_glossarycategory_table.php | 9 +- ...ign_keys_to_glossarycategorylink_table.php | 9 +- ...d_foreign_keys_to_glossaryimages_table.php | 9 +- ...foreign_keys_to_glossarytaxalink_table.php | 9 +- ...foreign_keys_to_glossarytermlink_table.php | 9 +- ...foreign_keys_to_igsnverification_table.php | 9 +- ...foreign_keys_to_imageannotations_table.php | 9 +- ...dd_foreign_keys_to_imagekeywords_table.php | 9 +- ...foreign_keys_to_imageprojectlink_table.php | 9 +- ...dd_foreign_keys_to_imageprojects_table.php | 9 +- ...94125_add_foreign_keys_to_images_table.php | 9 +- ...125_add_foreign_keys_to_imagetag_table.php | 9 +- ..._add_foreign_keys_to_imagetagkey_table.php | 9 +- ...add_foreign_keys_to_institutions_table.php | 9 +- ..._foreign_keys_to_kmcharacterlang_table.php | 9 +- ...add_foreign_keys_to_kmcharacters_table.php | 9 +- ...foreign_keys_to_kmchardependance_table.php | 9 +- ...dd_foreign_keys_to_kmcharheading_table.php | 9 +- ...oreign_keys_to_kmcharheadinglang_table.php | 9 +- ...d_foreign_keys_to_kmchartaxalink_table.php | 9 +- ..._194125_add_foreign_keys_to_kmcs_table.php | 9 +- ...5_add_foreign_keys_to_kmcsimages_table.php | 9 +- ...125_add_foreign_keys_to_kmcslang_table.php | 9 +- ...4125_add_foreign_keys_to_kmdescr_table.php | 9 +- ...5_add_foreign_keys_to_lkupcounty_table.php | 9 +- ...foreign_keys_to_lkupmunicipality_table.php | 9 +- ...oreign_keys_to_lkupstateprovince_table.php | 9 +- ...194125_add_foreign_keys_to_media_table.php | 9 +- ...dd_foreign_keys_to_omcollcatlink_table.php | 9 +- ...dd_foreign_keys_to_omcollections_table.php | 9 +- ...oreign_keys_to_omcollectionstats_table.php | 9 +- ...foreign_keys_to_omcollproperties_table.php | 9 +- ...reign_keys_to_omcollpublications_table.php | 9 +- ...reign_keys_to_omcollpuboccurlink_table.php | 9 +- ..._foreign_keys_to_omcollsecondary_table.php | 9 +- ...ign_keys_to_omcrowdsourcecentral_table.php | 9 +- ...ign_keys_to_omcrowdsourceproject_table.php | 9 +- ...reign_keys_to_omcrowdsourcequeue_table.php | 9 +- ...reign_keys_to_omexsiccatinumbers_table.php | 9 +- ...reign_keys_to_omexsiccatiocclink_table.php | 9 +- ...foreign_keys_to_ommaterialsample_table.php | 9 +- ...keys_to_omoccuraccesssummarylink_table.php | 9 +- ...d_foreign_keys_to_omoccurarchive_table.php | 9 +- ...eign_keys_to_omoccurassociations_table.php | 9 +- ..._foreign_keys_to_omoccurcomments_table.php | 9 +- ...reign_keys_to_omoccurdatasetlink_table.php | 9 +- ..._foreign_keys_to_omoccurdatasets_table.php | 9 +- ...gn_keys_to_omoccurdeterminations_table.php | 9 +- ...ign_keys_to_omoccurduplicatelink_table.php | 9 +- ...add_foreign_keys_to_omoccuredits_table.php | 9 +- ..._foreign_keys_to_omoccurexchange_table.php | 9 +- ...d_foreign_keys_to_omoccurgenetic_table.php | 9 +- ..._foreign_keys_to_omoccurgeoindex_table.php | 9 +- ...reign_keys_to_omoccuridentifiers_table.php | 9 +- ...add_foreign_keys_to_omoccurloans_table.php | 9 +- ...n_keys_to_omoccurloansattachment_table.php | 9 +- ...foreign_keys_to_omoccurloanslink_table.php | 9 +- ..._foreign_keys_to_omoccurloanuser_table.php | 9 +- ...add_foreign_keys_to_omoccurpaleo_table.php | 9 +- ..._foreign_keys_to_omoccurpaleogts_table.php | 9 +- ...dd_foreign_keys_to_omoccurrences_table.php | 9 +- ..._foreign_keys_to_omoccurresource_table.php | 9 +- ...eign_keys_to_omoccurverification_table.php | 9 +- ...oreign_keys_to_portaloccurrences_table.php | 9 +- ...reign_keys_to_portalpublications_table.php | 9 +- ...eign_keys_to_referenceauthorlink_table.php | 9 +- ...n_keys_to_referencechecklistlink_table.php | 9 +- ..._keys_to_referencechklsttaxalink_table.php | 9 +- ..._keys_to_referencecollectionlink_table.php | 9 +- ...ign_keys_to_referencedatasetlink_table.php | 9 +- ..._foreign_keys_to_referenceobject_table.php | 9 +- ...reign_keys_to_referenceoccurlink_table.php | 9 +- ...oreign_keys_to_referencetaxalink_table.php | 9 +- ...gn_keys_to_specprocessorprojects_table.php | 9 +- ...n_keys_to_specprocessorrawlabels_table.php | 9 +- ..._add_foreign_keys_to_specprocnlp_table.php | 9 +- ..._foreign_keys_to_specprocnlpfrag_table.php | 9 +- ...reign_keys_to_specprocnlpversion_table.php | 9 +- ..._foreign_keys_to_specprococrfrag_table.php | 9 +- ...d_foreign_keys_to_specprocstatus_table.php | 9 +- ..._194125_add_foreign_keys_to_taxa_table.php | 9 +- ...d_foreign_keys_to_taxadescrblock_table.php | 9 +- ...foreign_keys_to_taxadescrprofile_table.php | 9 +- ...d_foreign_keys_to_taxadescrstmts_table.php | 9 +- ...add_foreign_keys_to_taxaenumtree_table.php | 9 +- ...25_add_foreign_keys_to_taxalinks_table.php | 9 +- ...125_add_foreign_keys_to_taxamaps_table.php | 9 +- ...d_foreign_keys_to_taxanestedtree_table.php | 9 +- ...n_keys_to_taxaprofilepubdesclink_table.php | 9 +- ..._keys_to_taxaprofilepubimagelink_table.php | 9 +- ...gn_keys_to_taxaprofilepubmaplink_table.php | 9 +- ..._foreign_keys_to_taxaprofilepubs_table.php | 9 +- ...oreign_keys_to_taxaresourcelinks_table.php | 9 +- ..._foreign_keys_to_taxavernaculars_table.php | 9 +- ...25_add_foreign_keys_to_taxstatus_table.php | 9 +- ..._foreign_keys_to_unknowncomments_table.php | 9 +- ...dd_foreign_keys_to_unknownimages_table.php | 9 +- ...125_add_foreign_keys_to_unknowns_table.php | 9 +- ...dd_foreign_keys_to_uploadspecmap_table.php | 9 +- ...ign_keys_to_uploadspecparameters_table.php | 9 +- ...d_foreign_keys_to_uploadspectemp_table.php | 9 +- ...25_add_foreign_keys_to_userlogin_table.php | 9 +- ...25_add_foreign_keys_to_userroles_table.php | 9 +- ...add_foreign_keys_to_usertaxonomy_table.php | 9 +- ...024_12_04_205155_add_user_oauth_tokens.php | 2 +- database/seeders/ChecklistSeeder.php | 7 +- database/seeders/CollectionSeeder.php | 7 +- database/seeders/OccurrenceSeeder.php | 1 - database/seeders/SampleSeeder.php | 1 - database/seeders/TaxonomySeeder.php | 12 +- database/seeders/UserSeeder.php | 1 - lang/en/header.php | 64 +- lang/en/home.php | 5 +- lang/es/header.php | 67 +- lang/es/home.php | 5 +- lang/fr/home.php | 5 +- pint.json | 22 + public/index.php | 69 +- routes/api.php | 28 +- routes/web.php | 101 +- tests/CreatesApplication.php | 8 +- tests/Feature/ExampleTest.php | 6 +- tests/TestCase.php | 3 +- tests/Unit/ExampleTest.php | 6 +- 407 files changed, 4407 insertions(+), 4921 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 pint.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..367de12 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Fix Code Style + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [8.3] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, dom, curl, libxml, mbstring + coverage: none + + - name: Install Pint + run: composer global require laravel/pint + + - name: Run Pint + run: pint + + - name: Commit linted files + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Fixes coding style" diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 7bf18d0..1bb20ac 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -8,8 +8,7 @@ use Illuminate\Validation\Rule; use Laravel\Fortify\Contracts\CreatesNewUsers; -class CreateNewUser implements CreatesNewUsers -{ +class CreateNewUser implements CreatesNewUsers { use PasswordValidationRules; /** @@ -17,8 +16,7 @@ class CreateNewUser implements CreatesNewUsers * * @param array $input */ - public function create(array $input): User - { + public function create(array $input): User { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], 'email' => [ diff --git a/app/Actions/Fortify/PasswordValidationRules.php b/app/Actions/Fortify/PasswordValidationRules.php index 76b19d3..2b7b655 100644 --- a/app/Actions/Fortify/PasswordValidationRules.php +++ b/app/Actions/Fortify/PasswordValidationRules.php @@ -4,15 +4,13 @@ use Illuminate\Validation\Rules\Password; -trait PasswordValidationRules -{ +trait PasswordValidationRules { /** * Get the validation rules used to validate passwords. * * @return array|string> */ - protected function passwordRules(): array - { + protected function passwordRules(): array { return ['required', 'string', Password::default(), 'confirmed']; } } diff --git a/app/Actions/Fortify/ResetUserPassword.php b/app/Actions/Fortify/ResetUserPassword.php index 7a57c50..6d1f93b 100644 --- a/app/Actions/Fortify/ResetUserPassword.php +++ b/app/Actions/Fortify/ResetUserPassword.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Validator; use Laravel\Fortify\Contracts\ResetsUserPasswords; -class ResetUserPassword implements ResetsUserPasswords -{ +class ResetUserPassword implements ResetsUserPasswords { use PasswordValidationRules; /** @@ -16,8 +15,7 @@ class ResetUserPassword implements ResetsUserPasswords * * @param array $input */ - public function reset(User $user, array $input): void - { + public function reset(User $user, array $input): void { Validator::make($input, [ 'password' => $this->passwordRules(), ])->validate(); diff --git a/app/Actions/Fortify/UpdateUserPassword.php b/app/Actions/Fortify/UpdateUserPassword.php index 7005639..17e0e2f 100644 --- a/app/Actions/Fortify/UpdateUserPassword.php +++ b/app/Actions/Fortify/UpdateUserPassword.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Validator; use Laravel\Fortify\Contracts\UpdatesUserPasswords; -class UpdateUserPassword implements UpdatesUserPasswords -{ +class UpdateUserPassword implements UpdatesUserPasswords { use PasswordValidationRules; /** @@ -16,8 +15,7 @@ class UpdateUserPassword implements UpdatesUserPasswords * * @param array $input */ - public function update(User $user, array $input): void - { + public function update(User $user, array $input): void { Validator::make($input, [ 'current_password' => ['required', 'string', 'current_password:web'], 'password' => $this->passwordRules(), diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index 0930ddf..39f07a0 100644 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -8,15 +8,13 @@ use Illuminate\Validation\Rule; use Laravel\Fortify\Contracts\UpdatesUserProfileInformation; -class UpdateUserProfileInformation implements UpdatesUserProfileInformation -{ +class UpdateUserProfileInformation implements UpdatesUserProfileInformation { /** * Validate and update the given user's profile information. * * @param array $input */ - public function update(User $user, array $input): void - { + public function update(User $user, array $input): void { Validator::make($input, [ 'name' => ['required', 'string', 'max:255'], @@ -45,8 +43,7 @@ public function update(User $user, array $input): void * * @param array $input */ - protected function updateVerifiedUser(User $user, array $input): void - { + protected function updateVerifiedUser(User $user, array $input): void { $user->forceFill([ 'name' => $input['name'], 'email' => $input['email'], diff --git a/app/Console/Commands/Log/ClearLogFile.php b/app/Console/Commands/Log/ClearLogFile.php index 97df90d..66eae2d 100644 --- a/app/Console/Commands/Log/ClearLogFile.php +++ b/app/Console/Commands/Log/ClearLogFile.php @@ -4,8 +4,7 @@ use Illuminate\Console\Command; -class ClearLogFile extends Command -{ +class ClearLogFile extends Command { /** * The name and signature of the console command. * @@ -23,8 +22,7 @@ class ClearLogFile extends Command /** * Execute the console command. */ - public function handle() - { + public function handle() { // exec('echo "" > ' . storage_path('logs/laravel.log')); exec('echo "" > ' . storage_path('logs/query.log')); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e6b9960..fb05564 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -5,22 +5,19 @@ use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; -class Kernel extends ConsoleKernel -{ +class Kernel extends ConsoleKernel { /** * Define the application's command schedule. */ - protected function schedule(Schedule $schedule): void - { + protected function schedule(Schedule $schedule): void { // $schedule->command('inspire')->hourly(); } /** * Register the commands for the application. */ - protected function commands(): void - { - $this->load(__DIR__.'/Commands'); + protected function commands(): void { + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 56af264..8149ac6 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; -class Handler extends ExceptionHandler -{ +class Handler extends ExceptionHandler { /** * The list of the inputs that are never flashed to the session on validation exceptions. * @@ -21,8 +20,7 @@ class Handler extends ExceptionHandler /** * Register the exception handling callbacks for the application. */ - public function register(): void - { + public function register(): void { $this->reportable(function (Throwable $e) { // }); diff --git a/app/Faker/TaxonomyProvider.php b/app/Faker/TaxonomyProvider.php index d3c3df6..21a23aa 100644 --- a/app/Faker/TaxonomyProvider.php +++ b/app/Faker/TaxonomyProvider.php @@ -1,4 +1,5 @@ kingdom = $this->kingdom ?? static::randomElements(static::$kingdoms); + return $this->kingdom; } - function genus() { + public function genus() { $this->genus = $this->genus ?? static::randomElements(array_keys(static::$taxonomy[$this->kingdom()]))[0]; + return $this->genus; } - function species() { - $species_tree = static::$taxonomy[$this->kingdom()][$this->genus()]; + public function species() { + $species_tree = static::$taxonomy[$this->kingdom()][$this->genus()]; $this->species = $this->species ?? static::randomElements(array_values($species_tree))[0]; + return $this->species; } - function subspecies() { + public function subspecies() { return Str::random(10); } - function variety() { + public function variety() { return Str::random(10); } - function cultivar() { + public function cultivar() { return Str::random(10); } protected function getTaxaTree() { - if(!$this->kingdom) { + if (! $this->kingdom) { return static::$taxonomy; - } else if(!$this->genus) { + } elseif (! $this->genus) { return static::$taxonomy[$this->kingdom]; - } else if(!$this->species) { + } elseif (! $this->species) { return static::$taxonomy[$this->kingdom][$this->genus]; } } @@ -71,14 +77,14 @@ protected function getTaxaTree() { 'nebrodensis', 'borisii-regis', 'ephalonica', - 'nordmanniana' + 'nordmanniana', ], 'Abroma' => [ 'augustum', 'molle', ], 'Azorina' => [ - 'vidalli' + 'vidalli', ], 'Brachyscome' => [ 'aculeata', @@ -86,13 +92,13 @@ protected function getTaxaTree() { 'basaltica', 'chrysoglossa', 'ciliaris', - 'decipiens' + 'decipiens', ], ], 'Fungi' => [], 'Protista' => [], 'Eubacteria' => [], - 'Archaebateria' => [] + 'Archaebateria' => [], ]; public function taxonomicName() { diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 9e64a22..ab44c29 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -1,143 +1,174 @@ validate($request, [ + 'limit' => ['integer', 'max:1000'], + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 1000); + $offset = $request->input('offset', 0); + + $conditions = []; + if ($request->has('managementType')) { + if ($request->managementType == 'live') { + $conditions[] = ['managementType', 'Live Data']; + } elseif ($request->managementType == 'snapshot') { + $conditions[] = ['managementType', 'Snapshot']; + } elseif ($request->managementType == 'aggregate') { + $conditions[] = ['managementType', 'Aggregate']; + } + } + if ($request->has('collectionType')) { + if ($request->collectionType == 'specimens') { + $conditions[] = ['collType', 'Preserved Specimens']; + } elseif ($request->collectionType == 'observations') { + $conditions[] = ['collType', 'Observations']; + } elseif ($request->collectionType == 'researchObservations') { + $conditions[] = ['collType', 'General Observations']; + } + } - /** - * @OA\Get( - * path="/api/v2/collection", - * operationId="/api/v2/collection", - * tags={""}, - * @OA\Parameter( - * name="managementType", - * in="query", - * description="live, snapshot, aggregate", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="collectionType", - * in="query", - * description="preservedSpecimens, observations, researchObservation", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results per page", - * required=false, - * @OA\Schema(type="integer", default=1000) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of collections", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllCollections(Request $request){ - $this->validate($request, [ - 'limit' => ['integer', 'max:1000'], - 'offset' => 'integer' - ]); - $limit = $request->input('limit',1000); - $offset = $request->input('offset',0); + $fullCnt = Collection::where($conditions)->count(); + $result = Collection::where($conditions)->skip($offset)->take($limit)->get(); - $conditions = []; - if($request->has('managementType')){ - if($request->managementType == 'live') $conditions[] = ['managementType','Live Data']; - elseif($request->managementType == 'snapshot') $conditions[] = ['managementType','Snapshot']; - elseif($request->managementType == 'aggregate') $conditions[] = ['managementType','Aggregate']; - } - if($request->has('collectionType')){ - if($request->collectionType == 'specimens') $conditions[] = ['collType','Preserved Specimens']; - elseif($request->collectionType == 'observations') $conditions[] = ['collType','Observations']; - elseif($request->collectionType == 'researchObservations') $conditions[] = ['collType','General Observations']; - } + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - $fullCnt = Collection::where($conditions)->count(); - $result = Collection::where($conditions)->skip($offset)->take($limit)->get(); + //return response()->json($retObj); + return response($retObj); + } - $eor = false; - $retObj = [ - "offset" => (int)$offset, - "limit" => (int)$limit, - "endOfRecords" => $eor, - "count" => $fullCnt, - "results" => $result - ]; - //return response()->json($retObj); - return response($retObj); - } + /** + * @OA\Get( + * path="/api/v2/collection/{identifier}", + * operationId="/api/v2/collection/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Installation ID or GUID associated with target collection", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns collection data", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Collection identifier is required.", + * ), + * ) + */ + public function showOneCollection($id, Request $request) { + $collectionObj = null; + if (is_numeric($id)) { + $collectionObj = Collection::find($id); + } else { + $collectionObj = Collection::where('collectionGuid', $id)->first(); + } + if (! $collectionObj->count()) { + $collectionObj = ['status' => false, 'error' => 'Unable to locate collection based on identifier']; + } - /** - * @OA\Get( - * path="/api/v2/collection/{identifier}", - * operationId="/api/v2/collection/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Installation ID or GUID associated with target collection", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns collection data", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Collection identifier is required.", - * ), - * ) - */ - public function showOneCollection($id, Request $request){ - $collectionObj = null; - if(is_numeric($id)) $collectionObj = Collection::find($id); - else $collectionObj = Collection::where('collectionGuid',$id)->first(); - if(!$collectionObj->count()) $collectionObj = ["status"=>false,"error"=>"Unable to locate collection based on identifier"]; - return response($collectionObj); - } + return response($collectionObj); + } - public function create(Request $request){ - //$collection = Collection::create($request->all()); - //return response()->json($collection, 201); - } + public function create(Request $request) { + //$collection = Collection::create($request->all()); + //return response()->json($collection, 201); + } - public function update($id, Request $request){ - //$collection = Collection::findOrFail($id); - //$collection->update($request->all()); - //return response()->json($collection, 200); - } + public function update($id, Request $request) { + //$collection = Collection::findOrFail($id); + //$collection->update($request->all()); + //return response()->json($collection, 200); + } - public function delete($id){ - //Collection::findOrFail($id)->delete(); - //return response('Collection Deleted Successfully', 200); - } + public function delete($id) { + //Collection::findOrFail($id)->delete(); + //return response('Collection Deleted Successfully', 200); + } } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 6b17ff1..74533bd 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -16,16 +16,17 @@ * }, * title="L5 OpenApi", * description="L5 Swagger OpenApi description", + * * @OA\Contact( * email="darius@matulionis.lt" * ), + * * @OA\License( * name="Apache 2.0", * url="https://www.apache.org/licenses/LICENSE-2.0.html" * ) * ) */ -class Controller extends BaseController -{ +class Controller extends BaseController { use AuthorizesRequests, ValidatesRequests; } diff --git a/app/Http/Controllers/DuplicateController.php b/app/Http/Controllers/DuplicateController.php index bb9fb69..0b0853b 100644 --- a/app/Http/Controllers/DuplicateController.php +++ b/app/Http/Controllers/DuplicateController.php @@ -1,46 +1,53 @@ validate($request, [ - 'limit' => ['integer', 'max:300'], - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); - - $conditions = array(); - if($request->has('collector')) $conditions['collector'] = $request->collector; - if($request->has('number')) $conditions['number'] = $request->number; - if($request->has('eventDate')) $conditions['eventDate'] = $request->eventDate; - if($request->has('exsiccatiIdentifier')) $conditions['exsiccatiIdentifier'] = $request->exsiccatiIdentifier; - if($request->has('exsiccatiNumber')) $conditions['exsiccatiNumber'] = $request->exsiccatiNumber; - - - - $eor = false; - $retObj = [ - "offset" => (int)$offset, - "limit" => (int)$limit, - "endOfRecords" => $eor, - "count" => $fullCnt, - "results" => $result - ]; - return response()->json($retObj); - } - - -} \ No newline at end of file + +class DuplicateController extends Controller { + /** + * Duplicate controller instance. + * + * @return void + */ + public function __construct() {} + + public function showDuplicateSpecimens(Request $request) { + $this->validate($request, [ + 'limit' => ['integer', 'max:300'], + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $conditions = []; + if ($request->has('collector')) { + $conditions['collector'] = $request->collector; + } + if ($request->has('number')) { + $conditions['number'] = $request->number; + } + if ($request->has('eventDate')) { + $conditions['eventDate'] = $request->eventDate; + } + if ($request->has('exsiccatiIdentifier')) { + $conditions['exsiccatiIdentifier'] = $request->exsiccatiIdentifier; + } + if ($request->has('exsiccatiNumber')) { + $conditions['exsiccatiNumber'] = $request->exsiccatiNumber; + } + + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + + return response()->json($retObj); + } +} diff --git a/app/Http/Controllers/InstallationController.php b/app/Http/Controllers/InstallationController.php index c728001..773a882 100644 --- a/app/Http/Controllers/InstallationController.php +++ b/app/Http/Controllers/InstallationController.php @@ -1,375 +1,433 @@ validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $fullCnt = PortalIndex::count(); + $result = PortalIndex::skip($offset)->take($limit)->get(); + + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + + return response()->json($retObj); + } + + /** + * @OA\Get( + * path="/api/v2/installation/{identifier}", + * operationId="/api/v2/installation/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Installation ID or GUID associated with target installation", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns metabase on installation registered within system with matching ID", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Installation identifier is required.", + * ), + * ) + */ + public function showOnePortal($id, Request $request) { + $portalObj = null; + if (is_numeric($id)) { + $portalObj = PortalIndex::find($id); + } else { + $portalObj = PortalIndex::where('guid', $id)->first(); + } + if (! $portalObj->count()) { + $portalObj = ['status' => false, 'error' => 'Unable to locate installation based on identifier']; + } + + return response()->json($portalObj); + } + + /** + * @OA\Get( + * path="/api/v2/installation/ping", + * operationId="/api/v2/installation/ping", + * tags={""}, + * + * @OA\Response( + * response="200", + * description="Returns installation metadata", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function pingPortal(Request $request) { + $portalObj = null; + if (isset($_ENV['DEFAULT_TITLE']) && isset($_ENV['PORTAL_GUID'])) { + $portalObj['status'] = true; + $portalObj['portalName'] = $_ENV['DEFAULT_TITLE']; + $portalObj['guid'] = $_ENV['PORTAL_GUID']; + $portalObj['managerEmail'] = $_ENV['ADMIN_EMAIL']; + $portalObj['urlRoot'] = $this->getServerDomain() . $_ENV['CLIENT_ROOT']; + $portalObj['symbiotaVersion'] = $_ENV['SYMBIOTA_VERSION']; + } else { + $portalObj['status'] = false; + if (! isset($_ENV['DEFAULT_TITLE'])) { + $portalObj['error'][] = 'Portal title is NULL'; + } + if (! isset($_ENV['PORTAL_GUID'])) { + $portalObj['error'][] = 'Portal GUID is NULL'; + } + $portalObj['status'] = false; + } + + return response()->json($portalObj); + } - /** - * @OA\Get( - * path="/api/v2/installation", - * operationId="/api/v2/installation", - * tags={""}, - * @OA\Parameter( - * name="limit", - * in="query", - * description="Pagination parameter: maximum number of records per page", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Pagination parameter: page number", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of installations registered within system", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllPortals(Request $request){ - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + /** + * @OA\Get( + * path="/api/v2/installation/{identifier}/touch", + * operationId="/api/v2/installation/identifier/touch", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Identifier of the remote installation", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="endpoint", + * in="query", + * description="Url to Symbiota root of remote installation", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns metabase remote installation, if successfully registered", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Identifier of remote installation is required.", + * ), + * ) + */ + public function portalHandshake($id, Request $request) { + $responseArr = ['status' => 500, 'error' => 'Unknown error']; + $portalObj = PortalIndex::where('guid', $id)->get(); + if ($portalObj->count()) { + $responseArr['status'] = 200; + $responseArr['message'] = 'Portal previously registered'; + unset($responseArr['error']); + } elseif ($id == $_ENV['PORTAL_GUID']) { + //Make sure touch isn't referring to self + $responseArr['status'] = 400; + $responseArr['error'] = 'Registration failed: handshake is referencing self'; + } elseif ($request->has('endpoint')) { + //Remote installation not yet in system, thus add and then process list from remote + if ($baseUrl = $request->input('endpoint')) { + //Insert portal + $urlPing = $baseUrl . '/api/v2/installation/ping'; + if ($remote = $this->getAPIResponce($urlPing)) { + if ($id == $remote['guid']) { + //Shake back just to makes sure remote knows about self + $remoteTouch = $baseUrl . '/api/v2/installation/' . $_ENV['PORTAL_GUID'] . '/touch?endpoint=' . htmlentities($this->getServerDomain() . $_ENV['CLIENT_ROOT']); + $this->getAPIResponce($remoteTouch, true); + try { + //Register remote + $portalObj = PortalIndex::create($remote); + $responseArr['status'] = 200; + $responseArr['message'] = 'Remote portal registered successfully'; + unset($responseArr['error']); + //Register all portals listed within remote, if not alreay registered + $urlInstallation = $baseUrl . '/api/v2/installation'; + if ($remoteInstallationArr = $this->getAPIResponce($urlInstallation)) { + $currentRegistered = 0; + $newRegistration = 0; + foreach ($remoteInstallationArr['results'] as $portal) { + if (PortalIndex::where('guid', $portal['guid'])->count()) { + $currentRegistered++; + } elseif ($portal['guid'] != $_ENV['PORTAL_GUID']) { + //If remote exists, add by retriving info directly from source + $remotePing = $portal['urlRoot'] . '/api/v2/installation/ping'; + if ($newRemote = $this->getAPIResponce($remotePing)) { + PortalIndex::create($newRemote); + //Touch remote installation but don't wait for a response because propagation across a large network can take awhile + $urlTouch = $portal['urlRoot'] . '/api/v2/installation/' . $_ENV['PORTAL_GUID'] . '/touch?endpoint=' . htmlentities($this->getServerDomain() . $_ENV['CLIENT_ROOT']); + $this->getAPIResponce($urlTouch, true); + $newRegistration++; + } + } + } + $responseArr['Currently registered remotes'] = $currentRegistered; + $responseArr['Newly registrations remotes'] = $newRegistration; + } else { + $responseArr['error'] = 'Unable to obtain remote installation listing: ' . $urlInstallation; + } + } catch (\Illuminate\Database\QueryException $ex) { + $responseArr['status'] = 503; + $responseArr['error'] = 'Registration failed: Unable insert database record: ' . $ex->getMessage(); + } + } else { + $responseArr['status'] = 422; + $responseArr['error'] = 'Registration failed: Supplied and returned remote GUIDs not matching (' . $id . ' != ' . $remote['guid'] . ') '; + } + } else { + $responseArr['status'] = 422; + $responseArr['error'] = 'Registration failed: Endpoint illegal or non-functional: ' . $urlPing; + } + } + } else { + $responseArr['status'] = 422; + $responseArr['error'] = 'Registration failed: Unable to obtain portal endpoint'; + } + $responseArr['results'] = $portalObj; - $fullCnt = PortalIndex::count(); - $result = PortalIndex::skip($offset)->take($limit)->get(); + return response()->json($responseArr); + } - $eor = false; - $retObj = [ - "offset" => (int)$offset, - "limit" => (int)$limit, - "endOfRecords" => $eor, - "count" => $fullCnt, - "results" => $result - ]; - return response()->json($retObj); - } + /** + * @OA\Get( + * path="/api/v2/installation/{identifier}/occurrence", + * operationId="/api/v2/installation/identifier/occurrence", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Identifier of the remote installation", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Pagination parameter: maximum number of records per page", + * required=false, + * + * @OA\Schema(type="integer", default=100) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Pagination parameter: page number", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of occurrences associated with an installations", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Identifier of remote installation is required.", + * ), + * ) + */ + public function showOccurrences($id, Request $request) { + $this->validate($request, [ + 'verification' => ['integer'], + 'limit' => ['integer', 'max:1000'], + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); - /** - * @OA\Get( - * path="/api/v2/installation/{identifier}", - * operationId="/api/v2/installation/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Installation ID or GUID associated with target installation", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns metabase on installation registered within system with matching ID", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Installation identifier is required.", - * ), - * ) - */ - public function showOnePortal($id, Request $request){ - $portalObj = null; - if(is_numeric($id)) $portalObj = PortalIndex::find($id); - else $portalObj = PortalIndex::where('guid',$id)->first(); - if(!$portalObj->count()) $portalObj = ["status"=>false,"error"=>"Unable to locate installation based on identifier"]; - return response()->json($portalObj); - } + $portalObj = null; + if (is_numeric($id)) { + $portalObj = PortalIndex::find($id); + } else { + $portalObj = PortalIndex::where('guid', $id)->first(); + } - /** - * @OA\Get( - * path="/api/v2/installation/ping", - * operationId="/api/v2/installation/ping", - * tags={""}, - * @OA\Response( - * response="200", - * description="Returns installation metadata", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function pingPortal(Request $request){ - $portalObj = null; - if(isset($_ENV['DEFAULT_TITLE']) && isset($_ENV['PORTAL_GUID'])){ - $portalObj['status'] = true; - $portalObj['portalName'] = $_ENV['DEFAULT_TITLE']; - $portalObj['guid'] = $_ENV['PORTAL_GUID']; - $portalObj['managerEmail'] = $_ENV['ADMIN_EMAIL']; - $portalObj['urlRoot'] = $this->getServerDomain().$_ENV['CLIENT_ROOT']; - $portalObj['symbiotaVersion'] = $_ENV['SYMBIOTA_VERSION']; - } - else{ - $portalObj['status'] = false; - if(!isset($_ENV['DEFAULT_TITLE'])) $portalObj['error'][] = 'Portal title is NULL'; - if(!isset($_ENV['PORTAL_GUID'])) $portalObj['error'][] = 'Portal GUID is NULL'; - $portalObj['status'] = false; - } - return response()->json($portalObj); - } + $retObj = []; + if ($portalObj) { + $conditions = []; + if ($request->has('verification')) { + if ($request->verification) { + $conditions[] = ['verification', 1]; + } else { + $conditions[] = ['verification', 0]; + } + } + $fullCnt = $portalObj->portalOccurrences()->where($conditions)->count(); + $result = $portalObj->portalOccurrences()->where($conditions)->skip($offset)->take($limit)->get(); + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + } else { + $retObj = ['status' => false, 'error' => 'Unable to locate installation based on identifier']; + } - /** - * @OA\Get( - * path="/api/v2/installation/{identifier}/touch", - * operationId="/api/v2/installation/identifier/touch", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Identifier of the remote installation", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="endpoint", - * in="query", - * description="Url to Symbiota root of remote installation", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns metabase remote installation, if successfully registered", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Identifier of remote installation is required.", - * ), - * ) - */ - public function portalHandshake($id, Request $request){ - $responseArr = array( 'status' => 500, 'error' => 'Unknown error' ); - $portalObj = PortalIndex::where('guid',$id)->get(); - if($portalObj->count()){ - $responseArr['status'] = 200; - $responseArr['message'] = 'Portal previously registered'; - unset($responseArr['error']); - } - elseif($id == $_ENV['PORTAL_GUID']){ - //Make sure touch isn't referring to self - $responseArr['status'] = 400; - $responseArr['error'] = 'Registration failed: handshake is referencing self'; - } - elseif($request->has('endpoint')){ - //Remote installation not yet in system, thus add and then process list from remote - if($baseUrl = $request->input('endpoint')){ - //Insert portal - $urlPing = $baseUrl.'/api/v2/installation/ping'; - if($remote = $this->getAPIResponce($urlPing)){ - if($id == $remote['guid']){ - //Shake back just to makes sure remote knows about self - $remoteTouch = $baseUrl.'/api/v2/installation/'.$_ENV['PORTAL_GUID'].'/touch?endpoint='.htmlentities($this->getServerDomain().$_ENV['CLIENT_ROOT']); - $this->getAPIResponce($remoteTouch, true); - try { - //Register remote - $portalObj = PortalIndex::create($remote); - $responseArr['status'] = 200; - $responseArr['message'] = 'Remote portal registered successfully'; - unset($responseArr['error']); - //Register all portals listed within remote, if not alreay registered - $urlInstallation = $baseUrl.'/api/v2/installation'; - if($remoteInstallationArr = $this->getAPIResponce($urlInstallation)){ - $currentRegistered = 0; - $newRegistration = 0; - foreach($remoteInstallationArr['results'] as $portal){ - if(PortalIndex::where('guid',$portal['guid'])->count()) $currentRegistered++; - elseif($portal['guid'] != $_ENV['PORTAL_GUID']){ - //If remote exists, add by retriving info directly from source - $remotePing = $portal['urlRoot'].'/api/v2/installation/ping'; - if($newRemote = $this->getAPIResponce($remotePing)){ - PortalIndex::create($newRemote); - //Touch remote installation but don't wait for a response because propagation across a large network can take awhile - $urlTouch = $portal['urlRoot'].'/api/v2/installation/'.$_ENV['PORTAL_GUID'].'/touch?endpoint='.htmlentities($this->getServerDomain().$_ENV['CLIENT_ROOT']); - $this->getAPIResponce($urlTouch, true); - $newRegistration++; - } - } - } - $responseArr['Currently registered remotes'] = $currentRegistered; - $responseArr['Newly registrations remotes'] = $newRegistration; - } - else $responseArr['error'] = 'Unable to obtain remote installation listing: '.$urlInstallation; - } - catch(\Illuminate\Database\QueryException $ex){ - $responseArr['status'] = 503; - $responseArr['error'] = 'Registration failed: Unable insert database record: '.$ex->getMessage(); - } - } - else{ - $responseArr['status'] = 422; - $responseArr['error'] = 'Registration failed: Supplied and returned remote GUIDs not matching ('.$id.' != '.$remote['guid'].') '; - } - } - else{ - $responseArr['status'] = 422; - $responseArr['error'] = 'Registration failed: Endpoint illegal or non-functional: '.$urlPing; - } - } - } - else{ - $responseArr['status'] = 422; - $responseArr['error'] = 'Registration failed: Unable to obtain portal endpoint'; - } - $responseArr['results'] = $portalObj; - return response()->json($responseArr); - } + return response()->json($retObj); + } - /** - * @OA\Get( - * path="/api/v2/installation/{identifier}/occurrence", - * operationId="/api/v2/installation/identifier/occurrence", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Identifier of the remote installation", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Pagination parameter: maximum number of records per page", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Pagination parameter: page number", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of occurrences associated with an installations", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Identifier of remote installation is required.", - * ), - * ) - */ - public function showOccurrences($id, Request $request){ - $this->validate($request, [ - 'verification' => ['integer'], - 'limit' => ['integer', 'max:1000'], - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + public function create(Request $request) { + /* + $validated = $request->validate([ + 'portalName' => 'required|max:45', + 'urlRoot' => 'required|max:150', + ]); + $portalIndex = PortalIndex::create($request->all()); - $portalObj = null; - if(is_numeric($id)) $portalObj = PortalIndex::find($id); - else $portalObj = PortalIndex::where('guid',$id)->first(); + return response()->json($portalIndex, 201); + */ + } - $retObj = []; - if($portalObj){ - $conditions = []; - if($request->has('verification')){ - if($request->verification) $conditions[] = ['verification',1]; - else $conditions[] = ['verification',0]; - } - $fullCnt = $portalObj->portalOccurrences()->where($conditions)->count(); - $result = $portalObj->portalOccurrences()->where($conditions)->skip($offset)->take($limit)->get(); - $eor = false; - $retObj = [ - "offset" => (int)$offset, - "limit" => (int)$limit, - "endOfRecords" => $eor, - "count" => $fullCnt, - "results" => $result - ]; - } - else $retObj = ["status"=>false,"error"=>"Unable to locate installation based on identifier"]; - return response()->json($retObj); - } + public function update($id, Request $request) { + /* + $portalIndex = PortalIndex::findOrFail($id); + $portalIndex->update($request->all()); - public function create(Request $request){ - /* - $validated = $request->validate([ - 'portalName' => 'required|max:45', - 'urlRoot' => 'required|max:150', - ]); - $portalIndex = PortalIndex::create($request->all()); + return response()->json($portalIndex, 200); + */ + } - return response()->json($portalIndex, 201); - */ - } + public function delete($id) { + /* + PortalIndex::findOrFail($id)->delete(); + return response('Portal Index deleted successfully', 200); + */ + } - public function update($id, Request $request){ - /* - $portalIndex = PortalIndex::findOrFail($id); - $portalIndex->update($request->all()); + //Helper functions + private function getAPIResponce($url, $asyc = false) { + $resJson = false; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_URL, $url); + //curl_setopt($ch, CURLOPT_HTTPGET, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + if ($asyc) { + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 500); + } + $resJson = curl_exec($ch); + if (! $resJson) { + $this->errorMessage = 'FATAL CURL ERROR: ' . curl_error($ch) . ' (#' . curl_errno($ch) . ')'; - return response()->json($portalIndex, 200); - */ - } + return false; + //$header = curl_getinfo($ch); + } + curl_close($ch); - public function delete($id){ - /* - PortalIndex::findOrFail($id)->delete(); - return response('Portal Index deleted successfully', 200); - */ - } + return json_decode($resJson, true); + } - //Helper functions - private function getAPIResponce($url, $asyc = false){ - $resJson = false; - $ch = curl_init(); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_URL, $url); - //curl_setopt($ch, CURLOPT_HTTPGET, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - if($asyc) curl_setopt($ch, CURLOPT_TIMEOUT_MS, 500); - $resJson = curl_exec($ch); - if(!$resJson){ - $this->errorMessage = 'FATAL CURL ERROR: '.curl_error($ch).' (#'.curl_errno($ch).')'; - return false; - //$header = curl_getinfo($ch); - } - curl_close($ch); - return json_decode($resJson,true); - } + private function getServerDomain() { + $domain = 'http://'; + if ((! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) { + $domain = 'https://'; + } + if (! empty($GLOBALS['SERVER_HOST'])) { + if (substr($GLOBALS['SERVER_HOST'], 0, 4) == 'http') { + $domain = $GLOBALS['SERVER_HOST']; + } else { + $domain .= $GLOBALS['SERVER_HOST']; + } + } else { + $domain .= $_SERVER['SERVER_NAME']; + } + if ($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && ! strpos($domain, ':' . $_SERVER['SERVER_PORT'])) { + $domain .= ':' . $_SERVER['SERVER_PORT']; + } + $domain = filter_var($domain, FILTER_SANITIZE_URL); - private function getServerDomain(){ - $domain = 'http://'; - if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) $domain = 'https://'; - if(!empty($GLOBALS['SERVER_HOST'])){ - if(substr($GLOBALS['SERVER_HOST'], 0, 4) == 'http') $domain = $GLOBALS['SERVER_HOST']; - else $domain .= $GLOBALS['SERVER_HOST']; - } - else $domain .= $_SERVER['SERVER_NAME']; - if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && !strpos($domain, ':'.$_SERVER['SERVER_PORT'])){ - $domain .= ':'.$_SERVER['SERVER_PORT']; - } - $domain = filter_var($domain, FILTER_SANITIZE_URL); - return $domain; - } -} \ No newline at end of file + return $domain; + } +} diff --git a/app/Http/Controllers/InventoryController.php b/app/Http/Controllers/InventoryController.php index 07d9a55..f3c7966 100644 --- a/app/Http/Controllers/InventoryController.php +++ b/app/Http/Controllers/InventoryController.php @@ -1,167 +1,198 @@ validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $fullCnt = Inventory::count(); + $result = Inventory::skip($offset)->take($limit)->get(); + $result->makeHidden('footprintWkt')->toArray(); + + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + + return response()->json($retObj); + } - /** - * @OA\Get( - * path="/api/v2/inventory", - * operationId="/api/v2/inventory", - * tags={""}, - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results in the page.", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of inventories registered within system", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllInventories(Request $request){ - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + /** + * @OA\Get( + * path="/api/v2/inventory/{identifier}", + * operationId="/api/v2/inventory/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="PK, GUID, or recordID associated with target inventory", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns metabase on inventory registered within system with matching ID", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Inventory identifier is required.", + * ), + * ) + */ + public function showOneInventory($id, Request $request) { + $id = $this->getClid($id); + $inventoryObj = Inventory::find($id); + if (! $inventoryObj->count()) { + $inventoryObj = ['status' => false, 'error' => 'Unable to locate inventory based on identifier']; + } - $fullCnt = Inventory::count(); - $result = Inventory::skip($offset)->take($limit)->get(); - $result->makeHidden('footprintWkt')->toArray(); + return response()->json($inventoryObj); + } - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + /** + * @OA\Get( + * path="/api/v2/inventory/{identifier}/taxa", + * operationId="/api/v2/inventory/identifier/taxa", + * tags={""}, + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Controls the number of results per page", + * required=false, + * + * @OA\Schema(type="integer", default=100) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of inventories registered within system", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showOneInventoryTaxa($id, Request $request) { + $this->validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); - /** - * @OA\Get( - * path="/api/v2/inventory/{identifier}", - * operationId="/api/v2/inventory/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="PK, GUID, or recordID associated with target inventory", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns metabase on inventory registered within system with matching ID", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Inventory identifier is required.", - * ), - * ) - */ - public function showOneInventory($id, Request $request){ - $id = $this->getClid($id); - $inventoryObj = Inventory::find($id); - if(!$inventoryObj->count()) $inventoryObj = ['status' =>false, 'error' => 'Unable to locate inventory based on identifier']; - return response()->json($inventoryObj); - } + $id = $this->getClid($id); + $inventoryObj = Inventory::find($id); + $fullCnt = $inventoryObj->taxa()->count(); + $result = null; + if ($fullCnt) { + $result = $inventoryObj->taxa()->skip($offset)->take($limit)->get(); + } else { + $result = ['status' => false, 'error' => 'Unable to locate inventory based on identifier']; + } - /** - * @OA\Get( - * path="/api/v2/inventory/{identifier}/taxa", - * operationId="/api/v2/inventory/identifier/taxa", - * tags={""}, - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results per page", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of inventories registered within system", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showOneInventoryTaxa($id, Request $request){ - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + $eor = false; + if (($offset + $limit) >= $fullCnt) { + $eor = true; + } + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - $id = $this->getClid($id); - $inventoryObj = Inventory::find($id); - $fullCnt = $inventoryObj->taxa()->count(); - $result = null; - if($fullCnt){ - $result = $inventoryObj->taxa()->skip($offset)->take($limit)->get(); - } - else $result = ['status' =>false, 'error' => 'Unable to locate inventory based on identifier']; + return response()->json($retObj); + } - $eor = false; - if(($offset + $limit) >= $fullCnt) $eor = true; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + //Helper function + protected function getClid($id) { + if (is_numeric($id)) { + $clid = $id; + } else { + $clid = Inventory::where('recordID', $id)->first()->value('clid'); + if (! $clid) { + $clid = Inventory::where('guid', $id)->first()->value('clid'); + } + } - //Helper function - protected function getClid($id){ - if(is_numeric($id)) $clid = $id; - else{ - $clid = Inventory::where('recordID', $id)->first()->value('clid'); - if(!$clid) $clid = Inventory::where('guid', $id)->first()->value('clid'); - } - return $clid; - } -} \ No newline at end of file + return $clid; + } +} diff --git a/app/Http/Controllers/InventoryPackageController.php b/app/Http/Controllers/InventoryPackageController.php index 4dbb816..9714080 100644 --- a/app/Http/Controllers/InventoryPackageController.php +++ b/app/Http/Controllers/InventoryPackageController.php @@ -1,4 +1,5 @@ validate($request, [ - 'includeDescriptions' => 'integer', - 'descriptionLimit' => 'integer', - 'includeImages' => 'integer', - 'imageLimit' => 'integer' - ]); - $includeDescriptions = $request->input('includeDescriptions', 0); - $descriptionLimit = $request->input('descriptionLimit', 1); - $includeImages = $request->input('includeImages', 0); - $imageLimit = $request->input('imageLimit', 3); +class InventoryPackageController extends InventoryController { + /** + * Inventory package controller instance. + * + * @return void + */ + public function __construct() {} - $id = $this->getClid($id); - $inventoryObj = Inventory::find($id); - $inventoryObj->taxa; - foreach($inventoryObj->taxa as $taxaObj){ - if($includeImages) $taxaObj->media = Media::where('tid', $taxaObj->tid)->orderBy('sortSequence')->take($imageLimit)->get(); - if($includeDescriptions){ - $description = TaxonomyDescription::where('tid', $taxaObj->tid)->orderBy('displayLevel')->take($descriptionLimit)->get(); - foreach($description as $descrObj){ - $descrObj->statements = TaxonomyDescriptionStatement::where('tdbid', $descrObj->tdbid)->get(); - } - $taxaObj->textDescription = $description; - } + public function oneInventoryDataPackage($id, Request $request) { + $this->validate($request, [ + 'includeDescriptions' => 'integer', + 'descriptionLimit' => 'integer', + 'includeImages' => 'integer', + 'imageLimit' => 'integer', + ]); + $includeDescriptions = $request->input('includeDescriptions', 0); + $descriptionLimit = $request->input('descriptionLimit', 1); + $includeImages = $request->input('includeImages', 0); + $imageLimit = $request->input('imageLimit', 3); - } - $result = $inventoryObj; - if(!$result->count()) $result = ['status' =>false, 'error' => 'Unable to locate inventory based on identifier']; + $id = $this->getClid($id); + $inventoryObj = Inventory::find($id); + $inventoryObj->taxa; + foreach ($inventoryObj->taxa as $taxaObj) { + if ($includeImages) { + $taxaObj->media = Media::where('tid', $taxaObj->tid)->orderBy('sortSequence')->take($imageLimit)->get(); + } + if ($includeDescriptions) { + $description = TaxonomyDescription::where('tid', $taxaObj->tid)->orderBy('displayLevel')->take($descriptionLimit)->get(); + foreach ($description as $descrObj) { + $descrObj->statements = TaxonomyDescriptionStatement::where('tdbid', $descrObj->tdbid)->get(); + } + $taxaObj->textDescription = $description; + } - return response()->json($result); - } + } + $result = $inventoryObj; + if (! $result->count()) { + $result = ['status' => false, 'error' => 'Unable to locate inventory based on identifier']; + } -} \ No newline at end of file + return response()->json($result); + } +} diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index a20c302..01b31d8 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -3,21 +3,21 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; use Illuminate\Support\MessageBag; class LoginController extends Controller { - /** * @OA\Get( * path="/login", + * * @OA\Response(response="200", description="An example endpoint") * ) */ - function __invoke() { + public function __invoke() { return response(view('pages/login'))->header('HX-Replace-URL', '/login'); } @@ -27,10 +27,11 @@ public static function login(Request $request) { 'password' => 'required', ]); - if($validator->fails()) { + if ($validator->fails()) { session()->flashInput($request->input()); + return view('pages/login', [ - 'errors' => $validator->errors() + 'errors' => $validator->errors(), ])->fragment('form'); } @@ -44,9 +45,8 @@ public static function login(Request $request) { [$validated['password'], $validated['email']] ); - //Check old password - if(count($result) > 0) { + if (count($result) > 0) { //Update Hashing to use new has then clear the old password for security DB::table('users') ->update([ @@ -56,8 +56,9 @@ public static function login(Request $request) { ]); } - if(Auth::attempt($validated)) { + if (Auth::attempt($validated)) { $request->session()->regenerate(); + return response(view('pages/home')) ->header('HX-Replace-URL', '/') ->header('HX-Retarget', 'body') @@ -65,8 +66,9 @@ public static function login(Request $request) { } session()->flashInput($request->input()); + return view('pages/login', [ - 'errors' => new MessageBag(['Invalid email or password']) + 'errors' => new MessageBag(['Invalid email or password']), ])->fragment('form'); } @@ -74,6 +76,7 @@ public static function logout(Request $request) { Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); + return response(view('pages/home')) ->header('HX-Replace-URL', '/'); } diff --git a/app/Http/Controllers/MarkdownController.php b/app/Http/Controllers/MarkdownController.php index b2391ef..615d8a4 100644 --- a/app/Http/Controllers/MarkdownController.php +++ b/app/Http/Controllers/MarkdownController.php @@ -4,25 +4,25 @@ use Illuminate\Http\Request; use League\CommonMark\Environment\Environment; -use League\CommonMark\Extension\GithubFlavoredMarkdownExtension; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; +use League\CommonMark\Extension\GithubFlavoredMarkdownExtension; use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension; //use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\MarkdownConverter; class MarkdownController extends Controller { - function __invoke(Request $request) { + public function __invoke(Request $request) { $path = $request->path(); $md_path = base_path() . '/' . $path; - if(!is_file($md_path)) { - $md_path = base_path() .'/docs/index.md'; + if (! is_file($md_path)) { + $md_path = base_path() . '/docs/index.md'; } $markdown_str = file_get_contents($md_path); $markdown_options = [ 'heading_permalink' => [ 'html_class' => 'heading-permalink', 'id_prefix' => '', - 'heading_class'=> 'perma-heading', + 'heading_class' => 'perma-heading', 'apply_id_to_heading' => true, 'insert' => 'before', 'min_heading_level' => 1, @@ -34,7 +34,8 @@ function __invoke(Request $request) { ]; $converter = new DocsMarkdownConverter($markdown_options); -//Str::markdown($markdown_str, $markdown_options) + + //Str::markdown($markdown_str, $markdown_options) return view('core/markdown', [ 'markdown' => $converter->convert($markdown_str)]); } @@ -44,7 +45,7 @@ final class DocsMarkdownConverter extends MarkdownConverter { /** * Create a new Markdown converter pre-configured for GFM * - * @param array $config + * @param array $config */ public function __construct(array $config = []) { $environment = new Environment($config); diff --git a/app/Http/Controllers/MediaController.php b/app/Http/Controllers/MediaController.php index f310165..ed29c1c 100644 --- a/app/Http/Controllers/MediaController.php +++ b/app/Http/Controllers/MediaController.php @@ -6,520 +6,558 @@ use Illuminate\Http\Request; use Illuminate\Support\Str; -class MediaController extends Controller{ +class MediaController extends Controller { + private $rulesInsert = [ + 'apiToken' => 'required', + 'originalUrl' => 'required', + 'occid' => 'integer|exists:omoccurrences,occid', + 'tid' => 'integer|exists:taxa,tid', + 'photographerUid' => 'integer|exists:users,uid', + ]; - private $rulesInsert = [ - 'apiToken' => 'required', - 'originalUrl' => 'required', - 'occid' => 'integer|exists:omoccurrences,occid', - 'tid' => 'integer|exists:taxa,tid', - 'photographerUid' => 'integer|exists:users,uid' - ]; + private $rulesUpdate = []; - private $rulesUpdate = []; + /** + * Media controller instance. + * + * @return void + */ + public function __construct() { + //parent::__construct(); + $this->rulesUpdate = $this->rulesInsert; + unset($this->rulesUpdate['originalUrl']); + } - /** - * Media controller instance. - * - * @return void - */ - public function __construct(){ - //parent::__construct(); - $this->rulesUpdate = $this->rulesInsert; - unset($this->rulesUpdate['originalUrl']); - } + /** + * @OA\Get( + * path="/api/v2/media", + * operationId="showAllMedia", + * tags={""}, + * + * @OA\Response( + * response="200", + * description="Returns list of media records", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showAllMedia() { + return response()->json(Media::skip(0)->take(100)->get()); + } - /** - * @OA\Get( - * path="/api/v2/media", - * operationId="showAllMedia", - * tags={""}, - * @OA\Response( - * response="200", - * description="Returns list of media records", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllMedia(){ - return response()->json(Media::skip(0)->take(100)->get()); - } + /** + * @OA\Get( + * path="/api/v2/media/{identifier}", + * operationId="showOneMedia", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="primary key or record GUID (UUID) associated with target media object", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns single media record", + * + * @OA\JsonContent(type="application/json") + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Media identifier is required.", + * ), + * ) + */ + public function showOneMedia($id) { + $media = Media::find($this->getImgid($id)); + if (! $media) { + return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); + } - /** - * @OA\Get( - * path="/api/v2/media/{identifier}", - * operationId="showOneMedia", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="primary key or record GUID (UUID) associated with target media object", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns single media record", - * @OA\JsonContent(type="application/json") - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Media identifier is required.", - * ), - * ) - */ - public function showOneMedia($id){ - $media = Media::find($this->getImgid($id)); - if(!$media){ - return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); - } - return response()->json($media); - } + return response()->json($media); + } - /** - * @OA\Post( - * path="/api/v2/media", - * operationId="insertMedia", - * summary="Creates a new Media record", - * tags={""}, - * @OA\Parameter( - * name="apiToken", - * in="query", - * description="API security token to authenticate post action", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\RequestBody( - * required=true, - * description="Media object to create", + /** + * @OA\Post( + * path="/api/v2/media", + * operationId="insertMedia", + * summary="Creates a new Media record", + * tags={""}, + * + * @OA\Parameter( + * name="apiToken", + * in="query", + * description="API security token to authenticate post action", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\RequestBody( + * required=true, + * description="Media object to create", + * * @OA\MediaType( * mediaType="application/json", + * * @OA\Schema( - * required={"originalUrl"}, + * required={"originalUrl"}, + * * @OA\Property( * property="format", * type="string", - * description="Media Type (MIME type)", - * maxLength=45, - * enum={"image/jpeg", "image/png", "image/tiff", "audio/wav"} + * description="Media Type (MIME type)", + * maxLength=45, + * enum={"image/jpeg", "image/png", "image/tiff", "audio/wav"} * ), * @OA\Property( * property="originalUrl", * type="string", - * description="URL of original media file; images should be a web-ready JPG", - * maxLength=255 + * description="URL of original media file; images should be a web-ready JPG", + * maxLength=255 * ), * @OA\Property( * property="mediumUrl", * type="string", - * description="URL of medium sized image of original image", - * maxLength=255 + * description="URL of medium sized image of original image", + * maxLength=255 * ), * @OA\Property( * property="thumbnailUrl", * type="string", - * description="URL of thumbnail representation original media file", - * maxLength=255 + * description="URL of thumbnail representation original media file", + * maxLength=255 * ), * @OA\Property( * property="archiveUrl", * type="string", - * description="URL of archival media file (e.g. DNG, TIFF, etc), if publicly web accessible", - * maxLength=255 + * description="URL of archival media file (e.g. DNG, TIFF, etc), if publicly web accessible", + * maxLength=255 * ), * @OA\Property( * property="referenceUrl", * type="string", - * description="URL of a web representation of media file. Maybe consist of html wrapper, viewer, player, etc", - * maxLength=255 + * description="URL of a web representation of media file. Maybe consist of html wrapper, viewer, player, etc", + * maxLength=255 * ), * @OA\Property( * property="occid", * type="integer", - * description="Primary Key of occurrence record that media object is associated with. Should be left null if record is not associated with an occurrence.", + * description="Primary Key of occurrence record that media object is associated with. Should be left null if record is not associated with an occurrence.", * ), * @OA\Property( * property="tid", * type="integer", - * description="Primary Key of taxon record (e.g. scientific name reference) associated with media object. Should be left NULL if record is associated with an occurrence, since media will inherit occurrence identification. Required if media is not associated with an occurrence record (e.g. field image)", + * description="Primary Key of taxon record (e.g. scientific name reference) associated with media object. Should be left NULL if record is associated with an occurrence, since media will inherit occurrence identification. Required if media is not associated with an occurrence record (e.g. field image)", * ), * @OA\Property( * property="photographer", * type="string", - * description="Verbatim name of author/photographer media object. Leave NULL if photographerUid is supplied", - * maxLength=100 + * description="Verbatim name of author/photographer media object. Leave NULL if photographerUid is supplied", + * maxLength=100 * ), * @OA\Property( * property="photographerUid", * type="integer", - * description="User Primary Key of photographer, who must have a user account register in the portal", + * description="User Primary Key of photographer, who must have a user account register in the portal", * ), * @OA\Property( * property="imageType", * type="string", - * description="Term name of image type (e.g. stillImage)", - * maxLength=45 + * description="Term name of image type (e.g. stillImage)", + * maxLength=45 * ), * @OA\Property( * property="caption", * type="string", - * description="Consist, free-form text describing content of media object", - * maxLength=100 + * description="Consist, free-form text describing content of media object", + * maxLength=100 * ), * @OA\Property( * property="copyright", * type="string", - * description="Copyright Owner", - * maxLength=255 + * description="Copyright Owner", + * maxLength=255 * ), * @OA\Property( * property="rights", * type="string", - * description="A URI pointing to structured information about rights held in and over the resource (e.g. https://creativecommons.org/publicdomain/zero/1.0/, https://creativecommons.org/licenses/by/4.0/legalcode)", - * maxLength=255 + * description="A URI pointing to structured information about rights held in and over the resource (e.g. https://creativecommons.org/publicdomain/zero/1.0/, https://creativecommons.org/licenses/by/4.0/legalcode)", + * maxLength=255 * ), * @OA\Property( * property="accessRights", * type="string", - * description="Information about who can access the resource or an indication of its security status", - * maxLength=255 + * description="Information about who can access the resource or an indication of its security status", + * maxLength=255 * ), * @OA\Property( * property="locality", * type="string", - * description="Short description of locality. Leave null if locality is available via the occurrence record", - * maxLength=250 + * description="Short description of locality. Leave null if locality is available via the occurrence record", + * maxLength=250 * ), * @OA\Property( * property="notes", * type="string", - * description="General notes", - * maxLength=350 + * description="General notes", + * maxLength=350 * ), * @OA\Property( * property="sourceIdentifier", * type="string", - * description="The source identifier, if media was harvested from an external resource", - * maxLength=150 + * description="The source identifier, if media was harvested from an external resource", + * maxLength=150 * ), * @OA\Property( * property="hashFunction", * type="string", - * description="Cryptographic hash function used to compute the value given in the Hash Value", - * maxLength=45 + * description="Cryptographic hash function used to compute the value given in the Hash Value", + * maxLength=45 * ), * @OA\Property( * property="hashValue", * type="string", - * description="Value computed by a hash function applied to the media that will be delivered at the access point", - * maxLength=45 + * description="Value computed by a hash function applied to the media that will be delivered at the access point", + * maxLength=45 * ), * @OA\Property( * property="sortSequence", * type="integer", - * description="Media sort control within the taxon profile page" + * description="Media sort control within the taxon profile page" * ), * @OA\Property( * property="sortOccurrence", * type="integer", - * description="Media sort control within the occurrence profile page" + * description="Media sort control within the occurrence profile page" * ), * ), - * ) - * ), - * @OA\Response( - * response="201", - * description="Returns JSON object of the of media record that was created" - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request.", - * ), - * @OA\Response( - * response="401", - * description="Unauthorized", - * ), - * ) - */ - public function insert(Request $request){ - if($user = $this->authenticate($request)){ - $this->validate($request, $this->rulesInsert); - $inputArr = $request->all(); - $this->adjustInputData($inputArr); - $inputArr['recordID'] = (string) Str::uuid(); - if(!isset($inputArr['format'])){ - $mimeType = $this->getMimeType($inputArr['originalUrl']); - if($mimeType && strpos($mimeType, 'text/html') === false){ - $inputArr['format'] = $mimeType; - } - else{ - return response()->json(['error' => 'format field required; unable to determine mime type dynamically'], 401); - } - } - $media = Media::create($inputArr); - return response()->json($media, 201); - } - return response()->json(['error' => 'Unauthorized'], 401); - } + * ) + * ), + * + * @OA\Response( + * response="201", + * description="Returns JSON object of the of media record that was created" + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request.", + * ), + * @OA\Response( + * response="401", + * description="Unauthorized", + * ), + * ) + */ + public function insert(Request $request) { + if ($user = $this->authenticate($request)) { + $this->validate($request, $this->rulesInsert); + $inputArr = $request->all(); + $this->adjustInputData($inputArr); + $inputArr['recordID'] = (string) Str::uuid(); + if (! isset($inputArr['format'])) { + $mimeType = $this->getMimeType($inputArr['originalUrl']); + if ($mimeType && strpos($mimeType, 'text/html') === false) { + $inputArr['format'] = $mimeType; + } else { + return response()->json(['error' => 'format field required; unable to determine mime type dynamically'], 401); + } + } + $media = Media::create($inputArr); - /** - * @OA\Patch( - * path="/api/v2/media/{identifier}", - * operationId="updateMedia", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="primary key or record GUID (UUID) associated with target media object", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="apiToken", - * in="query", - * description="API security token to authenticate post action", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\RequestBody( - * required=true, - * description="Media object to be updated", + return response()->json($media, 201); + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + /** + * @OA\Patch( + * path="/api/v2/media/{identifier}", + * operationId="updateMedia", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="primary key or record GUID (UUID) associated with target media object", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="apiToken", + * in="query", + * description="API security token to authenticate post action", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\RequestBody( + * required=true, + * description="Media object to be updated", + * * @OA\MediaType( * mediaType="application/json", + * * @OA\Schema( + * * @OA\Property( * property="format", * type="string", - * description="Media Type (MIME type)", - * maxLength=45, - * enum={"image/jpeg", "image/png", "image/tiff", "audio/wav"} + * description="Media Type (MIME type)", + * maxLength=45, + * enum={"image/jpeg", "image/png", "image/tiff", "audio/wav"} * ), * @OA\Property( * property="originalUrl", * type="string", - * description="URL of original media file; images should be a web-ready JPG", - * maxLength=255 + * description="URL of original media file; images should be a web-ready JPG", + * maxLength=255 * ), * @OA\Property( * property="mediumUrl", * type="string", - * description="URL of medium sized image of original image", - * maxLength=255 + * description="URL of medium sized image of original image", + * maxLength=255 * ), * @OA\Property( * property="thumbnailUrl", * type="string", - * description="URL of thumbnail representation original media file", - * maxLength=255 + * description="URL of thumbnail representation original media file", + * maxLength=255 * ), * @OA\Property( * property="archiveUrl", * type="string", - * description="URL of archival media file (e.g. DNG, TIFF, etc), if publicly web accessible", - * maxLength=255 + * description="URL of archival media file (e.g. DNG, TIFF, etc), if publicly web accessible", + * maxLength=255 * ), * @OA\Property( * property="referenceUrl", * type="string", - * description="URL of a web representation of media file. Maybe consist of html wrapper, viewer, player, etc", - * maxLength=255 + * description="URL of a web representation of media file. Maybe consist of html wrapper, viewer, player, etc", + * maxLength=255 * ), * @OA\Property( * property="occid", * type="integer", - * description="Primary Key of occurrence record that media object is associated with. Should be left null if record is not associated with an occurrence.", + * description="Primary Key of occurrence record that media object is associated with. Should be left null if record is not associated with an occurrence.", * ), * @OA\Property( * property="tid", * type="integer", - * description="Primary Key of taxon record (e.g. scientific name reference) associated with media object. Should be left NULL if record is associated with an occurrence, since media will inherit occurrence identification. Required if media is not associated with an occurrence record (e.g. field image)", + * description="Primary Key of taxon record (e.g. scientific name reference) associated with media object. Should be left NULL if record is associated with an occurrence, since media will inherit occurrence identification. Required if media is not associated with an occurrence record (e.g. field image)", * ), * @OA\Property( * property="photographer", * type="string", - * description="Verbatim name of author/photographer media object. Leave NULL if photographerUid is supplied", - * maxLength=100 + * description="Verbatim name of author/photographer media object. Leave NULL if photographerUid is supplied", + * maxLength=100 * ), * @OA\Property( * property="photographerUid", * type="integer", - * description="User Primary Key of photographer, who must have a user account register in the portal", + * description="User Primary Key of photographer, who must have a user account register in the portal", * ), * @OA\Property( * property="imageType", * type="string", - * description="Term name of image type (e.g. stillImage)", - * maxLength=45 + * description="Term name of image type (e.g. stillImage)", + * maxLength=45 * ), * @OA\Property( * property="caption", * type="string", - * description="Consist, free-form text describing content of media object", - * maxLength=100 + * description="Consist, free-form text describing content of media object", + * maxLength=100 * ), * @OA\Property( * property="copyright", * type="string", - * description="Copyright Owner", - * maxLength=255 + * description="Copyright Owner", + * maxLength=255 * ), * @OA\Property( * property="rights", * type="string", - * description="A URI pointing to structured information about rights held in and over the resource (e.g. https://creativecommons.org/publicdomain/zero/1.0/, https://creativecommons.org/licenses/by/4.0/legalcode)", - * maxLength=255 + * description="A URI pointing to structured information about rights held in and over the resource (e.g. https://creativecommons.org/publicdomain/zero/1.0/, https://creativecommons.org/licenses/by/4.0/legalcode)", + * maxLength=255 * ), * @OA\Property( * property="accessRights", * type="string", - * description="Information about who can access the resource or an indication of its security status", - * maxLength=255 + * description="Information about who can access the resource or an indication of its security status", + * maxLength=255 * ), * @OA\Property( * property="locality", * type="string", - * description="Short description of locality. Leave null if locality is available via the occurrence record", - * maxLength=250 + * description="Short description of locality. Leave null if locality is available via the occurrence record", + * maxLength=250 * ), * @OA\Property( * property="notes", * type="string", - * description="General notes", - * maxLength=350 + * description="General notes", + * maxLength=350 * ), * @OA\Property( * property="sourceIdentifier", * type="string", - * description="The source identifier, if media was harvested from an external resource", - * maxLength=150 + * description="The source identifier, if media was harvested from an external resource", + * maxLength=150 * ), * @OA\Property( * property="hashFunction", * type="string", - * description="Cryptographic hash function used to compute the value given in the Hash Value", - * maxLength=45 + * description="Cryptographic hash function used to compute the value given in the Hash Value", + * maxLength=45 * ), * @OA\Property( * property="hashValue", * type="string", - * description="Value computed by a hash function applied to the media that will be delivered at the access point", - * maxLength=45 + * description="Value computed by a hash function applied to the media that will be delivered at the access point", + * maxLength=45 * ), * @OA\Property( * property="sortSequence", * type="integer", - * description="Media sort control within the taxon profile page" + * description="Media sort control within the taxon profile page" * ), * @OA\Property( * property="sortOccurrence", * type="integer", - * description="Media sort control within the occurrence profile page" + * description="Media sort control within the occurrence profile page" * ), * ), - * ) - * ), - * @OA\Response( - * response="200", - * description="Returns full JSON object of the of media record that was edited" - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request.", - * ), - * @OA\Response( - * response="401", - * description="Unauthorized", - * ), - * ) - */ - public function update($id, Request $request){ - if($user = $this->authenticate($request)){ - $media = Media::find($this->getImgid($id)); - if(!$media){ - return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); - } - $this->validate($request, $this->rulesUpdate); - $inputArr = $request->all(); - $this->adjustInputData($inputArr); - $media->update($inputArr); - return response()->json($media, 200); - } - return response()->json(['error' => 'Unauthorized'], 401); - } + * ) + * ), + * + * @OA\Response( + * response="200", + * description="Returns full JSON object of the of media record that was edited" + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request.", + * ), + * @OA\Response( + * response="401", + * description="Unauthorized", + * ), + * ) + */ + public function update($id, Request $request) { + if ($user = $this->authenticate($request)) { + $media = Media::find($this->getImgid($id)); + if (! $media) { + return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); + } + $this->validate($request, $this->rulesUpdate); + $inputArr = $request->all(); + $this->adjustInputData($inputArr); + $media->update($inputArr); + + return response()->json($media, 200); + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + /** + * @OA\Delete( + * path="/api/v2/media/{identifier}", + * operationId="deleteMedia", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="primary key or record GUID (UUID) associated with target media object", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="apiToken", + * in="query", + * description="API security token to authenticate post action", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="204", + * description="Record deleted successfully" + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. Media identifier is required.", + * ), + * @OA\Response( + * response="401", + * description="Unauthorized", + * ), + * ) + */ + public function delete($id, Request $request) { + if ($user = $this->authenticate($request)) { + $media = Media::find($this->getImgid($id)); + if (! $media) { + return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); + } + $media->delete(); + + return response('', 200); + } + + return response()->json(['status' => 'failure', 'error' => 'Unauthorized'], 401); + } + + private function adjustInputData(&$data) { + if (! empty($data['mediumUrl'])) { + //remap mediumUrl to url field + $data['url'] = $data['mediumUrl']; + unset($data['mediumUrl']); + } + } - /** - * @OA\Delete( - * path="/api/v2/media/{identifier}", - * operationId="deleteMedia", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="primary key or record GUID (UUID) associated with target media object", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="apiToken", - * in="query", - * description="API security token to authenticate post action", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="204", - * description="Record deleted successfully" - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Media identifier is required.", - * ), - * @OA\Response( - * response="401", - * description="Unauthorized", - * ), - * ) - */ - public function delete($id, Request $request){ - if($user = $this->authenticate($request)){ - $media = Media::find($this->getImgid($id)); - if(!$media){ - return response()->json(['status' => 'failure', 'error' => 'Media resource not found'], 400); - } - $media->delete(); - return response('', 200); - } - return response()->json(['status' => 'failure', 'error' => 'Unauthorized'], 401); - } + private function getImgid($id) { + if (! is_numeric($id)) { + $imgId = Media::where('recordID', $id)->value('imgid'); + if (is_numeric($imgId)) { + $id = $imgId; + } + } - private function adjustInputData(&$data){ - if(!empty($data['mediumUrl'])){ - //remap mediumUrl to url field - $data['url'] = $data['mediumUrl']; - unset($data['mediumUrl']); - } - } + return $id; + } - private function getImgid($id){ - if(!is_numeric($id)){ - $imgId = Media::where('recordID', $id)->value('imgid'); - if(is_numeric($imgId)) $id = $imgId; - } - return $id; - } + private function getMimeType($url) { + $mimeType = ''; + $headerArr = get_headers($url); + foreach ($headerArr as $value) { + if (preg_match('/Content-Type: (.*)/', $value, $m)) { + $mimeType = $m[1]; + } + } - private function getMimeType($url){ - $mimeType = ''; - $headerArr = get_headers($url); - foreach($headerArr as $value){ - if(preg_match('/Content-Type: (.*)/', $value, $m)){ - $mimeType = $m[1]; - } - } - return $mimeType; - } + return $mimeType; + } } diff --git a/app/Http/Controllers/MorphologyController.php b/app/Http/Controllers/MorphologyController.php index 394d23f..440a359 100644 --- a/app/Http/Controllers/MorphologyController.php +++ b/app/Http/Controllers/MorphologyController.php @@ -1,47 +1,52 @@ validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); - - $fullCnt = PortalIndex::count(); - $result = PortalIndex::skip($offset)->take($limit)->get(); - - $eor = false; - $retObj = [ - "offset" => (int)$offset, - "limit" => (int)$limit, - "endOfRecords" => $eor, - "count" => $fullCnt, - "results" => $result - ]; - return response()->json($retObj); - } - - public function showOneCharacter($id, Request $request){ - $portalObj = null; - if(is_numeric($id)) $portalObj = PortalIndex::find($id); - else $portalObj = PortalIndex::where('guid',$id)->first(); - if(!$portalObj->count()) $portalObj = ["status"=>false,"error"=>"Unable to locate installation based on identifier"]; - return response()->json($portalObj); - } - -} \ No newline at end of file +class MorphologyController extends Controller { + /** + * Taxon Morphology controller instance. + * + * @return void + */ + public function __construct() {} + + public function showAllCharacters(Request $request) { + $this->validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $fullCnt = PortalIndex::count(); + $result = PortalIndex::skip($offset)->take($limit)->get(); + + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + + return response()->json($retObj); + } + + public function showOneCharacter($id, Request $request) { + $portalObj = null; + if (is_numeric($id)) { + $portalObj = PortalIndex::find($id); + } else { + $portalObj = PortalIndex::where('guid', $id)->first(); + } + if (! $portalObj->count()) { + $portalObj = ['status' => false, 'error' => 'Unable to locate installation based on identifier']; + } + + return response()->json($portalObj); + } +} diff --git a/app/Http/Controllers/OccurrenceAnnotationController.php b/app/Http/Controllers/OccurrenceAnnotationController.php index d543cce..a51f054 100644 --- a/app/Http/Controllers/OccurrenceAnnotationController.php +++ b/app/Http/Controllers/OccurrenceAnnotationController.php @@ -4,232 +4,257 @@ use App\Models\Occurrence; use Illuminate\Http\Request; -use Illuminate\Validation\Rule; use Illuminate\Support\Facades\DB; +use Illuminate\Validation\Rule; + +class OccurrenceAnnotationController extends OccurrenceController { + /** + * Occurrence Annotation controller instance. + * + * @return void + */ + public function __construct() {} + + /** + * @OA\Get( + * path="/api/v2/occurrence/annotation/search", + * operationId="/api/v2/occurrence/annotation/search", + * tags={""}, + * + * @OA\Parameter( + * name="collid", + * in="query", + * description="Internal identifier (PK) for collection", + * required=true, + * + * @OA\Schema(type="integer") + * ), + * + * @OA\Parameter( + * name="type", + * in="query", + * description="Annoration type (internal, external) ", + * required=true, + * + * @OA\Schema(type="string", default="internal", enum = {"internal", "external"}) + * ), + * + * @OA\Parameter( + * name="source", + * in="query", + * description="External source of Annoration (e.g. geolocate) ", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="fieldName", + * in="query", + * description="Name of occurrence field that was annotated (e.g. recordedBy, eventDate) ", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="fromDate", + * in="query", + * description="The start date of a date range the annotation was created (e.g. 2022-02-05) ", + * required=false, + * + * @OA\Schema(type="date") + * ), + * + * @OA\Parameter( + * name="toDate", + * in="query", + * description="The end date of a date range the annotation was created (e.g. 2022-02-05) ", + * required=false, + * + * @OA\Schema(type="date") + * ), + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Controls the number of results per page", + * required=false, + * + * @OA\Schema(type="integer", default=500) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of occurrence edits", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showAllAnnotations(Request $request) { + $this->validate($request, [ + 'collid' => ['required', 'integer'], + 'type' => [Rule::in(['internal', 'external'])], + 'source' => 'alpha', + 'fieldName' => 'alpha', + 'fromDate' => 'date', + 'toDate' => 'date', + 'limit' => ['integer', 'max:500'], + 'offset' => 'integer', + ]); + $collid = $request->input('collid'); + $type = $request->input('type', 'internal'); + $source = $request->input('source'); + $fieldName = $request->input('fieldName'); + $fromDate = $request->input('fromDate'); + $toDate = $request->input('toDate'); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $annotation = null; + $fullCnt = 0; + $result = null; + if ($type == 'internal') { + $annotation = DB::table('omoccuredits as e')->select('e.*', 'o.occurrenceID') + ->join('omoccurrences as o', 'e.occid', '=', 'o.occid') + ->where('o.collid', $collid); + if ($fieldName) { + $annotation = $annotation->where('e.fieldname', $fieldName); + } + if ($fromDate) { + $annotation = $annotation->where('e.initialTimestamp', '>', $fromDate); + } + if ($toDate) { + $annotation = $annotation->where('e.initialTimestamp', '<', $toDate); + } + $fullCnt = $annotation->count(); + $result = $annotation->skip($offset)->take($limit)->get(); + $result = $this->formatInternalResults($result); + } elseif ($type == 'external') { + $annotation = DB::table('omoccurrevisions as r')->select('r.*', 'o.occurrenceID') + ->join('omoccurrences as o', 'o.occid', '=', 'r.occid') + ->where('o.collid', $collid); + if ($source) { + $annotation = $annotation->where('r.externalSource', $source); + } + if ($fieldName) { + $annotation = $annotation->where('r.oldvalues', 'like', '%' . $fieldName . '%'); + } + if ($fromDate) { + $annotation = $annotation->where('r.initialTimestamp', '>', $fromDate); + } + if ($toDate) { + $annotation = $annotation->where('r.initialTimestamp', '<', $toDate); + } + $fullCnt = $annotation->count(); + $result = $annotation->skip($offset)->take($limit)->get(); + $result = $this->formatExternalResults($result, $fieldName); + } -class OccurrenceAnnotationController extends OccurrenceController{ - /** - * Occurrence Annotation controller instance. - * - * @return void - */ - public function __construct(){ - } + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - /** - * @OA\Get( - * path="/api/v2/occurrence/annotation/search", - * operationId="/api/v2/occurrence/annotation/search", - * tags={""}, - * @OA\Parameter( - * name="collid", - * in="query", - * description="Internal identifier (PK) for collection", - * required=true, - * @OA\Schema(type="integer") - * ), - * @OA\Parameter( - * name="type", - * in="query", - * description="Annoration type (internal, external) ", - * required=true, - * @OA\Schema(type="string", default="internal", enum = {"internal", "external"}) - * ), - * @OA\Parameter( - * name="source", - * in="query", - * description="External source of Annoration (e.g. geolocate) ", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="fieldName", - * in="query", - * description="Name of occurrence field that was annotated (e.g. recordedBy, eventDate) ", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="fromDate", - * in="query", - * description="The start date of a date range the annotation was created (e.g. 2022-02-05) ", - * required=false, - * @OA\Schema(type="date") - * ), - * @OA\Parameter( - * name="toDate", - * in="query", - * description="The end date of a date range the annotation was created (e.g. 2022-02-05) ", - * required=false, - * @OA\Schema(type="date") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results per page", - * required=false, - * @OA\Schema(type="integer", default=500) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of occurrence edits", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllAnnotations(Request $request){ - $this->validate($request, [ - 'collid' => ['required', 'integer'], - 'type' => [Rule::in(['internal', 'external'])], - 'source' => 'alpha', - 'fieldName' => 'alpha', - 'fromDate' => 'date', - 'toDate' => 'date', - 'limit' => ['integer', 'max:500'], - 'offset' => 'integer' - ]); - $collid = $request->input('collid'); - $type = $request->input('type', 'internal'); - $source = $request->input('source'); - $fieldName = $request->input('fieldName'); - $fromDate = $request->input('fromDate'); - $toDate = $request->input('toDate'); - $limit = $request->input('limit', 100); - $offset = $request->input('offset', 0); + return response()->json($retObj); + } - $annotation = null; - $fullCnt = 0; - $result = null; - if($type == 'internal'){ - $annotation = DB::table('omoccuredits as e')->select('e.*', 'o.occurrenceID') - ->join('omoccurrences as o', 'e.occid', '=', 'o.occid') - ->where('o.collid', $collid); - if($fieldName){ - $annotation = $annotation->where('e.fieldname', $fieldName); - } - if($fromDate){ - $annotation = $annotation->where('e.initialTimestamp', '>', $fromDate); - } - if($toDate){ - $annotation = $annotation->where('e.initialTimestamp', '<', $toDate); - } - $fullCnt = $annotation->count(); - $result = $annotation->skip($offset)->take($limit)->get(); - $result = $this->formatInternalResults($result); - } - elseif($type == 'external'){ - $annotation = DB::table('omoccurrevisions as r')->select('r.*', 'o.occurrenceID') - ->join('omoccurrences as o', 'o.occid', '=', 'r.occid') - ->where('o.collid', $collid); - if($source){ - $annotation = $annotation->where('r.externalSource', $source); - } - if($fieldName){ - $annotation = $annotation->where('r.oldvalues', 'like', '%'.$fieldName.'%'); - } - if($fromDate){ - $annotation = $annotation->where('r.initialTimestamp', '>', $fromDate); - } - if($toDate){ - $annotation = $annotation->where('r.initialTimestamp', '<', $toDate); - } - $fullCnt = $annotation->count(); - $result = $annotation->skip($offset)->take($limit)->get(); - $result = $this->formatExternalResults($result, $fieldName); - } + public function showOccurrenceAnnotations($id, Request $request) { + $this->validate($request, [ + 'type' => [Rule::in(['internal', 'external'])], + ]); + $type = $request->input('type', 'internal'); - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + $id = $this->getOccid($id); + $annotation = null; + if ($type == 'internal') { + $annotation = Occurrence::find($id)->annotationInternal; + } elseif ($type == 'external') { + $annotation = Occurrence::find($id)->annotationExternal; + } - public function showOccurrenceAnnotations($id, Request $request){ - $this->validate($request, [ - 'type' => [Rule::in(['internal', 'external'])] - ]); - $type = $request->input('type', 'internal'); + return response()->json($annotation); + } - $id = $this->getOccid($id); - $annotation = null; - if($type == 'internal'){ - $annotation = Occurrence::find($id)->annotationInternal; - } - elseif($type == 'external'){ - $annotation = Occurrence::find($id)->annotationExternal; - } + //Helper funcitons + private function formatExternalResults($resultObj, $fieldLimit) { + $retArr = []; + foreach ($resultObj as $unitKey => $unitObj) { + $unitArr = (array) $unitObj; + $unitArr = array_change_key_case($unitArr); + if (isset($unitArr['oldvalues'])) { + $newArr1 = []; + $newArr2 = []; + $newArr1['annotationID'] = $unitArr['orid']; + $newArr1['occid'] = $unitArr['occid']; + if ($unitArr['occurrenceid']) { + $newArr1['occurrenceID'] = $unitArr['occurrenceid']; + } else { + $newArr1['occurrenceID'] = $unitArr['recordid']; + } + $newArr2['externalSource'] = $unitArr['externalsource']; + $newArr2['externalEditor'] = $unitArr['externaleditor']; + $newArr2['reviewStatus'] = $unitArr['reviewstatus']; + $newArr2['appliedStatus'] = $unitArr['appliedstatus']; + $newArr2['recordID'] = $unitArr['guid']; + $newArr2['externalError'] = $unitArr['errormessage']; + $newArr2['externalTimestamp'] = $unitArr['externaltimestamp']; + $newArr2['recordTimestamp'] = $unitArr['initialtimestamp']; + $oldValueArr = json_decode($unitArr['oldvalues'], true); + $newValueArr = json_decode($unitArr['newvalues'], true); + foreach ($oldValueArr as $fieldName => $oldValue) { + if (! $fieldLimit || $fieldLimit == $fieldName) { + if (array_key_exists($fieldName, $newValueArr)) { + $retArr[] = array_merge($newArr1, ['fieldName' => $fieldName, 'oldValue' => $oldValue, 'newValue' => $newValueArr[$fieldName]], $newArr2); + } + } + } + } + } - return response()->json($annotation); - } + return $retArr; + } - //Helper funcitons - private function formatExternalResults($resultObj, $fieldLimit){ - $retArr = array(); - foreach($resultObj as $unitKey => $unitObj){ - $unitArr = (array)$unitObj; - $unitArr = array_change_key_case($unitArr); - if(isset($unitArr['oldvalues'])){ - $newArr1 = array(); - $newArr2 = array(); - $newArr1['annotationID'] = $unitArr['orid']; - $newArr1['occid'] = $unitArr['occid']; - if($unitArr['occurrenceid']) $newArr1['occurrenceID'] = $unitArr['occurrenceid']; - else $newArr1['occurrenceID'] = $unitArr['recordid']; - $newArr2['externalSource'] = $unitArr['externalsource']; - $newArr2['externalEditor'] = $unitArr['externaleditor']; - $newArr2['reviewStatus'] = $unitArr['reviewstatus']; - $newArr2['appliedStatus'] = $unitArr['appliedstatus']; - $newArr2['recordID'] = $unitArr['guid']; - $newArr2['externalError'] = $unitArr['errormessage']; - $newArr2['externalTimestamp'] = $unitArr['externaltimestamp']; - $newArr2['recordTimestamp'] = $unitArr['initialtimestamp']; - $oldValueArr = json_decode($unitArr['oldvalues'], true); - $newValueArr = json_decode($unitArr['newvalues'], true); - foreach($oldValueArr as $fieldName => $oldValue){ - if(!$fieldLimit || $fieldLimit == $fieldName){ - if(array_key_exists($fieldName, $newValueArr)){ - $retArr[] = array_merge($newArr1, array('fieldName' => $fieldName, 'oldValue' => $oldValue, 'newValue' => $newValueArr[$fieldName]), $newArr2); - } - } - } - } - } - return $retArr; - } + private function formatInternalResults($resultObj) { + $retArr = []; + foreach ($resultObj as $unitKey => $unitObj) { + $unitArr = (array) $unitObj; + $unitArr = array_change_key_case($unitArr); + $retArr[$unitKey]['annotationID'] = $unitArr['ocedid']; + $retArr[$unitKey]['occid'] = $unitArr['occid']; + if ($unitArr['occurrenceid']) { + $retArr[$unitKey]['occurrenceID'] = $unitArr['occurrenceid']; + } else { + $retArr[$unitKey]['occurrenceID'] = $unitArr['recordid']; + } + $retArr[$unitKey]['fieldName'] = $unitArr['fieldname']; + $retArr[$unitKey]['newValue'] = $unitArr['fieldvaluenew']; + $retArr[$unitKey]['oldValue'] = $unitArr['fieldvalueold']; + $retArr[$unitKey]['reviewStatus'] = $unitArr['reviewstatus']; + $retArr[$unitKey]['appliedStatus'] = $unitArr['appliedstatus']; + $retArr[$unitKey]['recordID'] = $unitArr['guid']; + $retArr[$unitKey]['recordTimestamp'] = $unitArr['initialtimestamp']; + } - private function formatInternalResults($resultObj){ - $retArr = array(); - foreach($resultObj as $unitKey => $unitObj){ - $unitArr = (array)$unitObj; - $unitArr = array_change_key_case($unitArr); - $retArr[$unitKey]['annotationID'] = $unitArr['ocedid']; - $retArr[$unitKey]['occid'] = $unitArr['occid']; - if($unitArr['occurrenceid']) $retArr[$unitKey]['occurrenceID'] = $unitArr['occurrenceid']; - else $retArr[$unitKey]['occurrenceID'] = $unitArr['recordid']; - $retArr[$unitKey]['fieldName'] = $unitArr['fieldname']; - $retArr[$unitKey]['newValue'] = $unitArr['fieldvaluenew']; - $retArr[$unitKey]['oldValue'] = $unitArr['fieldvalueold']; - $retArr[$unitKey]['reviewStatus'] = $unitArr['reviewstatus']; - $retArr[$unitKey]['appliedStatus'] = $unitArr['appliedstatus']; - $retArr[$unitKey]['recordID'] = $unitArr['guid']; - $retArr[$unitKey]['recordTimestamp'] = $unitArr['initialtimestamp']; - } - return $retArr; - } + return $retArr; + } } diff --git a/app/Http/Controllers/OccurrenceController.php b/app/Http/Controllers/OccurrenceController.php index 351da74..e6c7594 100644 --- a/app/Http/Controllers/OccurrenceController.php +++ b/app/Http/Controllers/OccurrenceController.php @@ -2,725 +2,823 @@ namespace App\Http\Controllers; +use App\Helpers\OccurrenceHelper; use App\Models\Occurrence; use App\Models\PortalIndex; use App\Models\PortalOccurrence; -use App\Helpers\OccurrenceHelper; use Illuminate\Http\Request; use Illuminate\Support\Str; -use Illuminate\Support\Facades\DB; - -class OccurrenceController extends Controller{ - - /** - * Occurrence controller instance. - * - * @return void - */ - public function __construct(){ - } - - /** - * @OA\Get( - * path="/api/v2/occurrence/search", - * operationId="/api/v2/occurrence/search", - * tags={""}, - * @OA\Parameter( - * name="collid", - * in="query", - * description="collid(s) - collection identifier(s) in portal", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="catalogNumber", - * in="query", - * description="catalogNumber", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="occurrenceID", - * in="query", - * description="occurrenceID", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="family", - * in="query", - * description="family", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="sciname", - * in="query", - * description="Scientific Name - binomen only without authorship", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="recordedBy", - * in="query", - * description="Collector/observer of occurrence", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="recordedByLastName", - * in="query", - * description="Last name of collector/observer of occurrence", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="recordNumber", - * in="query", - * description="Personal number of the collector or observer of the occurrence", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="eventDate", - * in="query", - * description="Date as YYYY, YYYY-MM or YYYY-MM-DD", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="country", - * in="query", - * description="country", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="stateProvince", - * in="query", - * description="State, Province, or second level political unit", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="county", - * in="query", - * description="County, parish, or third level political unit", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="datasetID", - * in="query", - * description="dataset ID within portal", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results per page", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of occurrences", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllOccurrences(Request $request){ - $this->validate($request, [ - 'collid' => 'regex:/^[\d,]+?$/', - 'limit' => ['integer', 'max:300'], - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); - - $occurrenceModel = Occurrence::query(); - if($request->has('collid')){ - $occurrenceModel->whereIn('collid', explode(',', $request->collid)); - } - if($request->has('catalogNumber')){ - $occurrenceModel->where('catalogNumber', $request->catalogNumber); - } - if($request->has('occurrenceID')){ - //$occurrenceModel->where('occurrenceID', $request->occurrenceID); - $occurrenceID = $request->occurrenceID; - $occurrenceModel->where(function ($query) use ($occurrenceID) {$query->where('occurrenceID', $occurrenceID)->orWhere('recordID', $occurrenceID);}); - - } - //Taxonomy - if($request->has('family')){ - $occurrenceModel->where('family', $request->family); - } - if($request->has('sciname')){ - $occurrenceModel->where('sciname', $request->sciname); - } - //Collector units - if($request->has('recordedBy')){ - $occurrenceModel->where('recordedBy', $request->recordedBy); - } - if($request->has('recordedByLastName')){ - $occurrenceModel->where('recordedBy', 'LIKE', '%' . $request->recordedByLastName . '%'); - } - if($request->has('recordNumber')){ - $occurrenceModel->where('recordNumber', $request->recordNumber); - } - if($request->has('eventDate')){ - $occurrenceModel->where('eventDate', $request->eventDate); - } - if($request->has('datasetID')){ - $occurrenceModel->where('datasetID', $request->datasetID); - } - //Locality place names - if($request->has('country')){ - $occurrenceModel->where('country', $request->country); - } - if($request->has('stateProvince')){ - $occurrenceModel->where('stateProvince', $request->stateProvince); - } - if($request->has('county')){ - $occurrenceModel->where('county', $request->county); - } - - $fullCnt = $occurrenceModel->count(); - $result = $occurrenceModel->skip($offset)->take($limit)->get(); - - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } - - /** - * @OA\Get( - * path="/api/v2/occurrence/{identifier}", - * operationId="/api/v2/occurrence/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="occid or specimen GUID (occurrenceID) associated with target occurrence", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="includeMedia", - * in="query", - * description="Whether to include media within output", - * required=false, - * @OA\Schema(type="integer") - * ), - * @OA\Parameter( - * name="includeIdentifications", - * in="query", - * description="Whether to include full Identification History within output", - * required=false, - * @OA\Schema(type="integer") - * ), - * @OA\Response( - * response="200", - * description="Returns single occurrence record", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Occurrence identifier is required.", - * ), - * ) - */ - public function showOneOccurrence($id, Request $request){ - $this->validate($request, [ - 'includeMedia' => 'integer', - 'includeIdentifications' => 'integer' - ]); - $id = $this->getOccid($id); - $occurrence = Occurrence::find($id); - if($occurrence){ - if(!$occurrence->occurrenceID) $occurrence->occurrenceID = $occurrence->recordID; - if($request->input('includeMedia')) $occurrence->media; - if($request->input('includeIdentifications')) $occurrence->identification; - } - return response()->json($occurrence); - } - - - /** - * @OA\Get( - * path="/api/v2/occurrence/{identifier}/identification", - * operationId="/api/v2/occurrence/identifier/identification", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="occid or specimen GUID (occurrenceID) associated with target occurrence", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns identification records associated with a given occurrence record", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Occurrence identifier is required.", - * ), - * ) - */ - public function showOneOccurrenceIdentifications($id, Request $request){ - $id = $this->getOccid($id); - $identification = Occurrence::find($id)->identification; - return response()->json($identification); - } - - /** - * @OA\Get( - * path="/api/v2/occurrence/{identifier}/media", - * operationId="/api/v2/occurrence/identifier/media", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="occid or specimen GUID (occurrenceID) associated with target occurrence", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns media records associated with a given occurrence record", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Occurrence identifier is required.", - * ), - * ) - */ - public function showOneOccurrenceMedia($id, Request $request){ - $id = $this->getOccid($id); - $media = Occurrence::find($id)->media; - return response()->json($media); - } - - //Write funcitons - public function insert(Request $request){ - if($user = $this->authenticate($request)){ - $this->validate($request, [ - 'collid' => 'required|integer' - ]); - $collid = $request->input('collid'); - //Check to see if user has the necessary permission edit/add occurrences for target collection - if(!$this->isAuthorized($user, $collid)){ - return response()->json(['error' => 'Unauthorized to add new records to target collection (collid = ' . $collid . ')'], 401); - } - $inputArr = $request->all(); - $inputArr['recordID'] = (string) Str::uuid(); - $inputArr['dateEntered'] = date('Y-m-d H:i:s'); - - //$occurrence = Occurrence::create($inputArr); - //return response()->json($occurrence, 201); - } - return response()->json(['error' => 'Unauthorized'], 401); - } - - public function update($id, Request $request){ - if($user = $this->authenticate($request)){ - $id = $this->getOccid($id); - $occurrence = Occurrence::find($id); - if(!$occurrence){ - return response()->json(['status' => 'failure', 'error' => 'Occurrence resource not found'], 400); - } - if(!$this->isAuthorized($user, $occurrence['collid'])){ - return response()->json(['error' => 'Unauthorized to edit target collection (collid = ' . $occurrence['collid'] . ')'], 401); - } - //$occurrence->update($request->all()); - //return response()->json($occurrence, 200); - } - return response()->json(['error' => 'Unauthorized'], 401); - } - - public function delete($id, Request $request){ - if($user = $this->authenticate($request)){ - $id = $this->getOccid($id); - $occurrence = Occurrence::find($id); - if(!$occurrence){ - return response()->json(['status' => 'failure', 'error' => 'Occurrence resource not found'], 400); - } - if(!$this->isAuthorized($user, $occurrence['collid'])){ - return response()->json(['error' => 'Unauthorized to delete target collection (collid = ' . $occurrence['collid'] . ')'], 401); - } - //$occurrence->delete(); - //return response('Occurrence Deleted Successfully', 200); - } - return response()->json(['error' => 'Unauthorized'], 401); - } - - /** - * @OA\Post( - * path="/api/v2/occurrence/skeletal", - * operationId="skeletalImport", - * description="If an existing record can be located within target collection based on matching the input identifier, empty (null) target fields will be updated with Skeletal Data. - If the target field contains data, it will remain unaltered. - If multiple records are returned matching the input identifier, data will be added only to the first record. - If an identifier is not provided or a matching record can not be found, a new Skeletal record will be created and primed with input data. - Note that catalogNumber or otherCatalogNumber must be provided to create a new skeletal record. If processingStatus is not defined, new skeletal records will be set as 'unprocessed'", - * tags={""}, - * @OA\Parameter( - * name="apiToken", - * in="query", - * description="API security token to authenticate post action", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="collid", - * in="query", - * description="primary key of target collection dataset", - * required=true, - * @OA\Schema(type="integer") - * ), - * @OA\Parameter( - * name="identifier", - * in="query", - * description="catalog number, other identifiers, occurrenceID, or recordID GUID (UUID) used to locate target occurrence occurrence", - * required=false, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="identifierTarget", - * in="query", - * description="Target field for matching identifier: catalog number, other identifiers (aka otherCatalogNumbers), GUID (occurrenceID or recordID), occid (primary key for occurrence). If identifier field is null, a new skeletal record will be created, given that a catalog number is provided.", - * required=false, - * @OA\Schema( - * type="string", - * default="CATALOGNUMBER", - * enum={"CATALOGNUMBER", "IDENTIFIERS", "GUID", "OCCID", "NONE"} - * ) - * ), - * @OA\RequestBody( - * required=true, - * description="Occurrence data to be inserted", - * @OA\MediaType( - * mediaType="application/json", - * @OA\Schema( - * @OA\Property( - * property="catalogNumber", - * type="string", - * description="Primary catalog number", - * maxLength=32 - * ), - * @OA\Property( - * property="otherCatalogNumbers", - * type="string", - * description="Additional catalog numbers", - * maxLength=75 - * ), - * @OA\Property( - * property="sciname", - * type="string", - * description="Scientific name, without the author", - * maxLength=255 - * ), - * @OA\Property( - * property="scientificNameAuthorship", - * type="string", - * description="The authorship information of scientific name", - * maxLength=255 - * ), - * @OA\Property( - * property="family", - * type="string", - * description="Taxonomic family of the scientific name", - * maxLength=255 - * ), - * @OA\Property( - * property="recordedBy", - * type="string", - * description="Primary collector or observer", - * maxLength=255 - * ), - * @OA\Property( - * property="recordNumber", - * type="string", - * description="Identifier given at the time occurrence was recorded; typically the personal identifier of the primary collector or observer", - * maxLength=45 - * ), - * @OA\Property( - * property="eventDate", - * type="string", - * description="Date the occurrence was collected or observed, or earliest date if a range was provided" - * ), - * @OA\Property( - * property="eventDate2", - * type="string", - * description="Last date the occurrence was collected or observed. Used when a date range is provided" - * ), - * @OA\Property( - * property="country", - * type="string", - * description="The name of the country or major administrative unit", - * maxLength=64 - * ), - * @OA\Property( - * property="stateProvince", - * type="string", - * description="The name of the next smaller administrative region than country (state, province, canton, department, region, etc.)", - * maxLength=255 - * ), - * @OA\Property( - * property="county", - * type="string", - * description="The full, unabbreviated name of the next smaller administrative region than stateProvince (county, shire, department, etc.", - * maxLength=255 - * ), - * @OA\Property( - * property="processingStatus", - * type="string", - * description="Processing status of the specimen record", - * maxLength=45 - * ), - * ), - * ) - * ), - * @OA\Response( - * response="200", - * description="Returns full JSON object of the of media record that was edited" - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request.", - * ), - * @OA\Response( - * response="401", - * description="Unauthorized", - * ), - * ) - */ - public function skeletalImport(Request $request){ - $this->validate($request, [ - 'collid' => 'required|integer', - 'eventDate' => 'date', - 'eventDate2' => 'date', - 'identifierTarget' => 'in:CATALOGNUMBER,IDENTIFIERS,GUID,OCCID,NONE', - ]); - if($user = $this->authenticate($request)){ - $collid = $request->input('collid'); - $identifier = $request->input('identifier'); - $identifierTarget = $request->input('identifierTarget', 'CATALOGNUMBER'); - - //Check to see if user has the necessary permission edit/add occurrences for target collection - if(!$this->isAuthorized($user, $collid)){ - return response()->json(['error' => 'Unauthorized to edit target collection (collid = ' . $collid . ')'], 401); - } - - //Remove fields with empty values and non-approved target fields - $updateArr = $request->all(); - $skeletalFieldsAllowed = array('catalogNumber', 'otherCatalogNumbers', 'sciname', 'scientificNameAuthorship', 'family', 'recordedBy', 'recordNumber', 'eventDate', 'eventDate2', 'country', 'stateProvince', 'county', 'processingStatus'); - foreach($updateArr as $fieldName => $fieldValue){ - if(!$fieldValue) unset($updateArr[$fieldName]); - elseif(!in_array($fieldName, $skeletalFieldsAllowed)) unset($updateArr[$fieldName]); - } - if(!$updateArr){ - return response()->json(['error' => 'Bad request: input data empty or does not contains allowed fields'], 400); - } - - //Get target record, if exists - $targetOccurrence = null; - if($identifier){ - $occurrenceModel = null; - if($identifierTarget == 'OCCID'){ - $occurrenceModel = Occurrence::where('occid', $identifier); - } - elseif($identifierTarget == 'GUID'){ - $occurrenceModel = Occurrence::where('occurrenceID', $identifier)->orWhere('recordID', $identifier); - } - elseif($identifierTarget == 'CATALOGNUMBER'){ - $occurrenceModel = Occurrence::where('catalogNumber', $identifier); - } - elseif($identifierTarget == 'IDENTIFIERS'){ - $occurrenceModel = Occurrence::where('otherCatalogNumbers', $identifier); - } - if($occurrenceModel){ - $targetOccurrence = $occurrenceModel->where('collid', $collid)->first(); - } - } - if($targetOccurrence){ - foreach($updateArr as $fieldName => $fieldValue){ - //Remove input if target field already contains data - if($targetOccurrence[$fieldName]){ - unset($updateArr[$fieldName]); - } - } - if(!empty($updateArr['eventDate'])){ - $updateArr['eventDate'] = OccurrenceHelper::formatDate($updateArr['eventDate']); - } - if(!empty($updateArr['eventDate2'])){ - $updateArr['eventDate2'] = OccurrenceHelper::formatDate($updateArr['eventDate2']); - } - $responseObj = ['number of fields affected' => count($updateArr), 'fields affected' => $updateArr]; - if($updateArr){ - $targetOccurrence->update($updateArr); - } - return response()->json($responseObj, 200); - } - else{ - //Record doesn't exist, thus create a new skeletal records, given that a catalog number exists - $updateArr['collid'] = $collid; - if(empty($updateArr['catalogNumber']) && empty($updateArr['otherCatalogNumbers'])){ - return response()->json(['error' => 'Bad request: catalogNumber or otherCatalogNumbers required when creating a new record'], 400); - } - if(empty($updateArr['processingStatus'])) $updateArr['processingStatus'] = 'unprocessed'; - $updateArr['recordID'] = (string) Str::uuid(); - $updateArr['dateEntered'] = date('Y-m-d H:i:s'); - $newOccurrence = Occurrence::create($updateArr); - return response()->json($newOccurrence, 201); - } - } - return response()->json(['error' => 'Unauthorized'], 401); - } - - /** - * @off_OA\Get( - * path="/api/v2/occurrence/{identifier}/reharvest", - * operationId="/api/v2/occurrence/identifier/reharvest", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="occid or specimen GUID (occurrenceID) associated with target occurrence", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Triggers a reharvest event of a snapshot record. If record is Live managed, request is ignored", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request: Occurrence identifier is required, API can only be triggered locally (at this time).", - * ), - * @OA\Response( - * response="500", - * description="Error: unable to locate record", - * ), - * ) - */ - public function oneOccurrenceReharvest($id, Request $request){ - $responseArr = array(); - $host = ''; - if(!empty($GLOBALS['SERVER_HOST'])) $host = $GLOBALS['SERVER_HOST']; - else $host = $_SERVER['SERVER_NAME']; - if($host && $request->getHttpHost() != $host){ - $responseArr['status'] = 400; - $responseArr['error'] = 'At this time, API call can only be triggered locally'; - return response()->json($responseArr); - } - $id = $this->getOccid($id); - $occurrence = Occurrence::find($id); - if(!$occurrence){ - $responseArr['status'] = 500; - $responseArr['error'] = 'Unable to locate occurrence record (occid = '.$id.')'; - return response()->json($responseArr); - } - if($occurrence->collection->managementType == 'Live Data'){ - $responseArr['status'] = 400; - $responseArr['error'] = 'Updating a Live Managed record is not allowed '; - return response()->json($responseArr); - } - $publications = $occurrence->portalPublications; - foreach($publications as $pub){ - if($pub->direction == 'import'){ - $sourcePortalID = $pub->portalID; - $remoteOccid = $pub->pivot->remoteOccid; - if($sourcePortalID && $remoteOccid){ - //Get remote occurrence data - $urlRoot = PortalIndex::where('portalID', $sourcePortalID)->value('urlRoot'); - $url = $urlRoot.'/api/v2/occurrence/'.$remoteOccid; - if($remoteOccurrence = $this->getAPIResponce($url)){ - unset($remoteOccurrence['modified']); - if(!$remoteOccurrence['occurrenceRemarks']) unset($remoteOccurrence['occurrenceRemarks']); - unset($remoteOccurrence['dynamicProperties']); - $updateObj = $this->update($id, new Request($remoteOccurrence)); - $ts = date('Y-m-d H:i:s'); - $changeArr = $updateObj->getOriginalContent()->getChanges(); - $responseArr['status'] = $updateObj->status(); - $responseArr['dataStatus'] = ($changeArr?count($changeArr).' fields modified':'nothing modified'); - $responseArr['fieldsModified'] = $changeArr; - $responseArr['sourceDateLastModified'] = $remoteOccurrence['dateLastModified']; - $responseArr['dateLastModified'] = $ts; - $responseArr['sourceCollectionUrl'] = $urlRoot.'/collections/misc/collprofiles.php?collid='.$remoteOccurrence['collid']; - $responseArr['sourceRecordUrl'] = $urlRoot.'/collections/individual/index.php?occid='.$remoteOccid; - //Reset Portal Occurrence refreshDate - $portalOccur = PortalOccurrence::where('occid', $id)->where('pubid', $pub->pubid)->first(); - $portalOccur->refreshTimestamp = $ts; - $portalOccur->save(); - } - else { - $responseArr['status'] = 400; - $responseArr['error'] = 'Unable to locate remote/source occurrence (sourceID = '.$id.')'; - $responseArr['sourceUrl'] = $url; - } - } - } - } - return response()->json($responseArr); - } - - //Helper functions - protected function getOccid($id){ - if(!is_numeric($id)){ - $occid = Occurrence::where('occurrenceID', $id)->orWhere('recordID', $id)->value('occid'); - if(is_numeric($occid)) $id = $occid; - } - return $id; - } - - private function isAuthorized($user, $collid){ - foreach($user['roles'] as $roles){ - if($roles['role'] == 'SuperAdmin') return true; - elseif($roles['role'] == 'CollAdmin' && $roles['tablePK'] == $collid) return true; - elseif($roles['role'] == 'CollEditor' && $roles['tablePK'] == $collid) return true; - } - return false; - } - - protected function getAPIResponce($url, $asyc = false){ - $resJson = false; - $ch = curl_init(); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_URL, $url); - //curl_setopt($ch, CURLOPT_HTTPGET, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - if($asyc) curl_setopt($ch, CURLOPT_TIMEOUT_MS, 500); - $resJson = curl_exec($ch); - if(!$resJson){ - $this->errorMessage = 'FATAL CURL ERROR: '.curl_error($ch).' (#'.curl_errno($ch).')'; - return false; - //$header = curl_getinfo($ch); - } - curl_close($ch); - return json_decode($resJson,true); - } + +class OccurrenceController extends Controller { + /** + * Occurrence controller instance. + * + * @return void + */ + public function __construct() {} + + /** + * @OA\Get( + * path="/api/v2/occurrence/search", + * operationId="/api/v2/occurrence/search", + * tags={""}, + * + * @OA\Parameter( + * name="collid", + * in="query", + * description="collid(s) - collection identifier(s) in portal", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="catalogNumber", + * in="query", + * description="catalogNumber", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="occurrenceID", + * in="query", + * description="occurrenceID", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="family", + * in="query", + * description="family", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="sciname", + * in="query", + * description="Scientific Name - binomen only without authorship", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="recordedBy", + * in="query", + * description="Collector/observer of occurrence", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="recordedByLastName", + * in="query", + * description="Last name of collector/observer of occurrence", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="recordNumber", + * in="query", + * description="Personal number of the collector or observer of the occurrence", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="eventDate", + * in="query", + * description="Date as YYYY, YYYY-MM or YYYY-MM-DD", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="country", + * in="query", + * description="country", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="stateProvince", + * in="query", + * description="State, Province, or second level political unit", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="county", + * in="query", + * description="County, parish, or third level political unit", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="datasetID", + * in="query", + * description="dataset ID within portal", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Controls the number of results per page", + * required=false, + * + * @OA\Schema(type="integer", default=100) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of occurrences", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showAllOccurrences(Request $request) { + $this->validate($request, [ + 'collid' => 'regex:/^[\d,]+?$/', + 'limit' => ['integer', 'max:300'], + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $occurrenceModel = Occurrence::query(); + if ($request->has('collid')) { + $occurrenceModel->whereIn('collid', explode(',', $request->collid)); + } + if ($request->has('catalogNumber')) { + $occurrenceModel->where('catalogNumber', $request->catalogNumber); + } + if ($request->has('occurrenceID')) { + //$occurrenceModel->where('occurrenceID', $request->occurrenceID); + $occurrenceID = $request->occurrenceID; + $occurrenceModel->where(function ($query) use ($occurrenceID) {$query->where('occurrenceID', $occurrenceID)->orWhere('recordID', $occurrenceID); }); + + } + //Taxonomy + if ($request->has('family')) { + $occurrenceModel->where('family', $request->family); + } + if ($request->has('sciname')) { + $occurrenceModel->where('sciname', $request->sciname); + } + //Collector units + if ($request->has('recordedBy')) { + $occurrenceModel->where('recordedBy', $request->recordedBy); + } + if ($request->has('recordedByLastName')) { + $occurrenceModel->where('recordedBy', 'LIKE', '%' . $request->recordedByLastName . '%'); + } + if ($request->has('recordNumber')) { + $occurrenceModel->where('recordNumber', $request->recordNumber); + } + if ($request->has('eventDate')) { + $occurrenceModel->where('eventDate', $request->eventDate); + } + if ($request->has('datasetID')) { + $occurrenceModel->where('datasetID', $request->datasetID); + } + //Locality place names + if ($request->has('country')) { + $occurrenceModel->where('country', $request->country); + } + if ($request->has('stateProvince')) { + $occurrenceModel->where('stateProvince', $request->stateProvince); + } + if ($request->has('county')) { + $occurrenceModel->where('county', $request->county); + } + + $fullCnt = $occurrenceModel->count(); + $result = $occurrenceModel->skip($offset)->take($limit)->get(); + + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + + return response()->json($retObj); + } + + /** + * @OA\Get( + * path="/api/v2/occurrence/{identifier}", + * operationId="/api/v2/occurrence/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="occid or specimen GUID (occurrenceID) associated with target occurrence", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="includeMedia", + * in="query", + * description="Whether to include media within output", + * required=false, + * + * @OA\Schema(type="integer") + * ), + * + * @OA\Parameter( + * name="includeIdentifications", + * in="query", + * description="Whether to include full Identification History within output", + * required=false, + * + * @OA\Schema(type="integer") + * ), + * + * @OA\Response( + * response="200", + * description="Returns single occurrence record", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Occurrence identifier is required.", + * ), + * ) + */ + public function showOneOccurrence($id, Request $request) { + $this->validate($request, [ + 'includeMedia' => 'integer', + 'includeIdentifications' => 'integer', + ]); + $id = $this->getOccid($id); + $occurrence = Occurrence::find($id); + if ($occurrence) { + if (! $occurrence->occurrenceID) { + $occurrence->occurrenceID = $occurrence->recordID; + } + if ($request->input('includeMedia')) { + $occurrence->media; + } + if ($request->input('includeIdentifications')) { + $occurrence->identification; + } + } + + return response()->json($occurrence); + } + + /** + * @OA\Get( + * path="/api/v2/occurrence/{identifier}/identification", + * operationId="/api/v2/occurrence/identifier/identification", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="occid or specimen GUID (occurrenceID) associated with target occurrence", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns identification records associated with a given occurrence record", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Occurrence identifier is required.", + * ), + * ) + */ + public function showOneOccurrenceIdentifications($id, Request $request) { + $id = $this->getOccid($id); + $identification = Occurrence::find($id)->identification; + + return response()->json($identification); + } + + /** + * @OA\Get( + * path="/api/v2/occurrence/{identifier}/media", + * operationId="/api/v2/occurrence/identifier/media", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="occid or specimen GUID (occurrenceID) associated with target occurrence", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns media records associated with a given occurrence record", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Occurrence identifier is required.", + * ), + * ) + */ + public function showOneOccurrenceMedia($id, Request $request) { + $id = $this->getOccid($id); + $media = Occurrence::find($id)->media; + + return response()->json($media); + } + + //Write funcitons + public function insert(Request $request) { + if ($user = $this->authenticate($request)) { + $this->validate($request, [ + 'collid' => 'required|integer', + ]); + $collid = $request->input('collid'); + //Check to see if user has the necessary permission edit/add occurrences for target collection + if (! $this->isAuthorized($user, $collid)) { + return response()->json(['error' => 'Unauthorized to add new records to target collection (collid = ' . $collid . ')'], 401); + } + $inputArr = $request->all(); + $inputArr['recordID'] = (string) Str::uuid(); + $inputArr['dateEntered'] = date('Y-m-d H:i:s'); + + //$occurrence = Occurrence::create($inputArr); + //return response()->json($occurrence, 201); + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + public function update($id, Request $request) { + if ($user = $this->authenticate($request)) { + $id = $this->getOccid($id); + $occurrence = Occurrence::find($id); + if (! $occurrence) { + return response()->json(['status' => 'failure', 'error' => 'Occurrence resource not found'], 400); + } + if (! $this->isAuthorized($user, $occurrence['collid'])) { + return response()->json(['error' => 'Unauthorized to edit target collection (collid = ' . $occurrence['collid'] . ')'], 401); + } + //$occurrence->update($request->all()); + //return response()->json($occurrence, 200); + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + public function delete($id, Request $request) { + if ($user = $this->authenticate($request)) { + $id = $this->getOccid($id); + $occurrence = Occurrence::find($id); + if (! $occurrence) { + return response()->json(['status' => 'failure', 'error' => 'Occurrence resource not found'], 400); + } + if (! $this->isAuthorized($user, $occurrence['collid'])) { + return response()->json(['error' => 'Unauthorized to delete target collection (collid = ' . $occurrence['collid'] . ')'], 401); + } + //$occurrence->delete(); + //return response('Occurrence Deleted Successfully', 200); + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + /** + * @OA\Post( + * path="/api/v2/occurrence/skeletal", + * operationId="skeletalImport", + * description="If an existing record can be located within target collection based on matching the input identifier, empty (null) target fields will be updated with Skeletal Data. + * tags={""}, + * @OA\Parameter( + * name="apiToken", + * in="query", + * description="API security token to authenticate post action", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="collid", + * in="query", + * description="primary key of target collection dataset", + * required=true, + * + * @OA\Schema(type="integer") + * ), + * + * @OA\Parameter( + * name="identifier", + * in="query", + * description="catalog number, other identifiers, occurrenceID, or recordID GUID (UUID) used to locate target occurrence occurrence", + * required=false, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="identifierTarget", + * in="query", + * description="Target field for matching identifier: catalog number, other identifiers (aka otherCatalogNumbers), GUID (occurrenceID or recordID), occid (primary key for occurrence). If identifier field is null, a new skeletal record will be created, given that a catalog number is provided.", + * required=false, + * + * @OA\Schema( + * type="string", + * default="CATALOGNUMBER", + * enum={"CATALOGNUMBER", "IDENTIFIERS", "GUID", "OCCID", "NONE"} + * ) + * ), + * + * @OA\RequestBody( + * required=true, + * description="Occurrence data to be inserted", + * + * @OA\MediaType( + * mediaType="application/json", + * + * @OA\Schema( + * + * @OA\Property( + * property="catalogNumber", + * type="string", + * description="Primary catalog number", + * maxLength=32 + * ), + * @OA\Property( + * property="otherCatalogNumbers", + * type="string", + * description="Additional catalog numbers", + * maxLength=75 + * ), + * @OA\Property( + * property="sciname", + * type="string", + * description="Scientific name, without the author", + * maxLength=255 + * ), + * @OA\Property( + * property="scientificNameAuthorship", + * type="string", + * description="The authorship information of scientific name", + * maxLength=255 + * ), + * @OA\Property( + * property="family", + * type="string", + * description="Taxonomic family of the scientific name", + * maxLength=255 + * ), + * @OA\Property( + * property="recordedBy", + * type="string", + * description="Primary collector or observer", + * maxLength=255 + * ), + * @OA\Property( + * property="recordNumber", + * type="string", + * description="Identifier given at the time occurrence was recorded; typically the personal identifier of the primary collector or observer", + * maxLength=45 + * ), + * @OA\Property( + * property="eventDate", + * type="string", + * description="Date the occurrence was collected or observed, or earliest date if a range was provided" + * ), + * @OA\Property( + * property="eventDate2", + * type="string", + * description="Last date the occurrence was collected or observed. Used when a date range is provided" + * ), + * @OA\Property( + * property="country", + * type="string", + * description="The name of the country or major administrative unit", + * maxLength=64 + * ), + * @OA\Property( + * property="stateProvince", + * type="string", + * description="The name of the next smaller administrative region than country (state, province, canton, department, region, etc.)", + * maxLength=255 + * ), + * @OA\Property( + * property="county", + * type="string", + * description="The full, unabbreviated name of the next smaller administrative region than stateProvince (county, shire, department, etc.", + * maxLength=255 + * ), + * @OA\Property( + * property="processingStatus", + * type="string", + * description="Processing status of the specimen record", + * maxLength=45 + * ), + * ), + * ) + * ), + * + * @OA\Response( + * response="200", + * description="Returns full JSON object of the of media record that was edited" + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request.", + * ), + * @OA\Response( + * response="401", + * description="Unauthorized", + * ), + * ) + */ + public function skeletalImport(Request $request) { + $this->validate($request, [ + 'collid' => 'required|integer', + 'eventDate' => 'date', + 'eventDate2' => 'date', + 'identifierTarget' => 'in:CATALOGNUMBER,IDENTIFIERS,GUID,OCCID,NONE', + ]); + if ($user = $this->authenticate($request)) { + $collid = $request->input('collid'); + $identifier = $request->input('identifier'); + $identifierTarget = $request->input('identifierTarget', 'CATALOGNUMBER'); + + //Check to see if user has the necessary permission edit/add occurrences for target collection + if (! $this->isAuthorized($user, $collid)) { + return response()->json(['error' => 'Unauthorized to edit target collection (collid = ' . $collid . ')'], 401); + } + + //Remove fields with empty values and non-approved target fields + $updateArr = $request->all(); + $skeletalFieldsAllowed = ['catalogNumber', 'otherCatalogNumbers', 'sciname', 'scientificNameAuthorship', 'family', 'recordedBy', 'recordNumber', 'eventDate', 'eventDate2', 'country', 'stateProvince', 'county', 'processingStatus']; + foreach ($updateArr as $fieldName => $fieldValue) { + if (! $fieldValue) { + unset($updateArr[$fieldName]); + } elseif (! in_array($fieldName, $skeletalFieldsAllowed)) { + unset($updateArr[$fieldName]); + } + } + if (! $updateArr) { + return response()->json(['error' => 'Bad request: input data empty or does not contains allowed fields'], 400); + } + + //Get target record, if exists + $targetOccurrence = null; + if ($identifier) { + $occurrenceModel = null; + if ($identifierTarget == 'OCCID') { + $occurrenceModel = Occurrence::where('occid', $identifier); + } elseif ($identifierTarget == 'GUID') { + $occurrenceModel = Occurrence::where('occurrenceID', $identifier)->orWhere('recordID', $identifier); + } elseif ($identifierTarget == 'CATALOGNUMBER') { + $occurrenceModel = Occurrence::where('catalogNumber', $identifier); + } elseif ($identifierTarget == 'IDENTIFIERS') { + $occurrenceModel = Occurrence::where('otherCatalogNumbers', $identifier); + } + if ($occurrenceModel) { + $targetOccurrence = $occurrenceModel->where('collid', $collid)->first(); + } + } + if ($targetOccurrence) { + foreach ($updateArr as $fieldName => $fieldValue) { + //Remove input if target field already contains data + if ($targetOccurrence[$fieldName]) { + unset($updateArr[$fieldName]); + } + } + if (! empty($updateArr['eventDate'])) { + $updateArr['eventDate'] = OccurrenceHelper::formatDate($updateArr['eventDate']); + } + if (! empty($updateArr['eventDate2'])) { + $updateArr['eventDate2'] = OccurrenceHelper::formatDate($updateArr['eventDate2']); + } + $responseObj = ['number of fields affected' => count($updateArr), 'fields affected' => $updateArr]; + if ($updateArr) { + $targetOccurrence->update($updateArr); + } + + return response()->json($responseObj, 200); + } else { + //Record doesn't exist, thus create a new skeletal records, given that a catalog number exists + $updateArr['collid'] = $collid; + if (empty($updateArr['catalogNumber']) && empty($updateArr['otherCatalogNumbers'])) { + return response()->json(['error' => 'Bad request: catalogNumber or otherCatalogNumbers required when creating a new record'], 400); + } + if (empty($updateArr['processingStatus'])) { + $updateArr['processingStatus'] = 'unprocessed'; + } + $updateArr['recordID'] = (string) Str::uuid(); + $updateArr['dateEntered'] = date('Y-m-d H:i:s'); + $newOccurrence = Occurrence::create($updateArr); + + return response()->json($newOccurrence, 201); + } + } + + return response()->json(['error' => 'Unauthorized'], 401); + } + + /** + * @off_OA\Get( + * path="/api/v2/occurrence/{identifier}/reharvest", + * operationId="/api/v2/occurrence/identifier/reharvest", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="occid or specimen GUID (occurrenceID) associated with target occurrence", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Triggers a reharvest event of a snapshot record. If record is Live managed, request is ignored", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request: Occurrence identifier is required, API can only be triggered locally (at this time).", + * ), + * @OA\Response( + * response="500", + * description="Error: unable to locate record", + * ), + * ) + */ + public function oneOccurrenceReharvest($id, Request $request) { + $responseArr = []; + $host = ''; + if (! empty($GLOBALS['SERVER_HOST'])) { + $host = $GLOBALS['SERVER_HOST']; + } else { + $host = $_SERVER['SERVER_NAME']; + } + if ($host && $request->getHttpHost() != $host) { + $responseArr['status'] = 400; + $responseArr['error'] = 'At this time, API call can only be triggered locally'; + + return response()->json($responseArr); + } + $id = $this->getOccid($id); + $occurrence = Occurrence::find($id); + if (! $occurrence) { + $responseArr['status'] = 500; + $responseArr['error'] = 'Unable to locate occurrence record (occid = ' . $id . ')'; + + return response()->json($responseArr); + } + if ($occurrence->collection->managementType == 'Live Data') { + $responseArr['status'] = 400; + $responseArr['error'] = 'Updating a Live Managed record is not allowed '; + + return response()->json($responseArr); + } + $publications = $occurrence->portalPublications; + foreach ($publications as $pub) { + if ($pub->direction == 'import') { + $sourcePortalID = $pub->portalID; + $remoteOccid = $pub->pivot->remoteOccid; + if ($sourcePortalID && $remoteOccid) { + //Get remote occurrence data + $urlRoot = PortalIndex::where('portalID', $sourcePortalID)->value('urlRoot'); + $url = $urlRoot . '/api/v2/occurrence/' . $remoteOccid; + if ($remoteOccurrence = $this->getAPIResponce($url)) { + unset($remoteOccurrence['modified']); + if (! $remoteOccurrence['occurrenceRemarks']) { + unset($remoteOccurrence['occurrenceRemarks']); + } + unset($remoteOccurrence['dynamicProperties']); + $updateObj = $this->update($id, new Request($remoteOccurrence)); + $ts = date('Y-m-d H:i:s'); + $changeArr = $updateObj->getOriginalContent()->getChanges(); + $responseArr['status'] = $updateObj->status(); + $responseArr['dataStatus'] = ($changeArr ? count($changeArr) . ' fields modified' : 'nothing modified'); + $responseArr['fieldsModified'] = $changeArr; + $responseArr['sourceDateLastModified'] = $remoteOccurrence['dateLastModified']; + $responseArr['dateLastModified'] = $ts; + $responseArr['sourceCollectionUrl'] = $urlRoot . '/collections/misc/collprofiles.php?collid=' . $remoteOccurrence['collid']; + $responseArr['sourceRecordUrl'] = $urlRoot . '/collections/individual/index.php?occid=' . $remoteOccid; + //Reset Portal Occurrence refreshDate + $portalOccur = PortalOccurrence::where('occid', $id)->where('pubid', $pub->pubid)->first(); + $portalOccur->refreshTimestamp = $ts; + $portalOccur->save(); + } else { + $responseArr['status'] = 400; + $responseArr['error'] = 'Unable to locate remote/source occurrence (sourceID = ' . $id . ')'; + $responseArr['sourceUrl'] = $url; + } + } + } + } + + return response()->json($responseArr); + } + + //Helper functions + protected function getOccid($id) { + if (! is_numeric($id)) { + $occid = Occurrence::where('occurrenceID', $id)->orWhere('recordID', $id)->value('occid'); + if (is_numeric($occid)) { + $id = $occid; + } + } + + return $id; + } + + private function isAuthorized($user, $collid) { + foreach ($user['roles'] as $roles) { + if ($roles['role'] == 'SuperAdmin') { + return true; + } elseif ($roles['role'] == 'CollAdmin' && $roles['tablePK'] == $collid) { + return true; + } elseif ($roles['role'] == 'CollEditor' && $roles['tablePK'] == $collid) { + return true; + } + } + + return false; + } + + protected function getAPIResponce($url, $asyc = false) { + $resJson = false; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_URL, $url); + //curl_setopt($ch, CURLOPT_HTTPGET, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + if ($asyc) { + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 500); + } + $resJson = curl_exec($ch); + if (! $resJson) { + $this->errorMessage = 'FATAL CURL ERROR: ' . curl_error($ch) . ' (#' . curl_errno($ch) . ')'; + + return false; + //$header = curl_getinfo($ch); + } + curl_close($ch); + + return json_decode($resJson, true); + } } diff --git a/app/Http/Controllers/RegistrationController.php b/app/Http/Controllers/RegistrationController.php index 9c7b919..1afd9f1 100644 --- a/app/Http/Controllers/RegistrationController.php +++ b/app/Http/Controllers/RegistrationController.php @@ -10,7 +10,9 @@ class RegistrationController extends Controller { /** * @return View */ - function __invoke() { return view('pages/signup'); } + public function __invoke() { + return view('pages/signup'); + } /** * @return |Response @@ -24,26 +26,33 @@ public static function register(Request $request) { 'password' => 'required|min:8', ]); - if($validator->fails()) { + if ($validator->fails()) { session()->flashInput($request->input()); + return view('pages/signup', [ - 'errors' => $validator->errors() + 'errors' => $validator->errors(), ])->fragment('signup-form'); } $validated = $validator->validated(); - $name_parts = explode(" ", $validated['name'], 2); + $name_parts = explode(' ', $validated['name'], 2); - if(count($name_parts) >= 1) $validated['firstName'] = $name_parts[0]; - if(count($name_parts) >= 2) $validated['lastName'] = $name_parts[1]; - else $validated['lastName'] = $validated['name']; + if (count($name_parts) >= 1) { + $validated['firstName'] = $name_parts[0]; + } + if (count($name_parts) >= 2) { + $validated['lastName'] = $name_parts[1]; + } else { + $validated['lastName'] = $validated['name']; + } - $user = new User; + $user = new User(); $user->fill($validated); $user->save(); $content = view('pages/login'); + return response($content) ->header('HX-Replace-URL', '/') ->header('HX-Retarget', '#app-body'); diff --git a/app/Http/Controllers/TaxonomyController.php b/app/Http/Controllers/TaxonomyController.php index f314437..ba85d2f 100644 --- a/app/Http/Controllers/TaxonomyController.php +++ b/app/Http/Controllers/TaxonomyController.php @@ -1,285 +1,319 @@ validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $fullCnt = Taxonomy::count(); + $result = Taxonomy::skip($offset)->take($limit)->get(); - /** - * Taxonomy controller instance. - * - * @return void - */ - public function __construct(){ - //parent::__construct(); - } + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - /** - * @OA\Get( - * path="/api/v2/taxonomy", - * operationId="/api/v2/taxonomy", - * tags={""}, - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results in the page.", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of inventories registered within system", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllTaxa(Request $request){ - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + return response()->json($retObj); + } - $fullCnt = Taxonomy::count(); - $result = Taxonomy::skip($offset)->take($limit)->get(); + /** + * @OA\Get( + * path="/api/v2/taxonomy/search", + * operationId="/api/v2/taxonomy/search", + * tags={""}, + * + * @OA\Parameter( + * name="taxon", + * in="query", + * description="Taxon searh term", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="type", + * in="query", + * description="Type of search", + * required=false, + * + * @OA\Schema( + * type="string", + * default="EXACT", + * enum={"EXACT", "START", "WHOLEWORD", "WILD"} + * ) + * ), + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Controls the number of results in the page.", + * required=false, + * + * @OA\Schema(type="integer", default=100) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of inventories registered within system", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showAllTaxaSearch(Request $request) { + $this->validate($request, [ + 'taxon' => 'required', + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + $type = $request->input('type', 'EXACT'); - /** - * @OA\Get( - * path="/api/v2/taxonomy/search", - * operationId="/api/v2/taxonomy/search", - * tags={""}, - * @OA\Parameter( - * name="taxon", - * in="query", - * description="Taxon searh term", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="type", - * in="query", - * description="Type of search", - * required=false, - * @OA\Schema( - * type="string", - * default="EXACT", - * enum={"EXACT", "START", "WHOLEWORD", "WILD"} - * ) - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results in the page.", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of inventories registered within system", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllTaxaSearch(Request $request){ - $this->validate($request, [ - 'taxon' => 'required', - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + $taxaModel = Taxonomy::query(); + if ($type == 'START') { + $taxaModel->where('sciname', 'LIKE', $request->taxon . '%'); + } elseif ($type == 'WILD') { + $taxaModel->where('sciname', 'LIKE', '%' . $request->taxon . '%'); + } elseif ($type == 'WHOLEWORD') { + $taxaModel->where('unitname1', $request->taxon) + ->orWhere('unitname2', $request->taxon) + ->orWhere('unitname3', $request->taxon); + } else { + //Exact match + $taxaModel->where('sciname', $request->taxon); + } - $type = $request->input('type', 'EXACT'); + $fullCnt = $taxaModel->count(); + $result = $taxaModel->skip($offset)->take($limit)->get(); - $taxaModel = Taxonomy::query(); - if($type == 'START'){ - $taxaModel->where('sciname', 'LIKE', $request->taxon . '%'); - } - elseif($type == 'WILD'){ - $taxaModel->where('sciname', 'LIKE', '%' . $request->taxon . '%'); - } - elseif($type == 'WHOLEWORD'){ - $taxaModel->where('unitname1', $request->taxon) - ->orWhere('unitname2', $request->taxon) - ->orWhere('unitname3', $request->taxon); - } - else{ - //Exact match - $taxaModel->where('sciname', $request->taxon); - } + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - $fullCnt = $taxaModel->count(); - $result = $taxaModel->skip($offset)->take($limit)->get(); + return response()->json($retObj); + } - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + /** + * @OA\Get( + * path="/api/v2/taxonomy/{identifier}", + * operationId="/api/v2/taxonomy/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Identifier (PK = tid) associated with taxonomic target", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Response( + * response="200", + * description="Returns metabase on inventory registered within system with matching ID", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Inventory identifier is required.", + * ), + * ) + */ + public function showOneTaxon($id, Request $request) { + $taxonObj = Taxonomy::find($id); - /** - * @OA\Get( - * path="/api/v2/taxonomy/{identifier}", - * operationId="/api/v2/taxonomy/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Identifier (PK = tid) associated with taxonomic target", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Response( - * response="200", - * description="Returns metabase on inventory registered within system with matching ID", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Inventory identifier is required.", - * ), - * ) - */ - public function showOneTaxon($id, Request $request){ - $taxonObj = Taxonomy::find($id); + //Set status and parent (can't use Eloquent model due to table containing complex PKs) + $taxStatus = DB::table('taxstatus as s') + ->select('s.parentTid', 's.taxonomicSource', 's.unacceptabilityReason', 's.notes', 'a.tid', 'a.sciname', 'a.author') + ->join('taxa as a', 's.tidAccepted', '=', 'a.tid') + ->where('s.tid', $id)->where('s.taxauthid', 1); + $taxStatusResult = $taxStatus->get(); + $taxonObj->parentTid = $taxStatusResult[0]->parentTid; - //Set status and parent (can't use Eloquent model due to table containing complex PKs) - $taxStatus = DB::table('taxstatus as s') - ->select('s.parentTid', 's.taxonomicSource', 's.unacceptabilityReason', 's.notes', 'a.tid', 'a.sciname', 'a.author') - ->join('taxa as a', 's.tidAccepted', '=', 'a.tid') - ->where('s.tid', $id)->where('s.taxauthid', 1); - $taxStatusResult = $taxStatus->get(); - $taxonObj->parentTid = $taxStatusResult[0]->parentTid; + //Set Status + if ($id == $taxStatusResult[0]->tid) { + $taxonObj->status = 'accepted'; + } else { + $taxonObj->status = 'synonym'; + $accepted = []; + $accepted['tid'] = $taxStatusResult[0]->tid; + $accepted['scientificName'] = $taxStatusResult[0]->sciname; + $accepted['scientificNameAuthorship'] = $taxStatusResult[0]->author; + $accepted['taxonomicSource'] = $taxStatusResult[0]->taxonomicSource; + $accepted['unacceptabilityReason'] = $taxStatusResult[0]->unacceptabilityReason; + $accepted['taxonRemarks'] = $taxStatusResult[0]->notes; + $taxonObj->accepted = $accepted; + } - //Set Status - if($id == $taxStatusResult[0]->tid){ - $taxonObj->status = 'accepted'; - }else{ - $taxonObj->status = 'synonym'; - $accepted = []; - $accepted['tid'] = $taxStatusResult[0]->tid; - $accepted['scientificName'] = $taxStatusResult[0]->sciname; - $accepted['scientificNameAuthorship'] = $taxStatusResult[0]->author; - $accepted['taxonomicSource'] = $taxStatusResult[0]->taxonomicSource; - $accepted['unacceptabilityReason'] = $taxStatusResult[0]->unacceptabilityReason; - $accepted['taxonRemarks'] = $taxStatusResult[0]->notes; - $taxonObj->accepted = $accepted; - } + //Set parent + $parStatus = DB::table('taxaenumtree as e') + ->select('p.tid', 'p.sciname as scientificName', 'p.author', 'p.rankid') + ->join('taxa as p', 'e.parentTid', '=', 'p.tid') + ->where('e.tid', $id)->where('e.taxauthid', 1); + $parStatusResult = $parStatus->get(); + $taxonObj->classification = $parStatusResult; - //Set parent - $parStatus = DB::table('taxaenumtree as e') - ->select('p.tid', 'p.sciname as scientificName', 'p.author', 'p.rankid') - ->join('taxa as p', 'e.parentTid', '=', 'p.tid') - ->where('e.tid', $id)->where('e.taxauthid', 1); - $parStatusResult = $parStatus->get(); - $taxonObj->classification = $parStatusResult; + if (! $taxonObj->count()) { + $taxonObj = ['status' => false, 'error' => 'Unable to locate inventory based on identifier']; + } - if(!$taxonObj->count()) $taxonObj = ['status' =>false, 'error' => 'Unable to locate inventory based on identifier']; - return response()->json($taxonObj); - } + return response()->json($taxonObj); + } - /** - * @OA\Get( - * path="/api/v2/taxonomy/{identifier}/description", - * operationId="/api/v2/taxonomy/identifier/description", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="PK, GUID, or recordID associated with target taxonomic unit", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results in the page.", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of taxonomic descriptions for a given taxon", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllDescriptions($id, Request $request){ - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + /** + * @OA\Get( + * path="/api/v2/taxonomy/{identifier}/description", + * operationId="/api/v2/taxonomy/identifier/description", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="PK, GUID, or recordID associated with target taxonomic unit", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="limit", + * in="query", + * description="Controls the number of results in the page.", + * required=false, + * + * @OA\Schema(type="integer", default=100) + * ), + * + * @OA\Parameter( + * name="offset", + * in="query", + * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", + * required=false, + * + * @OA\Schema(type="integer", default=0) + * ), + * + * @OA\Response( + * response="200", + * description="Returns list of taxonomic descriptions for a given taxon", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. ", + * ), + * ) + */ + public function showAllDescriptions($id, Request $request) { + $this->validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); - $descriptionObj = Taxonomy::find($id)->descriptions(); - //$descriptionObj->statement; - $fullCnt = $descriptionObj->count(); - $result = $descriptionObj->skip($offset)->take($limit)->get(); - //Add statements - //$result->statement = DB::table('taxadescrstmts')->where('tdbid', $id)->get(); + $descriptionObj = Taxonomy::find($id)->descriptions(); + //$descriptionObj->statement; + $fullCnt = $descriptionObj->count(); + $result = $descriptionObj->skip($offset)->take($limit)->get(); + //Add statements + //$result->statement = DB::table('taxadescrstmts')->where('tdbid', $id)->get(); - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; + return response()->json($retObj); + } } diff --git a/app/Http/Controllers/TaxonomyDescriptionController.php b/app/Http/Controllers/TaxonomyDescriptionController.php index 8a5c2e8..02d63af 100644 --- a/app/Http/Controllers/TaxonomyDescriptionController.php +++ b/app/Http/Controllers/TaxonomyDescriptionController.php @@ -1,111 +1,131 @@ validate($request, [ + 'limit' => 'integer', + 'offset' => 'integer', + ]); + $limit = $request->input('limit', 100); + $offset = $request->input('offset', 0); + + $fullCnt = $inventoryObj::count(); + $result = $inventoryObj::skip($offset)->take($limit)->get(); - /** - * @OA\Get( - * path="/api/v2/taxonomy/{identifier}/description", - * operationId="/api/v2/taxonomy/identifier/description", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="PK, GUID, or recordID associated with target taxonomic unit", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="limit", - * in="query", - * description="Controls the number of results in the page.", - * required=false, - * @OA\Schema(type="integer", default=100) - * ), - * @OA\Parameter( - * name="offset", - * in="query", - * description="Determines the offset for the search results. A limit of 200 and offset of 100, will get the third page of 100 results.", - * required=false, - * @OA\Schema(type="integer", default=0) - * ), - * @OA\Response( - * response="200", - * description="Returns list of taxonomic descriptions for a given taxon", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. ", - * ), - * ) - */ - public function showAllDescriptions($id, Request $request){ - $inventoryObj = TaxonomyDescription::find($id); - $this->validate($request, [ - 'limit' => 'integer', - 'offset' => 'integer' - ]); - $limit = $request->input('limit',100); - $offset = $request->input('offset',0); + $eor = false; + $retObj = [ + 'offset' => (int) $offset, + 'limit' => (int) $limit, + 'endOfRecords' => $eor, + 'count' => $fullCnt, + 'results' => $result, + ]; - $fullCnt = $inventoryObj::count(); - $result = $inventoryObj::skip($offset)->take($limit)->get(); + return response()->json($retObj); + } - $eor = false; - $retObj = [ - 'offset' => (int)$offset, - 'limit' => (int)$limit, - 'endOfRecords' => $eor, - 'count' => $fullCnt, - 'results' => $result - ]; - return response()->json($retObj); - } + /** + * @OA\Get( + * path="/api/v2/taxonomy/{identifier}/description/{identifier}", + * operationId="/api/v2/taxonomy/identifier/description/identifier", + * tags={""}, + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="PK, GUID, or recordID associated with target taxonomic unit", + * required=true, + * + * @OA\Schema(type="string") + * ), + * + * @OA\Parameter( + * name="identifier", + * in="path", + * description="Identifier (PK, tdbid) associated with taxonomic description", + * required=true, + * + * @OA\Schema(type="integer") + * ), + * + * @OA\Response( + * response="200", + * description="Returns metabase on inventory registered within system with matching ID", + * + * @OA\JsonContent() + * ), + * + * @OA\Response( + * response="400", + * description="Error: Bad request. Inventory identifier is required.", + * ), + * ) + */ + public function showOneDescriptions($id, Request $request) { + $inventoryObj = TaxonomyDescription::find($id); + if (! $inventoryObj->count()) { + $inventoryObj = ['status' => false, 'error' => 'Unable to locate inventory based on identifier']; + } - /** - * @OA\Get( - * path="/api/v2/taxonomy/{identifier}/description/{identifier}", - * operationId="/api/v2/taxonomy/identifier/description/identifier", - * tags={""}, - * @OA\Parameter( - * name="identifier", - * in="path", - * description="PK, GUID, or recordID associated with target taxonomic unit", - * required=true, - * @OA\Schema(type="string") - * ), - * @OA\Parameter( - * name="identifier", - * in="path", - * description="Identifier (PK, tdbid) associated with taxonomic description", - * required=true, - * @OA\Schema(type="integer") - * ), - * @OA\Response( - * response="200", - * description="Returns metabase on inventory registered within system with matching ID", - * @OA\JsonContent() - * ), - * @OA\Response( - * response="400", - * description="Error: Bad request. Inventory identifier is required.", - * ), - * ) - */ - public function showOneDescriptions($id, Request $request){ - $inventoryObj = TaxonomyDescription::find($id); - if(!$inventoryObj->count()) $inventoryObj = ['status' =>false, 'error' => 'Unable to locate inventory based on identifier']; - return response()->json($inventoryObj); - } -} \ No newline at end of file + return response()->json($inventoryObj); + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index aefe1db..586ddac 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Kernel as HttpKernel; -class Kernel extends HttpKernel -{ +class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * @@ -36,12 +35,12 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, - \App\Http\Middleware\SetLanguage::class + \App\Http\Middleware\SetLanguage::class, ], 'api' => [ // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, - \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', + \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api', \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index d4ef644..8c45abd 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -5,13 +5,11 @@ use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Http\Request; -class Authenticate extends Middleware -{ +class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. */ - protected function redirectTo(Request $request): ?string - { + protected function redirectTo(Request $request): ?string { return $request->expectsJson() ? null : route('login'); } } diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 867695b..b8f5743 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -4,8 +4,7 @@ use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; -class EncryptCookies extends Middleware -{ +class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php index 74cbd9a..fe31bf9 100644 --- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware; -class PreventRequestsDuringMaintenance extends Middleware -{ +class PreventRequestsDuringMaintenance extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. * diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index afc78c4..692c2bd 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -8,15 +8,13 @@ use Illuminate\Support\Facades\Auth; use Symfony\Component\HttpFoundation\Response; -class RedirectIfAuthenticated -{ +class RedirectIfAuthenticated { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ - public function handle(Request $request, Closure $next, string ...$guards): Response - { + public function handle(Request $request, Closure $next, string ...$guards): Response { $guards = empty($guards) ? [null] : $guards; foreach ($guards as $guard) { diff --git a/app/Http/Middleware/SetLanguage.php b/app/Http/Middleware/SetLanguage.php index 0a8dc84..6d47e00 100644 --- a/app/Http/Middleware/SetLanguage.php +++ b/app/Http/Middleware/SetLanguage.php @@ -4,18 +4,17 @@ use Closure; use Illuminate\Http\Request; -use Symfony\Component\HttpFoundation\Response; use Illuminate\Support\Facades\App; +use Symfony\Component\HttpFoundation\Response; -class SetLanguage -{ +class SetLanguage { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { - App::setLocale($_COOKIE['lang']?? env('APP_LANG', 'en')); + App::setLocale($_COOKIE['lang'] ?? env('APP_LANG', 'en')); return $next($request); } diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index 88cadca..f9db2f9 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; -class TrimStrings extends Middleware -{ +class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. * diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index c9c58bd..5d43bf9 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -4,15 +4,13 @@ use Illuminate\Http\Middleware\TrustHosts as Middleware; -class TrustHosts extends Middleware -{ +class TrustHosts extends Middleware { /** * Get the host patterns that should be trusted. * * @return array */ - public function hosts(): array - { + public function hosts(): array { return [ $this->allSubdomainsOfApplicationUrl(), ]; diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 3391630..cb842aa 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -5,8 +5,7 @@ use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; -class TrustProxies extends Middleware -{ +class TrustProxies extends Middleware { /** * The trusted proxies for this application. * diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php index 093bf64..a781215 100644 --- a/app/Http/Middleware/ValidateSignature.php +++ b/app/Http/Middleware/ValidateSignature.php @@ -4,8 +4,7 @@ use Illuminate\Routing\Middleware\ValidateSignature as Middleware; -class ValidateSignature extends Middleware -{ +class ValidateSignature extends Middleware { /** * The names of the query string parameters that should be ignored. * diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 9e86521..5430966 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; -class VerifyCsrfToken extends Middleware -{ +class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. * diff --git a/app/Models/Collection.php b/app/Models/Collection.php index ffe06e3..47975e9 100644 --- a/app/Models/Collection.php +++ b/app/Models/Collection.php @@ -5,23 +5,24 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -class Collection extends Model -{ +class Collection extends Model { use HasFactory; - protected $table = 'omcollections'; - protected $primaryKey = 'collid'; - public $timestamps = false; + protected $table = 'omcollections'; - protected $fillable = [ - 'institutionCode', 'collectionCode', 'collectionName', 'collectionID', 'datasetID', 'datasetName', 'fullDescription', 'resourceJson', 'IndividualUrl', 'contactJson', - 'latitudeDecimal', 'longitudeDecimal', 'icon', 'collType', 'managementType', 'publicEdits', 'collectionGuid', 'rightsHolder', 'rights', 'usageTerm', 'dwcaUrl', - 'bibliographicCitation', 'accessRights', 'sortSeq' - ]; + protected $primaryKey = 'collid'; - protected $hidden = ['securityKey', 'guidTarget', 'aggKeysStr', 'dwcTermJson', 'publishToGbif', 'publishToIdigbio', 'dynamicProperties']; + public $timestamps = false; - public function occurrence(){ - return $this->hasMany(Occurrence::class, 'collid', 'collid'); - } + protected $fillable = [ + 'institutionCode', 'collectionCode', 'collectionName', 'collectionID', 'datasetID', 'datasetName', 'fullDescription', 'resourceJson', 'IndividualUrl', 'contactJson', + 'latitudeDecimal', 'longitudeDecimal', 'icon', 'collType', 'managementType', 'publicEdits', 'collectionGuid', 'rightsHolder', 'rights', 'usageTerm', 'dwcaUrl', + 'bibliographicCitation', 'accessRights', 'sortSeq', + ]; + + protected $hidden = ['securityKey', 'guidTarget', 'aggKeysStr', 'dwcTermJson', 'publishToGbif', 'publishToIdigbio', 'dynamicProperties']; + + public function occurrence() { + return $this->hasMany(Occurrence::class, 'collid', 'collid'); + } } diff --git a/app/Models/Institution.php b/app/Models/Institution.php index afd5738..16ad872 100644 --- a/app/Models/Institution.php +++ b/app/Models/Institution.php @@ -8,13 +8,14 @@ class Institution extends Model { use HasFactory; - protected $primaryKey = 'iid'; + protected $primaryKey = 'iid'; // TODO (Logan) fix typo in legacy create timestamp const CREATED_AT = 'IntialTimeStamp'; + const UPDATED_AT = 'modifiedTimeStamp'; - protected $fillable = [ + protected $fillable = [ 'institutionID', 'InstitutionCode', 'InstitutionName', @@ -33,9 +34,9 @@ class Institution extends Model { 'modifieduid', 'modifiedTimeStamp', 'IntialTimeStamp', - ]; + ]; - public function collections() { - return $this->hasMany(Collections::class, 'collid', 'collid'); - } + public function collections() { + return $this->hasMany(Collections::class, 'collid', 'collid'); + } } diff --git a/app/Models/Inventory.php b/app/Models/Inventory.php index ed0edee..6ccfee7 100644 --- a/app/Models/Inventory.php +++ b/app/Models/Inventory.php @@ -1,19 +1,21 @@ belongsToMany(Taxonomy::class, 'fmchklsttaxalink', 'clid', 'tid'); - } -} \ No newline at end of file + public function taxa() { + return $this->belongsToMany(Taxonomy::class, 'fmchklsttaxalink', 'clid', 'tid'); + } +} diff --git a/app/Models/Media.php b/app/Models/Media.php index 2154e21..ab6fb89 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -1,59 +1,78 @@ setServerDomain(); - } - - public function occurrence() { - return $this->belongsTo(Occurrence::class, 'occid', 'occid'); - } - - //Accessor functions - public function getUrlAttribute($value){ - if(substr($value, 0, 1) == '/') $value = $this->serverDomain . $value; - return $value; - } - - public function getThumbnailurlAttribute($value){ - if(substr($value, 0, 1) == '/') $value = $this->serverDomain . $value; - return $value; - } - - public function getOriginalurlAttribute($value){ - if(substr($value, 0, 1) == '/') $value = $this->serverDomain . $value; - return $value; - } - - private function setServerDomain(){ - $domain = 'http://'; - if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) $domain = 'https://'; - if(!empty($GLOBALS['SERVER_HOST'])){ - if(substr($GLOBALS['SERVER_HOST'], 0, 4) == 'http') $domain = $GLOBALS['SERVER_HOST']; - else $domain .= $GLOBALS['SERVER_HOST']; - } - else $domain .= $_SERVER['SERVER_NAME']; - if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && !strpos($domain, ':'.$_SERVER['SERVER_PORT'])){ - $domain .= ':'.$_SERVER['SERVER_PORT']; - } - $domain = filter_var($domain, FILTER_SANITIZE_URL); - $this->serverDomain = $domain; - } -} \ No newline at end of file +class Media extends Model { + protected $table = 'images'; + + protected $primaryKey = 'imgid'; + + public $timestamps = false; + + protected $fillable = ['url', 'thumbnailUrl', 'originalUrl', 'archiveUrl', 'tid', 'photographer', 'photographerUid', 'imageType', 'format', 'caption', 'owner', 'sourceUrl', 'referenceUrl', + 'copyright', 'rights', 'accessRights', 'locality', 'occid', 'notes', 'anatomy', 'username', 'sourceIdentifier', 'hashFunction', 'hashValue', 'mediaMD5', 'dynamicProperties', + 'defaultDisplay', 'sortSequence', 'sortOccurrence', 'recordID']; + + protected $guarded = []; + + protected $hidden = ['dynamicProperties', 'username', 'defaultDisplay']; + + private $serverDomain; + + public function __construct(array $attributes = []) { + parent::__construct($attributes); + $this->setServerDomain(); + } + + public function occurrence() { + return $this->belongsTo(Occurrence::class, 'occid', 'occid'); + } + + //Accessor functions + public function getUrlAttribute($value) { + if (substr($value, 0, 1) == '/') { + $value = $this->serverDomain . $value; + } + + return $value; + } + + public function getThumbnailurlAttribute($value) { + if (substr($value, 0, 1) == '/') { + $value = $this->serverDomain . $value; + } + + return $value; + } + + public function getOriginalurlAttribute($value) { + if (substr($value, 0, 1) == '/') { + $value = $this->serverDomain . $value; + } + + return $value; + } + + private function setServerDomain() { + $domain = 'http://'; + if ((! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) { + $domain = 'https://'; + } + if (! empty($GLOBALS['SERVER_HOST'])) { + if (substr($GLOBALS['SERVER_HOST'], 0, 4) == 'http') { + $domain = $GLOBALS['SERVER_HOST']; + } else { + $domain .= $GLOBALS['SERVER_HOST']; + } + } else { + $domain .= $_SERVER['SERVER_NAME']; + } + if ($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && ! strpos($domain, ':' . $_SERVER['SERVER_PORT'])) { + $domain .= ':' . $_SERVER['SERVER_PORT']; + } + $domain = filter_var($domain, FILTER_SANITIZE_URL); + $this->serverDomain = $domain; + } +} diff --git a/app/Models/MorphologyCharacter.php b/app/Models/MorphologyCharacter.php index 429f7a1..705a300 100644 --- a/app/Models/MorphologyCharacter.php +++ b/app/Models/MorphologyCharacter.php @@ -1,18 +1,19 @@ collection->institutionCode; - } - return $value; - } - - public function getCollectionCodeAttribute($value){ - if(!$value){ - $value = $this->collection->collectionCode; - } - return $value; - } - - public function getOccurrenceIDAttribute($value){ - if(!$value && $this->collection->guidTarget == 'symbiotaUUID'){ - $value = $this->attributes['recordID']; - } - return $value; - } - - public function collection(){ - return $this->belongsTo(Collection::class, 'collid', 'collid'); - } - - public function identification(){ - return $this->hasMany(OccurrenceIdentification::class, 'occid', 'occid'); - } - - public function media(){ - return $this->hasMany(Media::class, 'occid', 'occid'); - } - - public function annotationExternal(){ - return $this->hasMany(OccurrenceAnnotationExternal::class, 'occid', 'occid'); - } - - public function annotationInternal(){ - return $this->hasMany(OccurrenceAnnotationInternal::class, 'occid', 'occid'); - } - - public function annotationInternalColl(){ - return $this->hasMany(OccurrenceAnnotationInternal::class, 'occid', 'occid')->where('collid', 1); - } - - public function portalPublications(){ - return $this->belongsToMany(PortalPublication::class, 'portaloccurrences', 'occid', 'pubid')->withPivot('remoteOccid');; - } + + protected $table = 'omoccurrences'; + + protected $primaryKey = 'occid'; + + public $timestamps = false; + + protected $fillable = ['collid', 'dbpk', 'basisOfRecord', 'occurrenceID', 'catalogNumber', 'otherCatalogNumbers', 'family', 'scientificName', 'sciname', 'genus', 'specificEpithet', 'datasetID', 'organismID', + 'taxonRank', 'infraspecificEpithet', 'institutionCode', 'collectionCode', 'scientificNameAuthorship', 'taxonRemarks', 'identifiedBy', 'dateIdentified', 'identificationReferences', + 'identificationRemarks', 'identificationQualifier', 'typeStatus', 'recordedBy', 'recordNumber', 'associatedCollectors', 'eventDate', 'eventDate2', + 'verbatimEventDate', 'eventTime', 'habitat', 'substrate', 'fieldNotes', 'fieldNumber', 'eventID', 'occurrenceRemarks', 'informationWithheld', 'dataGeneralizations', + 'associatedTaxa', 'dynamicProperties', 'verbatimAttributes', 'behavior', 'reproductiveCondition', 'cultivationStatus', 'establishmentMeans', 'lifeStage', 'sex', 'individualCount', + 'samplingProtocol', 'samplingEffort', 'preparations', 'locationID', 'continent', 'parentLocationID', 'country', 'stateProvince', 'county', 'municipality', 'waterBody', 'islandGroup', + 'island', 'countryCode', 'locality', 'localitySecurity', 'localitySecurityReason', 'decimalLatitude', 'decimalLongitude', 'geodeticDatum', 'coordinateUncertaintyInMeters', + 'footprintWKT', 'locationRemarks', 'verbatimCoordinates', 'georeferencedBy', 'georeferencedDate', 'georeferenceProtocol', 'georeferenceSources', + 'georeferenceVerificationStatus', 'georeferenceRemarks', 'minimumElevationInMeters', 'maximumElevationInMeters', 'verbatimElevation', 'minimumDepthInMeters', 'maximumDepthInMeters', + 'verbatimDepth', 'availability', 'disposition', 'storageLocation', 'modified', 'language', 'processingStatus', 'recordEnteredBy', 'duplicateQuantity', 'labelProject', 'recordID', 'dateEntered']; + + protected $hidden = ['collection', 'scientificName', 'recordedbyid', 'observerUid', 'labelProject', 'recordEnteredBy', 'associatedOccurrences', 'previousIdentifications', + 'verbatimCoordinateSystem', 'coordinatePrecision', 'footprintWKT', 'dynamicFields', 'institutionID', 'collectionID', 'genericColumn1', 'genericColumn2']; + + public static $snakeAttributes = false; + + public function getInstitutionCodeAttribute($value) { + if (! $value) { + $value = $this->collection->institutionCode; + } + + return $value; + } + + public function getCollectionCodeAttribute($value) { + if (! $value) { + $value = $this->collection->collectionCode; + } + + return $value; + } + + public function getOccurrenceIDAttribute($value) { + if (! $value && $this->collection->guidTarget == 'symbiotaUUID') { + $value = $this->attributes['recordID']; + } + + return $value; + } + + public function collection() { + return $this->belongsTo(Collection::class, 'collid', 'collid'); + } + + public function identification() { + return $this->hasMany(OccurrenceIdentification::class, 'occid', 'occid'); + } + + public function media() { + return $this->hasMany(Media::class, 'occid', 'occid'); + } + + public function annotationExternal() { + return $this->hasMany(OccurrenceAnnotationExternal::class, 'occid', 'occid'); + } + + public function annotationInternal() { + return $this->hasMany(OccurrenceAnnotationInternal::class, 'occid', 'occid'); + } + + public function annotationInternalColl() { + return $this->hasMany(OccurrenceAnnotationInternal::class, 'occid', 'occid')->where('collid', 1); + } + + public function portalPublications() { + return $this->belongsToMany(PortalPublication::class, 'portaloccurrences', 'occid', 'pubid')->withPivot('remoteOccid'); + } } diff --git a/app/Models/OccurrenceAnnotationExternal.php b/app/Models/OccurrenceAnnotationExternal.php index 62e58f0..8e4b1b5 100644 --- a/app/Models/OccurrenceAnnotationExternal.php +++ b/app/Models/OccurrenceAnnotationExternal.php @@ -1,19 +1,23 @@ belongsTo(Occurrence::class, 'occid', 'occid'); - } -} \ No newline at end of file + public function occurrence() { + return $this->belongsTo(Occurrence::class, 'occid', 'occid'); + } +} diff --git a/app/Models/OccurrenceAnnotationInternal.php b/app/Models/OccurrenceAnnotationInternal.php index 066007a..827d281 100644 --- a/app/Models/OccurrenceAnnotationInternal.php +++ b/app/Models/OccurrenceAnnotationInternal.php @@ -1,20 +1,23 @@ belongsTo(Occurrence::class, 'occid', 'occid'); - } + protected $hidden = []; -} \ No newline at end of file + public function occurrence() { + return $this->belongsTo(Occurrence::class, 'occid', 'occid'); + } +} diff --git a/app/Models/OccurrenceIdentification.php b/app/Models/OccurrenceIdentification.php index 20898fc..a70c1dc 100644 --- a/app/Models/OccurrenceIdentification.php +++ b/app/Models/OccurrenceIdentification.php @@ -1,19 +1,21 @@ belongsTo(Occurrence::class, 'occid', 'occid'); - } -} \ No newline at end of file + public function occurrence() { + return $this->belongsTo(Occurrence::class, 'occid', 'occid'); + } +} diff --git a/app/Models/PortalIndex.php b/app/Models/PortalIndex.php index 8955dd6..f1a4313 100644 --- a/app/Models/PortalIndex.php +++ b/app/Models/PortalIndex.php @@ -1,21 +1,27 @@ hasMany(PortalOccurrence::class, 'portalID', 'portalID'); - } - - public function portalPublications(){ - return $this->hasMany(PortalPublication::class, 'portalID', 'portalID'); - } + protected $table = 'portalindex'; + + protected $primaryKey = 'portalID'; + + protected $fillable = ['portalName', 'acronym', 'portalDescription', 'urlRoot', 'symbiotaVersion', 'guid', 'manager', 'managerEmail', 'primaryLead', 'primaryLeadEmail', 'notes']; + + protected $guarded = []; + + protected $hidden = ['securityKey']; + + public $timestamps = false; + + public function portalOccurrences() { + return $this->hasMany(PortalOccurrence::class, 'portalID', 'portalID'); + } + + public function portalPublications() { + return $this->hasMany(PortalPublication::class, 'portalID', 'portalID'); + } } diff --git a/app/Models/PortalOccurrence.php b/app/Models/PortalOccurrence.php index 8764c20..7b6ba50 100644 --- a/app/Models/PortalOccurrence.php +++ b/app/Models/PortalOccurrence.php @@ -1,20 +1,23 @@ belongsTo(PortalIndex::class, 'portalID', 'portalID'); - } + public function portalIndex() { + return $this->belongsTo(PortalIndex::class, 'portalID', 'portalID'); + } - public function occurrence() { - return $this->belongsTo(Occurrence::class, 'occid', 'occid'); - } -} \ No newline at end of file + public function occurrence() { + return $this->belongsTo(Occurrence::class, 'occid', 'occid'); + } +} diff --git a/app/Models/PortalPublication.php b/app/Models/PortalPublication.php index ea3ea4e..4a9b195 100644 --- a/app/Models/PortalPublication.php +++ b/app/Models/PortalPublication.php @@ -1,17 +1,19 @@ belongsTo(PortalIndex::class, 'portalID', 'portalID'); - } + public function portalIndex() { + return $this->belongsTo(PortalIndex::class, 'portalID', 'portalID'); + } } diff --git a/app/Models/Taxonomy.php b/app/Models/Taxonomy.php index f743e6d..eec078d 100644 --- a/app/Models/Taxonomy.php +++ b/app/Models/Taxonomy.php @@ -1,26 +1,31 @@ 'scientificName']; - protected $table = 'taxa'; - protected $primaryKey = 'tid'; - protected $hidden = [ 'sciName', 'phyloSortSequence', 'nomenclaturalStatus', 'nomenclaturalCode', 'statusNotes', 'hybrid', 'pivot', 'modifiedUid', 'modifiedTimeStamp', 'initialTimeStamp', 'InitialTimeStamp' ]; - protected $fillable = [ ]; - protected $maps = [ 'sciName' => 'scientificName' ]; - protected $appends = [ 'scientificName' ]; + protected $appends = ['scientificName']; - public function getScientificNameAttribute(){ - return $this->attributes['sciName']; - } + public function getScientificNameAttribute() { + return $this->attributes['sciName']; + } - public function descriptions(){ - return $this->hasMany(TaxonomyDescription::class, 'tid', 'tid'); - } + public function descriptions() { + return $this->hasMany(TaxonomyDescription::class, 'tid', 'tid'); + } - public function media(){ - return $this->hasMany(media::class, 'tid', 'tid'); - } + public function media() { + return $this->hasMany(media::class, 'tid', 'tid'); + } } diff --git a/app/Models/TaxonomyDescription.php b/app/Models/TaxonomyDescription.php index a46ef57..ba9540b 100644 --- a/app/Models/TaxonomyDescription.php +++ b/app/Models/TaxonomyDescription.php @@ -1,17 +1,19 @@ hasMany(TaxonomyDescriptionStatement::class, 'tdbid', 'tdbid'); - } + protected $fillable = []; + public function statement() { + return $this->hasMany(TaxonomyDescriptionStatement::class, 'tdbid', 'tdbid'); + } } diff --git a/app/Models/TaxonomyDescriptionStatement.php b/app/Models/TaxonomyDescriptionStatement.php index 03a6273..efd10a3 100644 --- a/app/Models/TaxonomyDescriptionStatement.php +++ b/app/Models/TaxonomyDescriptionStatement.php @@ -1,13 +1,15 @@ 'hashed', ]; - function roles() { + public function roles() { return $this->hasMany(UserRole::class, 'uid'); } } diff --git a/app/Models/UserAccessToken.php b/app/Models/UserAccessToken.php index 4cbd763..07cfafe 100644 --- a/app/Models/UserAccessToken.php +++ b/app/Models/UserAccessToken.php @@ -1,19 +1,21 @@ belongsTo(User::class, 'uid', 'uid'); - } -} \ No newline at end of file + public function user() { + return $this->belongsTo(User::class, 'uid', 'uid'); + } +} diff --git a/app/Models/UserRole.php b/app/Models/UserRole.php index a93b6aa..ca7419b 100644 --- a/app/Models/UserRole.php +++ b/app/Models/UserRole.php @@ -1,19 +1,21 @@ belongsTo(User::class, 'uid', 'uid'); - } -} \ No newline at end of file + public function user() { + return $this->belongsTo(User::class, 'uid', 'uid'); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2b34e71..0a07572 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,28 +2,25 @@ namespace App\Providers; -use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Blade; -use Illuminate\Support\ServiceProvider; -use Illuminate\View\Compilers\BladeCompiler; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\File; +use Illuminate\Support\ServiceProvider; +use Illuminate\View\Compilers\BladeCompiler; class AppServiceProvider extends ServiceProvider { - /** * Register any application services. */ - public function register(): void { - } - + public function register(): void {} /** * Bootstrap any application services. */ public function boot(): void { - Blade::anonymousComponentPath(__DIR__.'/../../resources/views/custom'); - Blade::anonymousComponentPath(__DIR__.'/../../resources/views/core'); + Blade::anonymousComponentPath(__DIR__ . '/../../resources/views/custom'); + Blade::anonymousComponentPath(__DIR__ . '/../../resources/views/core'); $this->callAfterResolving('blade.compiler', static function (BladeCompiler $compiler) { $compiler->extend(static function ($value) { @@ -31,12 +28,11 @@ public function boot(): void { }); }); - /** * Add Query logs For Local Enviroments. */ - if(config('app.env') === 'local') { - DB::listen(function($query) { + if (config('app.env') === 'local') { + DB::listen(function ($query) { File::append( storage_path('/logs/query.log'), '[' . date('Y-m-d H:i:s') . ']' . PHP_EOL . $query->sql . ' [' . implode(', ', $query->bindings) . ']' . PHP_EOL . PHP_EOL diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 54756cd..786aa0e 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -5,8 +5,7 @@ // use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -class AuthServiceProvider extends ServiceProvider -{ +class AuthServiceProvider extends ServiceProvider { /** * The model to policy mappings for the application. * @@ -19,8 +18,7 @@ class AuthServiceProvider extends ServiceProvider /** * Register any authentication / authorization services. */ - public function boot(): void - { + public function boot(): void { // } } diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 2be04f5..5e024b6 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -5,13 +5,11 @@ use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\ServiceProvider; -class BroadcastServiceProvider extends ServiceProvider -{ +class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. */ - public function boot(): void - { + public function boot(): void { Broadcast::routes(); require base_path('routes/channels.php'); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 2d65aac..589f238 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -7,8 +7,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Event; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { /** * The event to listener mappings for the application. * @@ -23,16 +22,14 @@ class EventServiceProvider extends ServiceProvider /** * Register any events for your application. */ - public function boot(): void - { + public function boot(): void { // } /** * Determine if events and listeners should be automatically discovered. */ - public function shouldDiscoverEvents(): bool - { + public function shouldDiscoverEvents(): bool { return false; } } diff --git a/app/Providers/FakerServiceProvider.php b/app/Providers/FakerServiceProvider.php index a05e210..c9c0365 100644 --- a/app/Providers/FakerServiceProvider.php +++ b/app/Providers/FakerServiceProvider.php @@ -9,9 +9,10 @@ class FakerServiceProvider extends ServiceProvider { * Register services. */ public function register(): void { - $this->app->singleton(\Faker\Generator::class, function() { + $this->app->singleton(\Faker\Generator::class, function () { $faker = \Faker\Factory::create(); $faker->addProvider(new \App\Faker\TaxonomyProvider($faker)); + return $faker; }); @@ -25,4 +26,3 @@ public function boot(): void { // } } - diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index 24af99c..1110c39 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -9,24 +9,24 @@ use App\Models\User; use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\MessageBag; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; -use Illuminate\Support\Facades\Hash; +use Laravel\Fortify\Contracts\FailedPasswordConfirmationResponse; +use Laravel\Fortify\Contracts\LoginResponse; use Laravel\Fortify\Contracts\PasswordConfirmedResponse; use Laravel\Fortify\Contracts\RegisterResponse; use Laravel\Fortify\Contracts\TwoFactorDisabledResponse; -use Laravel\Fortify\Contracts\LoginResponse; use Laravel\Fortify\Fortify; -use Laravel\Fortify\Contracts\FailedPasswordConfirmationResponse; class FortifyServiceProvider extends ServiceProvider { /** * Register any application services. */ public function register(): void { - $this->app->instance(LoginResponse::class, new class implements LoginResponse { + $this->app->instance(LoginResponse::class, new class() implements LoginResponse { public function toResponse($request) { return response(view('pages/home')) ->header('HX-Replace-URL', url(config('fortify.home'))) @@ -35,7 +35,7 @@ public function toResponse($request) { } }); - $this->app->instance(RegisterResponse::class, new class implements RegisterResponse { + $this->app->instance(RegisterResponse::class, new class() implements RegisterResponse { public function toResponse($request) { return response(view('pages/home')) ->header('HX-Replace-URL', url(config('fortify.home'))) @@ -44,7 +44,7 @@ public function toResponse($request) { } }); - $this->app->instance(TwoFactorDisabledResponse::class, new class implements TwoFactorDisabledResponse { + $this->app->instance(TwoFactorDisabledResponse::class, new class() implements TwoFactorDisabledResponse { public function toResponse($request) { return response(view('pages/user/profile')) ->header('HX-Retarget', 'body') @@ -52,7 +52,7 @@ public function toResponse($request) { } }); - $this->app->instance(PasswordConfirmedResponse::class, new class implements PasswordConfirmedResponse { + $this->app->instance(PasswordConfirmedResponse::class, new class() implements PasswordConfirmedResponse { public function toResponse($request) { return response(view('/pages/user/profile')) ->header('HX-Retarget', 'body') @@ -60,14 +60,14 @@ public function toResponse($request) { } }); - $this->app->instance(FailedPasswordConfirmationResponse::class, new class implements FailedPasswordConfirmationResponse { + $this->app->instance(FailedPasswordConfirmationResponse::class, new class() implements FailedPasswordConfirmationResponse { public function toResponse($request) { $message = __('The provided password was incorrect.'); return response(view('/pages/auth/confirm-password', - [ 'errors' => new MessageBag([$message]) ] - )) + ['errors' => new MessageBag([$message])] + )) ->header('HX-Retarget', 'body') ->header('HX-Request', 'true'); } @@ -83,7 +83,7 @@ public function boot(): void { //If Request Redirect on to self then only send fragment. This is for htmx to do the correct swap // // If its on current page ignore target - if($request->headers->get('hx-request') && !$request->headers->get('hx-target')) { + if ($request->headers->get('hx-request') && ! $request->headers->get('hx-target')) { return view('pages/login')->fragment('form'); } @@ -92,7 +92,7 @@ public function boot(): void { Fortify::registerView(function (Request $request) { //If Request Redirect on to self then only send fragment. This is for htmx to do the correct swap - if($request->headers->get('hx-request') && !$request->headers->get('hx-target')) { + if ($request->headers->get('hx-request') && ! $request->headers->get('hx-target')) { return view('pages/signup')->fragment('form'); } @@ -115,7 +115,7 @@ public function boot(): void { }); Fortify::authenticateUsing(function (Request $request) { - $user = User::where('email', $request->email)->first(); + $user = User::where('email', $request->email)->first(); if ($user && Hash::check($request->password, $user->password)) { @@ -141,7 +141,7 @@ public function boot(): void { Fortify::resetUserPasswordsUsing(ResetUserPassword::class); RateLimiter::for('login', function (Request $request) { - $throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip()); + $throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())) . '|' . $request->ip()); return Limit::perMinute(5)->by($throttleKey); }); diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 680b1a5..2900833 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -21,8 +21,7 @@ class RouteServiceProvider extends ServiceProvider { /** * Define your route model bindings, pattern filters, and other route configuration. */ - public function boot(): void - { + public function boot(): void { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); diff --git a/app/Socialite/Orcid/Provider.php b/app/Socialite/Orcid/Provider.php index 33a3954..a4da3f5 100644 --- a/app/Socialite/Orcid/Provider.php +++ b/app/Socialite/Orcid/Provider.php @@ -16,7 +16,9 @@ class Provider extends AbstractProvider { protected $scopeSeparator = ' '; protected $base_uri = 'https://orcid.org/'; + protected $api_uri = 'https://pub.orcid.org/'; + protected $orcid; protected function getAuthUrl($state): string { @@ -36,7 +38,7 @@ protected function getUserByToken($token) { RequestOptions::HEADERS => [ 'Authorization' => 'Bearer ' . $token, 'Accept' => 'application/json', - ] + ], ]); return json_decode((string) $response->getBody(), true); @@ -46,16 +48,16 @@ protected function getUserByToken($token) { * {@inheritdoc} */ protected function mapUserToObject(array $user) { - return (new User)->setRaw($user)->map([ + return (new User())->setRaw($user)->map([ //'nickname' => $user['username'], 'id' => $user['orcid-identifier']['path'], - 'name' => trim( + 'name' => trim( ($user['person']['name']['given-names']['value'] ?? '') . ' ' . ($user['person']['name']['family-name']['value'] ?? '') ), 'firstName' => $user['person']['name']['given-names']['value'] ?? null, 'lastName' => $user['person']['name']['family-name']['value'] ?? null, - 'email' => $user['person']['emails']['email'][0]['email'] ?? '', + 'email' => $user['person']['emails']['email'][0]['email'] ?? '', //'avatar' => $user['avatar_url'], ]); } @@ -69,7 +71,7 @@ public function user() { } if ($this->hasInvalidState()) { - throw new InvalidStateException; + throw new InvalidStateException(); } $response = $this->getAccessTokenResponse($this->getCode()); diff --git a/composer.json b/composer.json index ea47740..63904a8 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require-dev": { "fakerphp/faker": "^1.9.1", "kitloong/laravel-migrations-generator": "^7.0", - "laravel/pint": "^1.0", + "laravel/pint": "^1.18", "laravel/sail": "^1.32", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^8.1", diff --git a/composer.lock b/composer.lock index ee63227..1868117 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7247e4c9e5b03e6869f34e646764a7ed", + "content-hash": "5ec28bb99a33db73fbcb70e1c2a1fa7b", "packages": [ { "name": "bacon/bacon-qr-code", @@ -7319,16 +7319,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.2", + "version": "v1.18.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", - "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "url": "https://api.github.com/repos/laravel/pint/zipball/cef51821608239040ab841ad6e1c6ae502ae3026", + "reference": "cef51821608239040ab841ad6e1c6ae502ae3026", "shasum": "" }, "require": { @@ -7339,13 +7339,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", + "friendsofphp/php-cs-fixer": "^3.65.0", + "illuminate/view": "^10.48.24", + "larastan/larastan": "^2.9.11", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -7381,7 +7381,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-11-20T09:33:46+00:00" + "time": "2024-11-26T15:34:00+00:00" }, { "name": "laravel/sail", diff --git a/config/app.php b/config/app.php index 16702d3..a00c7bd 100644 --- a/config/app.php +++ b/config/app.php @@ -2,7 +2,6 @@ use Illuminate\Support\Facades\Facade; use Illuminate\Support\ServiceProvider; -use L5Swagger\L5SwaggerServiceProvider; return [ diff --git a/config/broadcasting.php b/config/broadcasting.php index 2410485..c9c89ca 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -37,7 +37,7 @@ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', + 'host' => env('PUSHER_HOST') ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com', 'port' => env('PUSHER_PORT', 443), 'scheme' => env('PUSHER_SCHEME', 'https'), 'encrypted' => true, diff --git a/config/cache.php b/config/cache.php index d4171e2..5115f18 100644 --- a/config/cache.php +++ b/config/cache.php @@ -106,6 +106,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), ]; diff --git a/config/database.php b/config/database.php index eff16c4..215344a 100644 --- a/config/database.php +++ b/config/database.php @@ -125,7 +125,7 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/config/filesystems.php b/config/filesystems.php index e9d9dbd..4afc1fc 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -39,7 +39,7 @@ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', 'throw' => false, ], diff --git a/config/logging.php b/config/logging.php index c44d276..d000835 100644 --- a/config/logging.php +++ b/config/logging.php @@ -89,7 +89,7 @@ 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), - 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), ], 'processors' => [PsrLogMessageProcessor::class], ], diff --git a/config/session.php b/config/session.php index 8fed97c..1b99f22 100644 --- a/config/session.php +++ b/config/session.php @@ -128,7 +128,7 @@ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_').'_session' + Str::slug(env('APP_NAME', 'laravel'), '_') . '_session' ), /* diff --git a/database/factories/CollectionFactory.php b/database/factories/CollectionFactory.php index 89d7b09..38451d3 100644 --- a/database/factories/CollectionFactory.php +++ b/database/factories/CollectionFactory.php @@ -10,6 +10,7 @@ */ class CollectionFactory extends Factory { protected $model = Collection::class; + /** * Define the model's default state. * diff --git a/database/factories/InstitutionFactory.php b/database/factories/InstitutionFactory.php index 9986505..17fa9c8 100644 --- a/database/factories/InstitutionFactory.php +++ b/database/factories/InstitutionFactory.php @@ -10,8 +10,8 @@ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Institution> */ class InstitutionFactory extends Factory { - protected $model = Institution::class; + /** * Define the model's default state. * diff --git a/database/factories/OccurrenceFactory.php b/database/factories/OccurrenceFactory.php index c2da1e8..47a7bd9 100644 --- a/database/factories/OccurrenceFactory.php +++ b/database/factories/OccurrenceFactory.php @@ -2,14 +2,15 @@ namespace Database\Factories; -use Illuminate\Database\Eloquent\Factories\Factory; use App\Models\Occurrence; +use Illuminate\Database\Eloquent\Factories\Factory; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Occurrence> */ class OccurrenceFactory extends Factory { protected $model = Occurrence::class; + /** * Define the model's default state. * diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index beb1dbe..95e01cc 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,15 +2,14 @@ namespace Database\Factories; -use Illuminate\Database\Eloquent\Factories\Factory; use App\Models\User; +use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Str; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> */ class UserFactory extends Factory { - /** * @var class-string<\Illuminate\Database\Eloquent\Model> */ diff --git a/database/migrations/2024_09_24_194122_create_actionrequest_table.php b/database/migrations/2024_09_24_194122_create_actionrequest_table.php index dbb7a33..bf635cc 100644 --- a/database/migrations/2024_09_24_194122_create_actionrequest_table.php +++ b/database/migrations/2024_09_24_194122_create_actionrequest_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('actionrequest', function (Blueprint $table) { $table->bigInteger('actionrequestid', true); $table->integer('fk'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('actionrequest'); } }; diff --git a/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php b/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php index 005df87..61ee0b5 100644 --- a/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php +++ b/database/migrations/2024_09_24_194122_create_actionrequesttype_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('actionrequesttype', function (Blueprint $table) { $table->string('requesttype', 30)->primary(); $table->string('context')->nullable(); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('actionrequesttype'); } }; diff --git a/database/migrations/2024_09_24_194122_create_adminconfig_table.php b/database/migrations/2024_09_24_194122_create_adminconfig_table.php index ff7168d..5ca844d 100644 --- a/database/migrations/2024_09_24_194122_create_adminconfig_table.php +++ b/database/migrations/2024_09_24_194122_create_adminconfig_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('adminconfig', function (Blueprint $table) { $table->integer('configID', true); $table->string('category', 45)->nullable(); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('adminconfig'); } }; diff --git a/database/migrations/2024_09_24_194122_create_adminlanguages_table.php b/database/migrations/2024_09_24_194122_create_adminlanguages_table.php index 1356891..246175c 100644 --- a/database/migrations/2024_09_24_194122_create_adminlanguages_table.php +++ b/database/migrations/2024_09_24_194122_create_adminlanguages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('adminlanguages', function (Blueprint $table) { $table->integer('langid', true); $table->string('langname', 45)->unique('index_langname_unique'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('adminlanguages'); } }; diff --git a/database/migrations/2024_09_24_194122_create_adminstats_table.php b/database/migrations/2024_09_24_194122_create_adminstats_table.php index b450802..a264ba6 100644 --- a/database/migrations/2024_09_24_194122_create_adminstats_table.php +++ b/database/migrations/2024_09_24_194122_create_adminstats_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('adminstats', function (Blueprint $table) { $table->increments('idadminstats'); $table->string('category', 45)->index('index_category'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('adminstats'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php b/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php index 1f19d15..db71925 100644 --- a/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php +++ b/database/migrations/2024_09_24_194122_create_agentdeterminationlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentdeterminationlink', function (Blueprint $table) { $table->bigInteger('agentID'); $table->unsignedInteger('detID')->index('fk_agentdetlink_detid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentdeterminationlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentlinks_table.php b/database/migrations/2024_09_24_194122_create_agentlinks_table.php index 061d2e1..1bf0156 100644 --- a/database/migrations/2024_09_24_194122_create_agentlinks_table.php +++ b/database/migrations/2024_09_24_194122_create_agentlinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentlinks', function (Blueprint $table) { $table->bigInteger('agentLinksID', true); $table->bigInteger('agentID')->index('fk_agentlinks_agentid_idx'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentlinks'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentnames_table.php b/database/migrations/2024_09_24_194122_create_agentnames_table.php index f82f250..8485fe8 100644 --- a/database/migrations/2024_09_24_194122_create_agentnames_table.php +++ b/database/migrations/2024_09_24_194122_create_agentnames_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentnames', function (Blueprint $table) { $table->bigInteger('agentNamesID')->primary(); $table->bigInteger('agentID'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentnames'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php b/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php index 255a681..e14dc46 100644 --- a/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php +++ b/database/migrations/2024_09_24_194122_create_agentnumberpattern_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentnumberpattern', function (Blueprint $table) { $table->bigInteger('agentNumberPatternID')->primary(); $table->bigInteger('agentID')->index('ix_agentnumberpattern_agentid'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentnumberpattern'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php b/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php index c0eb3a2..ada5c85 100644 --- a/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php +++ b/database/migrations/2024_09_24_194122_create_agentoccurrencelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentoccurrencelink', function (Blueprint $table) { $table->bigInteger('agentID'); $table->unsignedInteger('occid')->index('fk_agentoccurlink_occid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentoccurrencelink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentrelations_table.php b/database/migrations/2024_09_24_194122_create_agentrelations_table.php index f80d3c3..8672566 100644 --- a/database/migrations/2024_09_24_194122_create_agentrelations_table.php +++ b/database/migrations/2024_09_24_194122_create_agentrelations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentrelations', function (Blueprint $table) { $table->bigInteger('agentRelationsID', true); $table->bigInteger('fromAgentID')->index('fk_agentrelations_fromagentid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentrelations'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agents_table.php b/database/migrations/2024_09_24_194122_create_agents_table.php index c61e0d4..7feedf4 100644 --- a/database/migrations/2024_09_24_194122_create_agents_table.php +++ b/database/migrations/2024_09_24_194122_create_agents_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agents', function (Blueprint $table) { $table->bigInteger('agentID', true); $table->string('familyName', 45)->index('ix_agents_familyname'); @@ -48,8 +46,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agents'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php b/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php index 9cae0f9..06c3d0d 100644 --- a/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php +++ b/database/migrations/2024_09_24_194122_create_agentsfulltext_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentsfulltext', function (Blueprint $table) { $table->bigInteger('agentsFulltextID', true); $table->integer('agentID'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentsfulltext'); } }; diff --git a/database/migrations/2024_09_24_194122_create_agentteams_table.php b/database/migrations/2024_09_24_194122_create_agentteams_table.php index 01e01e4..450c3ee 100644 --- a/database/migrations/2024_09_24_194122_create_agentteams_table.php +++ b/database/migrations/2024_09_24_194122_create_agentteams_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('agentteams', function (Blueprint $table) { $table->bigInteger('agentTeamID', true); $table->bigInteger('teamAgentID')->index('fk_agentteams_teamagentid_idx'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('agentteams'); } }; diff --git a/database/migrations/2024_09_24_194122_create_chotomouskey_table.php b/database/migrations/2024_09_24_194122_create_chotomouskey_table.php index 0e7eea7..6c27fcb 100644 --- a/database/migrations/2024_09_24_194122_create_chotomouskey_table.php +++ b/database/migrations/2024_09_24_194122_create_chotomouskey_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('chotomouskey', function (Blueprint $table) { $table->increments('stmtid'); $table->string('statement', 300); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('chotomouskey'); } }; diff --git a/database/migrations/2024_09_24_194122_create_configpage_table.php b/database/migrations/2024_09_24_194122_create_configpage_table.php index c11d19c..473b87b 100644 --- a/database/migrations/2024_09_24_194122_create_configpage_table.php +++ b/database/migrations/2024_09_24_194122_create_configpage_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('configpage', function (Blueprint $table) { $table->integer('configpageid', true); $table->string('pagename', 45); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('configpage'); } }; diff --git a/database/migrations/2024_09_24_194122_create_configpageattributes_table.php b/database/migrations/2024_09_24_194122_create_configpageattributes_table.php index b2a7ba9..25d8639 100644 --- a/database/migrations/2024_09_24_194122_create_configpageattributes_table.php +++ b/database/migrations/2024_09_24_194122_create_configpageattributes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('configpageattributes', function (Blueprint $table) { $table->integer('attributeid', true); $table->integer('configpageid')->index('fk_configpageattributes_id_idx'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('configpageattributes'); } }; diff --git a/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php b/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php index 7171314..95a1080 100644 --- a/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php +++ b/database/migrations/2024_09_24_194122_create_ctcontrolvocab_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('ctcontrolvocab', function (Blueprint $table) { $table->integer('cvID', true); $table->unsignedInteger('collid')->nullable()->index('fk_ctcontrolvocab_collid_idx'); @@ -38,8 +36,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('ctcontrolvocab'); } }; diff --git a/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php b/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php index e9a9acc..6a9f3be 100644 --- a/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php +++ b/database/migrations/2024_09_24_194122_create_ctcontrolvocabterm_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('ctcontrolvocabterm', function (Blueprint $table) { $table->integer('cvTermID', true); $table->integer('cvID')->index('fk_ctcontrolvocabterm_cvid_idx'); @@ -37,8 +35,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('ctcontrolvocabterm'); } }; diff --git a/database/migrations/2024_09_24_194122_create_ctnametypes_table.php b/database/migrations/2024_09_24_194122_create_ctnametypes_table.php index f009985..a6a4765 100644 --- a/database/migrations/2024_09_24_194122_create_ctnametypes_table.php +++ b/database/migrations/2024_09_24_194122_create_ctnametypes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('ctnametypes', function (Blueprint $table) { $table->string('type', 32)->primary(); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('ctnametypes'); } }; diff --git a/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php b/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php index 277b93b..00a7c87 100644 --- a/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php +++ b/database/migrations/2024_09_24_194122_create_ctrelationshiptypes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('ctrelationshiptypes', function (Blueprint $table) { $table->string('relationship', 50)->primary(); $table->string('inverse', 50)->nullable(); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('ctrelationshiptypes'); } }; diff --git a/database/migrations/2024_09_24_194122_create_failed_jobs_table.php b/database/migrations/2024_09_24_194122_create_failed_jobs_table.php index 08606bd..b24dfe7 100644 --- a/database/migrations/2024_09_24_194122_create_failed_jobs_table.php +++ b/database/migrations/2024_09_24_194122_create_failed_jobs_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('uuid')->unique(); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('failed_jobs'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmchecklists_table.php b/database/migrations/2024_09_24_194122_create_fmchecklists_table.php index d3af5e6..2b5f725 100644 --- a/database/migrations/2024_09_24_194122_create_fmchecklists_table.php +++ b/database/migrations/2024_09_24_194122_create_fmchecklists_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmchecklists', function (Blueprint $table) { $table->increments('clid'); $table->string('name', 100); @@ -53,8 +51,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmchecklists'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php b/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php index 035874f..4cb7f09 100644 --- a/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php +++ b/database/migrations/2024_09_24_194122_create_fmchklstchildren_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmchklstchildren', function (Blueprint $table) { $table->unsignedInteger('clid')->index('fk_fmchklstchild_clid_idx'); $table->unsignedInteger('clidchild')->index('fk_fmchklstchild_child_idx'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmchklstchildren'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php b/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php index df0d9b1..777dabd 100644 --- a/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php +++ b/database/migrations/2024_09_24_194122_create_fmchklstcoordinates_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmchklstcoordinates', function (Blueprint $table) { $table->integer('clCoordID', true); $table->unsignedInteger('clid')->index('ix_checklistcoord_clid'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmchklstcoordinates'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php b/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php index e091bcb..8bc8c47 100644 --- a/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php +++ b/database/migrations/2024_09_24_194122_create_fmchklstprojlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmchklstprojlink', function (Blueprint $table) { $table->unsignedInteger('pid'); $table->unsignedInteger('clid')->index('fk_chklst'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmchklstprojlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php b/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php index 0875006..7aa71f8 100644 --- a/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_fmchklsttaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmchklsttaxalink', function (Blueprint $table) { $table->increments('clTaxaID'); $table->unsignedInteger('tid')->index('fk_chklsttaxalink_tid'); @@ -36,8 +34,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmchklsttaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php b/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php index 50c916a..1fa0308 100644 --- a/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php +++ b/database/migrations/2024_09_24_194122_create_fmdynamicchecklists_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmdynamicchecklists', function (Blueprint $table) { $table->increments('dynclid'); $table->string('name', 50)->nullable(); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmdynamicchecklists'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php b/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php index 92e0391..9d95b5d 100644 --- a/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_fmdyncltaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmdyncltaxalink', function (Blueprint $table) { $table->unsignedInteger('dynclid'); $table->unsignedInteger('tid')->index('fk_dyncltaxalink_taxa'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmdyncltaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php b/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php index 9538a2e..01570d1 100644 --- a/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php +++ b/database/migrations/2024_09_24_194122_create_fmprojectcategories_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmprojectcategories', function (Blueprint $table) { $table->increments('projcatid'); $table->unsignedInteger('pid')->index('fk_fmprojcat_pid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmprojectcategories'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmprojects_table.php b/database/migrations/2024_09_24_194122_create_fmprojects_table.php index 9225e99..8c897ca 100644 --- a/database/migrations/2024_09_24_194122_create_fmprojects_table.php +++ b/database/migrations/2024_09_24_194122_create_fmprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmprojects', function (Blueprint $table) { $table->increments('pid'); $table->string('projname', 75); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmprojects'); } }; diff --git a/database/migrations/2024_09_24_194122_create_fmvouchers_table.php b/database/migrations/2024_09_24_194122_create_fmvouchers_table.php index 4794888..013a8a1 100644 --- a/database/migrations/2024_09_24_194122_create_fmvouchers_table.php +++ b/database/migrations/2024_09_24_194122_create_fmvouchers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('fmvouchers', function (Blueprint $table) { $table->increments('voucherID'); $table->unsignedInteger('clTaxaID')->index('fk_fmvouchers_tidclid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('fmvouchers'); } }; diff --git a/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php b/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php index 18458cf..b52abea 100644 --- a/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php +++ b/database/migrations/2024_09_24_194122_create_geographicpolygon_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('geographicpolygon', function (Blueprint $table) { $table->integer('geoThesID')->primary(); $table->geometry('footprintPolygon'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('geographicpolygon'); } }; diff --git a/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php b/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php index 7083277..7a03dc2 100644 --- a/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php +++ b/database/migrations/2024_09_24_194122_create_geographicthesaurus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('geographicthesaurus', function (Blueprint $table) { $table->integer('geoThesID', true); $table->string('geoterm', 100)->nullable()->index('ix_geothes_termname'); @@ -35,8 +33,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('geographicthesaurus'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossary_table.php b/database/migrations/2024_09_24_194122_create_glossary_table.php index 5e52020..942375d 100644 --- a/database/migrations/2024_09_24_194122_create_glossary_table.php +++ b/database/migrations/2024_09_24_194122_create_glossary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossary', function (Blueprint $table) { $table->increments('glossid'); $table->string('term', 150)->index('index_term'); @@ -34,8 +32,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossary'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossarycategory_table.php b/database/migrations/2024_09_24_194122_create_glossarycategory_table.php index 2cace2d..4293ec4 100644 --- a/database/migrations/2024_09_24_194122_create_glossarycategory_table.php +++ b/database/migrations/2024_09_24_194122_create_glossarycategory_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossarycategory', function (Blueprint $table) { $table->integer('glossCatID', true); $table->string('category', 45)->nullable()->index('ix_glossarycategory_cat'); @@ -30,8 +28,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossarycategory'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php b/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php index 8415841..3261ba7 100644 --- a/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php +++ b/database/migrations/2024_09_24_194122_create_glossarycategorylink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossarycategorylink', function (Blueprint $table) { $table->integer('glossCatLinkID', true); $table->unsignedInteger('glossID')->index('fk_glosscatlink_glossid_idx'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossarycategorylink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossaryimages_table.php b/database/migrations/2024_09_24_194122_create_glossaryimages_table.php index 794677d..6b69575 100644 --- a/database/migrations/2024_09_24_194122_create_glossaryimages_table.php +++ b/database/migrations/2024_09_24_194122_create_glossaryimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossaryimages', function (Blueprint $table) { $table->increments('glimgid'); $table->unsignedInteger('glossid')->index('fk_glossaryimages_gloss'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossaryimages'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossarysources_table.php b/database/migrations/2024_09_24_194122_create_glossarysources_table.php index 61b23ca..a979955 100644 --- a/database/migrations/2024_09_24_194122_create_glossarysources_table.php +++ b/database/migrations/2024_09_24_194122_create_glossarysources_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossarysources', function (Blueprint $table) { $table->unsignedInteger('tid')->primary(); $table->string('contributorTerm', 1000)->nullable(); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossarysources'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php b/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php index 280404b..34b902f 100644 --- a/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_glossarytaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossarytaxalink', function (Blueprint $table) { $table->unsignedInteger('glossid'); $table->unsignedInteger('tid')->index('glossarytaxalink_ibfk_1'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossarytaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php b/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php index d6e58b4..d461102 100644 --- a/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php +++ b/database/migrations/2024_09_24_194122_create_glossarytermlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('glossarytermlink', function (Blueprint $table) { $table->integer('gltlinkid', true); $table->unsignedInteger('glossgrpid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('glossarytermlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_guidimages_table.php b/database/migrations/2024_09_24_194122_create_guidimages_table.php index 8618dbc..60e7013 100644 --- a/database/migrations/2024_09_24_194122_create_guidimages_table.php +++ b/database/migrations/2024_09_24_194122_create_guidimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('guidimages', function (Blueprint $table) { $table->string('guid', 45)->primary(); $table->unsignedInteger('imgid')->nullable()->unique(); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('guidimages'); } }; diff --git a/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php b/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php index cac166c..327bd42 100644 --- a/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php +++ b/database/migrations/2024_09_24_194122_create_guidoccurdeterminations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('guidoccurdeterminations', function (Blueprint $table) { $table->string('guid', 45)->primary(); $table->unsignedInteger('detid')->nullable()->unique('guidoccurdet_detid_unique'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('guidoccurdeterminations'); } }; diff --git a/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php b/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php index 17cfdc1..b5888b9 100644 --- a/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php +++ b/database/migrations/2024_09_24_194122_create_guidoccurrences_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('guidoccurrences', function (Blueprint $table) { $table->string('guid', 45)->primary(); $table->unsignedInteger('occid')->nullable()->unique(); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('guidoccurrences'); } }; diff --git a/database/migrations/2024_09_24_194122_create_igsnverification_table.php b/database/migrations/2024_09_24_194122_create_igsnverification_table.php index 5b20c8d..889dfdd 100644 --- a/database/migrations/2024_09_24_194122_create_igsnverification_table.php +++ b/database/migrations/2024_09_24_194122_create_igsnverification_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('igsnverification', function (Blueprint $table) { $table->string('igsn', 15)->index('index_igsn'); $table->unsignedInteger('occidInPortal')->nullable()->index('fk_igsn_occid_idx'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('igsnverification'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imageannotations_table.php b/database/migrations/2024_09_24_194122_create_imageannotations_table.php index 33db631..5f634cd 100644 --- a/database/migrations/2024_09_24_194122_create_imageannotations_table.php +++ b/database/migrations/2024_09_24_194122_create_imageannotations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imageannotations', function (Blueprint $table) { $table->unsignedInteger('tid')->nullable()->index('tid'); $table->unsignedInteger('imgid')->default(0); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imageannotations'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imagekeywords_table.php b/database/migrations/2024_09_24_194122_create_imagekeywords_table.php index 10dab53..69497ea 100644 --- a/database/migrations/2024_09_24_194122_create_imagekeywords_table.php +++ b/database/migrations/2024_09_24_194122_create_imagekeywords_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imagekeywords', function (Blueprint $table) { $table->integer('imgkeywordid', true); $table->unsignedInteger('imgid')->index('fk_imagekeywords_imgid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imagekeywords'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php b/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php index 3727ce6..0fc69f2 100644 --- a/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php +++ b/database/migrations/2024_09_24_194122_create_imageprojectlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imageprojectlink', function (Blueprint $table) { $table->unsignedInteger('imgid'); $table->integer('imgprojid')->index('fk_imageprojlink_imgprojid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imageprojectlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imageprojects_table.php b/database/migrations/2024_09_24_194122_create_imageprojects_table.php index 5b299d5..dcc0e72 100644 --- a/database/migrations/2024_09_24_194122_create_imageprojects_table.php +++ b/database/migrations/2024_09_24_194122_create_imageprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imageprojects', function (Blueprint $table) { $table->integer('imgprojid', true); $table->string('projectname', 75); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imageprojects'); } }; diff --git a/database/migrations/2024_09_24_194122_create_images_table.php b/database/migrations/2024_09_24_194122_create_images_table.php index ecd0b49..a56daa9 100644 --- a/database/migrations/2024_09_24_194122_create_images_table.php +++ b/database/migrations/2024_09_24_194122_create_images_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('images', function (Blueprint $table) { $table->increments('imgid'); $table->unsignedInteger('tid')->nullable()->index('index_tid'); @@ -52,8 +50,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('images'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imagetag_table.php b/database/migrations/2024_09_24_194122_create_imagetag_table.php index 135a0a1..5546ac2 100644 --- a/database/migrations/2024_09_24_194122_create_imagetag_table.php +++ b/database/migrations/2024_09_24_194122_create_imagetag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imagetag', function (Blueprint $table) { $table->bigInteger('imagetagid', true); $table->unsignedInteger('imgid')->index('fk_imagetag_imgid_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imagetag'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php b/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php index 99a90f7..bb9cb0f 100644 --- a/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php +++ b/database/migrations/2024_09_24_194122_create_imagetaggroup_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imagetaggroup', function (Blueprint $table) { $table->integer('imgTagGroupID', true); $table->string('groupName', 45)->index('ix_imagetaggroup'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imagetaggroup'); } }; diff --git a/database/migrations/2024_09_24_194122_create_imagetagkey_table.php b/database/migrations/2024_09_24_194122_create_imagetagkey_table.php index 667a18c..1b81d69 100644 --- a/database/migrations/2024_09_24_194122_create_imagetagkey_table.php +++ b/database/migrations/2024_09_24_194122_create_imagetagkey_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('imagetagkey', function (Blueprint $table) { $table->string('tagkey', 30)->primary(); $table->integer('imgTagGroupID')->nullable()->index('fk_imagetagkey_imgtaggroupid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('imagetagkey'); } }; diff --git a/database/migrations/2024_09_24_194122_create_institutions_table.php b/database/migrations/2024_09_24_194122_create_institutions_table.php index 564697a..fa227ff 100644 --- a/database/migrations/2024_09_24_194122_create_institutions_table.php +++ b/database/migrations/2024_09_24_194122_create_institutions_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('institutions', function (Blueprint $table) { $table->increments('iid'); $table->string('institutionID', 45)->nullable(); @@ -37,8 +35,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('institutions'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php b/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php index b525c6c..c756edd 100644 --- a/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcharacterlang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcharacterlang', function (Blueprint $table) { $table->unsignedInteger('cid'); $table->string('charname', 150); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcharacterlang'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcharacters_table.php b/database/migrations/2024_09_24_194122_create_kmcharacters_table.php index 6bd9faa..6ad67a3 100644 --- a/database/migrations/2024_09_24_194122_create_kmcharacters_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcharacters_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcharacters', function (Blueprint $table) { $table->increments('cid'); $table->string('charname', 150)->index('index_charname'); @@ -34,8 +32,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcharacters'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmchardependance_table.php b/database/migrations/2024_09_24_194122_create_kmchardependance_table.php index 067cd2d..d821827 100644 --- a/database/migrations/2024_09_24_194122_create_kmchardependance_table.php +++ b/database/migrations/2024_09_24_194122_create_kmchardependance_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmchardependance', function (Blueprint $table) { $table->unsignedInteger('CID')->index('fk_chardependance_cid_idx'); $table->unsignedInteger('CIDDependance'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmchardependance'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcharheading_table.php b/database/migrations/2024_09_24_194122_create_kmcharheading_table.php index 2c90b58..bbda17b 100644 --- a/database/migrations/2024_09_24_194122_create_kmcharheading_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcharheading_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcharheading', function (Blueprint $table) { $table->increments('hid'); $table->string('headingname')->index('headingname'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcharheading'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php b/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php index 67e567b..a1cea69 100644 --- a/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcharheadinglang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcharheadinglang', function (Blueprint $table) { $table->unsignedInteger('hid'); $table->integer('langid')->index('fk_kmcharheadinglang_langid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcharheadinglang'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php b/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php index e40cf33..bae7039 100644 --- a/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_kmchartaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmchartaxalink', function (Blueprint $table) { $table->unsignedInteger('CID')->default(0); $table->unsignedInteger('TID')->default(0)->index('fk_chartaxalink-tid'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmchartaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcs_table.php b/database/migrations/2024_09_24_194122_create_kmcs_table.php index b6f03c2..cfe029c 100644 --- a/database/migrations/2024_09_24_194122_create_kmcs_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcs_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcs', function (Blueprint $table) { $table->unsignedInteger('cid')->default(0)->index('fk_cs_chars'); $table->string('cs', 16); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcs'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcsimages_table.php b/database/migrations/2024_09_24_194122_create_kmcsimages_table.php index 927ce59..bd034d8 100644 --- a/database/migrations/2024_09_24_194122_create_kmcsimages_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcsimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcsimages', function (Blueprint $table) { $table->increments('csimgid'); $table->unsignedInteger('cid'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcsimages'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmcslang_table.php b/database/migrations/2024_09_24_194122_create_kmcslang_table.php index 8a99067..0f7a999 100644 --- a/database/migrations/2024_09_24_194122_create_kmcslang_table.php +++ b/database/migrations/2024_09_24_194122_create_kmcslang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmcslang', function (Blueprint $table) { $table->unsignedInteger('cid'); $table->string('cs', 16); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmcslang'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmdescr_table.php b/database/migrations/2024_09_24_194122_create_kmdescr_table.php index b9ab84f..7f1910f 100644 --- a/database/migrations/2024_09_24_194122_create_kmdescr_table.php +++ b/database/migrations/2024_09_24_194122_create_kmdescr_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmdescr', function (Blueprint $table) { $table->unsignedInteger('TID')->default(0); $table->unsignedInteger('CID')->default(0); @@ -34,8 +32,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmdescr'); } }; diff --git a/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php b/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php index 04a32e8..59c5ec1 100644 --- a/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php +++ b/database/migrations/2024_09_24_194122_create_kmdescrdeletions_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('kmdescrdeletions', function (Blueprint $table) { $table->unsignedInteger('TID'); $table->unsignedInteger('CID'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('kmdescrdeletions'); } }; diff --git a/database/migrations/2024_09_24_194122_create_lkupcountry_table.php b/database/migrations/2024_09_24_194122_create_lkupcountry_table.php index 60f79ff..c34a727 100644 --- a/database/migrations/2024_09_24_194122_create_lkupcountry_table.php +++ b/database/migrations/2024_09_24_194122_create_lkupcountry_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('lkupcountry', function (Blueprint $table) { $table->integer('countryId', true); $table->string('countryName', 100)->unique('country_unique'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('lkupcountry'); } }; diff --git a/database/migrations/2024_09_24_194122_create_lkupcounty_table.php b/database/migrations/2024_09_24_194122_create_lkupcounty_table.php index 413fb67..7b79629 100644 --- a/database/migrations/2024_09_24_194122_create_lkupcounty_table.php +++ b/database/migrations/2024_09_24_194122_create_lkupcounty_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('lkupcounty', function (Blueprint $table) { $table->integer('countyId', true); $table->integer('stateId')->index('fk_stateprovince'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('lkupcounty'); } }; diff --git a/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php b/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php index dda1c50..fc40db3 100644 --- a/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php +++ b/database/migrations/2024_09_24_194122_create_lkupmunicipality_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('lkupmunicipality', function (Blueprint $table) { $table->integer('municipalityId', true); $table->integer('stateId')->index('fk_stateprovince'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('lkupmunicipality'); } }; diff --git a/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php b/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php index cf5d846..d4ebba7 100644 --- a/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php +++ b/database/migrations/2024_09_24_194122_create_lkupstateprovince_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('lkupstateprovince', function (Blueprint $table) { $table->integer('stateId', true); $table->integer('countryId')->index('fk_country'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('lkupstateprovince'); } }; diff --git a/database/migrations/2024_09_24_194122_create_media_table.php b/database/migrations/2024_09_24_194122_create_media_table.php index 3a4a971..0401ced 100644 --- a/database/migrations/2024_09_24_194122_create_media_table.php +++ b/database/migrations/2024_09_24_194122_create_media_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('media', function (Blueprint $table) { $table->increments('media_id'); $table->unsignedInteger('tid')->nullable()->index('fk_media_taxa'); @@ -54,8 +52,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('media'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollcategories_table.php b/database/migrations/2024_09_24_194122_create_omcollcategories_table.php index e3e1e2e..8cc21a0 100644 --- a/database/migrations/2024_09_24_194122_create_omcollcategories_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollcategories_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollcategories', function (Blueprint $table) { $table->increments('ccpk'); $table->string('category', 75); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollcategories'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php b/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php index ac9b180..c765f37 100644 --- a/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollcatlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollcatlink', function (Blueprint $table) { $table->unsignedInteger('ccpk'); $table->unsignedInteger('collid')->index('fk_collcatlink_coll'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollcatlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollections_table.php b/database/migrations/2024_09_24_194122_create_omcollections_table.php index 7caa6d1..86c54c9 100644 --- a/database/migrations/2024_09_24_194122_create_omcollections_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollections_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollections', function (Blueprint $table) { $table->increments('collID'); $table->string('institutionCode', 45); @@ -58,8 +56,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollections'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php b/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php index a51305c..45a5769 100644 --- a/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollectionstats_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollectionstats', function (Blueprint $table) { $table->unsignedInteger('collid')->primary(); $table->unsignedInteger('recordcnt')->default(0); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollectionstats'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollproperties_table.php b/database/migrations/2024_09_24_194122_create_omcollproperties_table.php index d0de267..8b2cfae 100644 --- a/database/migrations/2024_09_24_194122_create_omcollproperties_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollproperties_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollproperties', function (Blueprint $table) { $table->increments('collPropID'); $table->unsignedInteger('collid')->index('fk_omcollproperties_collid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollproperties'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollpublications_table.php b/database/migrations/2024_09_24_194122_create_omcollpublications_table.php index daa7258..da64876 100644 --- a/database/migrations/2024_09_24_194122_create_omcollpublications_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollpublications_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollpublications', function (Blueprint $table) { $table->increments('pubid'); $table->unsignedInteger('collid')->index('fk_adminpub_collid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollpublications'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php b/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php index ba8d0e2..84c8121 100644 --- a/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollpuboccurlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollpuboccurlink', function (Blueprint $table) { $table->unsignedInteger('pubid'); $table->unsignedInteger('occid')->index('fk_ompuboccid_idx'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollpuboccurlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php b/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php index d9087e2..6768ed7 100644 --- a/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php +++ b/database/migrations/2024_09_24_194122_create_omcollsecondary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcollsecondary', function (Blueprint $table) { $table->increments('ocsid'); $table->unsignedInteger('collid')->index('fk_omcollsecondary_coll'); @@ -35,8 +33,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcollsecondary'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php index 91e1cb8..5561771 100644 --- a/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourcecentral_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcrowdsourcecentral', function (Blueprint $table) { $table->integer('omcsid', true); $table->unsignedInteger('collid')->index('fk_omcrowdsourcecentral_collid'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcrowdsourcecentral'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php index 93a53cb..2a40ca2 100644 --- a/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourceproject_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcrowdsourceproject', function (Blueprint $table) { $table->integer('csProjID', true); $table->string('title', 45); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcrowdsourceproject'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php b/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php index 24f72e4..09de6e5 100644 --- a/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php +++ b/database/migrations/2024_09_24_194122_create_omcrowdsourcequeue_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omcrowdsourcequeue', function (Blueprint $table) { $table->integer('idomcrowdsourcequeue', true); $table->integer('omcsid'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omcrowdsourcequeue'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php index a51bfff..f0168a7 100644 --- a/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php +++ b/database/migrations/2024_09_24_194122_create_omexsiccatinumbers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omexsiccatinumbers', function (Blueprint $table) { $table->increments('omenid'); $table->string('exsnumber', 45); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omexsiccatinumbers'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php index 3abbe0b..569e5d0 100644 --- a/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php +++ b/database/migrations/2024_09_24_194122_create_omexsiccatiocclink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omexsiccatiocclink', function (Blueprint $table) { $table->unsignedInteger('omenid')->index('fkexsiccatinumocclink1'); $table->unsignedInteger('occid')->index('fkexsiccatinumocclink2'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omexsiccatiocclink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php b/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php index 76d113c..390d425 100644 --- a/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php +++ b/database/migrations/2024_09_24_194122_create_omexsiccatititles_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omexsiccatititles', function (Blueprint $table) { $table->increments('ometid'); $table->string('title', 150)->index('index_exsiccatititle'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omexsiccatititles'); } }; diff --git a/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php b/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php index a715a4b..e5039d8 100644 --- a/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php +++ b/database/migrations/2024_09_24_194122_create_ommaterialsample_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('ommaterialsample', function (Blueprint $table) { $table->increments('matSampleID'); $table->unsignedInteger('occid')->index('fk_ommatsample_occid_idx'); @@ -36,8 +34,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('ommaterialsample'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php index f992c43..8ab7bba 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuraccess_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuraccess', function (Blueprint $table) { $table->bigIncrements('occurAccessID'); $table->string('ipaddress', 45); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuraccess'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php index 7a8a2d9..854aac8 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesslink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuraccesslink', function (Blueprint $table) { $table->unsignedBigInteger('occurAccessID'); $table->unsignedInteger('occid'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuraccesslink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php index f1af7b3..09e04b8 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesssummary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuraccesssummary', function (Blueprint $table) { $table->bigIncrements('oasid'); $table->string('ipaddress', 45); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuraccesssummary'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php b/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php index 5ed1771..63e08f4 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuraccesssummarylink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuraccesssummarylink', function (Blueprint $table) { $table->unsignedBigInteger('oasid'); $table->unsignedInteger('occid')->index('omoccuraccesssummarylink_occid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuraccesssummarylink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php b/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php index 7308952..398149f 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurarchive_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurarchive', function (Blueprint $table) { $table->increments('archiveID'); $table->text('archiveObj'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurarchive'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php b/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php index 055d9ad..b6de6d5 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurassociations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurassociations', function (Blueprint $table) { $table->increments('associd'); $table->unsignedInteger('occid')->index('ix_ossococcur_occid'); @@ -50,8 +48,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurassociations'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php b/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php index 5525c8b..947303b 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurcomments_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurcomments', function (Blueprint $table) { $table->integer('comid', true); $table->unsignedInteger('occid')->index('fk_omoccurcomments_occid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurcomments'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php b/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php index 58a2eb9..8ccd07c 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurdatasetlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurdatasetlink', function (Blueprint $table) { $table->unsignedInteger('occid')->index('fk_omoccurdatasetlink_occid'); $table->unsignedInteger('datasetid')->index('fk_omoccurdatasetlink_datasetid'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurdatasetlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php b/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php index 1162b22..714859b 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurdatasets_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurdatasets', function (Blueprint $table) { $table->increments('datasetID'); $table->string('datasetName', 150)->nullable(); @@ -34,8 +32,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurdatasets'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php b/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php index 84d47ee..34aa1cd 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurdeterminations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurdeterminations', function (Blueprint $table) { $table->increments('detid'); $table->unsignedInteger('occid'); @@ -56,8 +54,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurdeterminations'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php b/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php index 6ab6544..14eea7e 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurduplicatelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurduplicatelink', function (Blueprint $table) { $table->unsignedInteger('occid')->index('fk_omoccurdupelink_occid_idx'); $table->integer('duplicateid')->index('fk_omoccurdupelink_dupeid_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurduplicatelink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php b/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php index e1e40e9..fa2483f 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurduplicates_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurduplicates', function (Blueprint $table) { $table->integer('duplicateid', true); $table->string('title', 50); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurduplicates'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php b/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php index 5c6b667..231d9e1 100644 --- a/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccureditlocks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccureditlocks', function (Blueprint $table) { $table->unsignedInteger('occid')->primary(); $table->integer('uid'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccureditlocks'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuredits_table.php b/database/migrations/2024_09_24_194122_create_omoccuredits_table.php index 1cff535..885011c 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuredits_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuredits_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuredits', function (Blueprint $table) { $table->integer('ocedid', true); $table->unsignedInteger('occid')->index('fk_omoccuredits_occid'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuredits'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php b/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php index d129c55..16ed29d 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurexchange_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurexchange', function (Blueprint $table) { $table->increments('exchangeid'); $table->string('identifier', 30)->nullable(); @@ -39,8 +37,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurexchange'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php b/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php index 3e21422..a9c96b8 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurgenetic_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurgenetic', function (Blueprint $table) { $table->integer('idoccurgenetic', true); $table->unsignedInteger('occid')->index('fk_omoccurgenetic'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurgenetic'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php b/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php index bdbdb18..9d210a3 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurgeoindex_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurgeoindex', function (Blueprint $table) { $table->unsignedInteger('tid'); $table->double('decimallatitude'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurgeoindex'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php b/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php index f053f64..a02ee58 100644 --- a/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccuridentifiers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccuridentifiers', function (Blueprint $table) { $table->integer('idomoccuridentifiers', true); $table->unsignedInteger('occid')->index('fk_omoccuridentifiers_occid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccuridentifiers'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloans_table.php b/database/migrations/2024_09_24_194122_create_omoccurloans_table.php index f04289b..8c493a0 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurloans_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurloans_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurloans', function (Blueprint $table) { $table->increments('loanid'); $table->string('loanIdentifierOwn', 30)->nullable(); @@ -50,8 +48,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurloans'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php b/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php index f6d8af8..2dbc546 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurloansattachment_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurloansattachment', function (Blueprint $table) { $table->increments('attachmentid'); $table->unsignedInteger('loanid')->nullable()->index('fk_occurloansattachment_loanid_idx'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurloansattachment'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php b/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php index 562e329..019be6b 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurloanslink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurloanslink', function (Blueprint $table) { $table->unsignedInteger('loanid')->index('fk_occurloanlink_loanid'); $table->unsignedInteger('occid')->index('fk_occurloanlink_occid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurloanslink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php b/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php index c283592..6ed735d 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurloanuser_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurloanuser', function (Blueprint $table) { $table->unsignedInteger('loanid'); $table->unsignedInteger('uid')->index('fk_occurloan_uid_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurloanuser'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php b/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php index 9f33dd4..9fc2e53 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurpaleo_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurpaleo', function (Blueprint $table) { $table->comment('Occurrence Paleo tables'); $table->increments('paleoID'); @@ -46,8 +44,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurpaleo'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php b/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php index f4590ad..4340d2f 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurpaleogts_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurpaleogts', function (Blueprint $table) { $table->increments('gtsid'); $table->string('gtsterm', 45); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurpaleogts'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php b/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php index 9447ddb..04ae7af 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurpoints_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurpoints', function (Blueprint $table) { $table->integer('geoID', true); $table->integer('occid')->unique('occid'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurpoints'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrences_table.php b/database/migrations/2024_09_24_194122_create_omoccurrences_table.php index 9d8602a..0cafdd3 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurrences_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurrences_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurrences', function (Blueprint $table) { $table->increments('occid'); $table->unsignedInteger('collid'); @@ -138,8 +136,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurrences'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php b/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php index a9f427c..aa3d99c 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurrencesfulltext_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurrencesfulltext', function (Blueprint $table) { $table->integer('occid')->primary(); $table->text('locality')->nullable()->fulltext('ft_occur_locality'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurrencesfulltext'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php b/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php index e72f1f7..ac8b1d2 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurrencetypes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurrencetypes', function (Blueprint $table) { $table->increments('occurtypeid'); $table->unsignedInteger('occid')->nullable()->index('fk_occurtype_occid_idx'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurrencetypes'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurresource_table.php b/database/migrations/2024_09_24_194122_create_omoccurresource_table.php index 11ee9e5..ebd25ea 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurresource_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurresource_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurresource', function (Blueprint $table) { $table->increments('resourceID'); $table->unsignedInteger('occid')->index('fk_omoccurresource_occid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurresource'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php b/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php index 3c6c138..2eec6b7 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurrevisions_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurrevisions', function (Blueprint $table) { $table->integer('orid', true); $table->unsignedInteger('occid')->index('fk_omrevisions_occid_idx'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurrevisions'); } }; diff --git a/database/migrations/2024_09_24_194122_create_omoccurverification_table.php b/database/migrations/2024_09_24_194122_create_omoccurverification_table.php index 335e6f2..7962441 100644 --- a/database/migrations/2024_09_24_194122_create_omoccurverification_table.php +++ b/database/migrations/2024_09_24_194122_create_omoccurverification_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('omoccurverification', function (Blueprint $table) { $table->integer('ovsid', true); $table->unsignedInteger('occid')->index('fk_omoccurverification_occid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('omoccurverification'); } }; diff --git a/database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php b/database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php index 81a7229..e6fe90a 100644 --- a/database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php +++ b/database/migrations/2024_09_24_194122_create_password_reset_tokens_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('password_reset_tokens', function (Blueprint $table) { $table->string('email')->primary(); $table->string('token'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('password_reset_tokens'); } }; diff --git a/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php b/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php index 2978f38..a41f8e2 100644 --- a/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php +++ b/database/migrations/2024_09_24_194122_create_personal_access_tokens_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('personal_access_tokens', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('tokenable_type'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('personal_access_tokens'); } }; diff --git a/database/migrations/2024_09_24_194122_create_portalindex_table.php b/database/migrations/2024_09_24_194122_create_portalindex_table.php index e43f47c..b9dd547 100644 --- a/database/migrations/2024_09_24_194122_create_portalindex_table.php +++ b/database/migrations/2024_09_24_194122_create_portalindex_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('portalindex', function (Blueprint $table) { $table->integer('portalID', true); $table->string('portalName', 150); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('portalindex'); } }; diff --git a/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php b/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php index 66421c4..4564ceb 100644 --- a/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php +++ b/database/migrations/2024_09_24_194122_create_portaloccurrences_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('portaloccurrences', function (Blueprint $table) { $table->increments('portalOccurrencesID'); $table->unsignedInteger('occid')->index('fk_portaloccur_occid_idx'); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('portaloccurrences'); } }; diff --git a/database/migrations/2024_09_24_194122_create_portalpublications_table.php b/database/migrations/2024_09_24_194122_create_portalpublications_table.php index 4c07369..c378234 100644 --- a/database/migrations/2024_09_24_194122_create_portalpublications_table.php +++ b/database/migrations/2024_09_24_194122_create_portalpublications_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('portalpublications', function (Blueprint $table) { $table->increments('pubid'); $table->string('pubTitle', 45); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('portalpublications'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php b/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php index 6c8044e..7ea14a9 100644 --- a/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php +++ b/database/migrations/2024_09_24_194122_create_referenceagentlinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referenceagentlinks', function (Blueprint $table) { $table->integer('refid'); $table->integer('agentid'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referenceagentlinks'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php b/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php index cb5412c..041666a 100644 --- a/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php +++ b/database/migrations/2024_09_24_194122_create_referenceauthorlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referenceauthorlink', function (Blueprint $table) { $table->integer('refid')->index('fk_refauthlink_refid_idx'); $table->integer('refauthid')->index('fk_refauthlink_refauthid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referenceauthorlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referenceauthors_table.php b/database/migrations/2024_09_24_194122_create_referenceauthors_table.php index 3e9f96f..c4671a2 100644 --- a/database/migrations/2024_09_24_194122_create_referenceauthors_table.php +++ b/database/migrations/2024_09_24_194122_create_referenceauthors_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referenceauthors', function (Blueprint $table) { $table->integer('refauthorid', true); $table->string('lastname', 100)->index('index_refauthlastname'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referenceauthors'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php b/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php index c9a9a02..f20fd13 100644 --- a/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php +++ b/database/migrations/2024_09_24_194122_create_referencechecklistlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencechecklistlink', function (Blueprint $table) { $table->integer('refid')->index('fk_refcheckllistlink_refid_idx'); $table->unsignedInteger('clid')->index('fk_refcheckllistlink_clid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencechecklistlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php b/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php index edeaa0a..4dc17c5 100644 --- a/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_referencechklsttaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencechklsttaxalink', function (Blueprint $table) { $table->integer('refid'); $table->unsignedInteger('clid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencechklsttaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php b/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php index 3531918..0376a03 100644 --- a/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php +++ b/database/migrations/2024_09_24_194122_create_referencecollectionlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencecollectionlink', function (Blueprint $table) { $table->integer('refid'); $table->unsignedInteger('collid')->index('fk_refcollectionlink_collid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencecollectionlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php b/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php index 10e772f..41bf26d 100644 --- a/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php +++ b/database/migrations/2024_09_24_194122_create_referencedatasetlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencedatasetlink', function (Blueprint $table) { $table->integer('refid'); $table->unsignedInteger('datasetid')->index('fk_refdataset_datasetid_idx'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencedatasetlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referenceobject_table.php b/database/migrations/2024_09_24_194122_create_referenceobject_table.php index 8e9e002..9be5496 100644 --- a/database/migrations/2024_09_24_194122_create_referenceobject_table.php +++ b/database/migrations/2024_09_24_194122_create_referenceobject_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referenceobject', function (Blueprint $table) { $table->integer('refid', true); $table->integer('parentRefId')->nullable()->index('fk_refobj_parentrefid_idx'); @@ -47,8 +45,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referenceobject'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php b/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php index 126e7be..5fdeb8c 100644 --- a/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php +++ b/database/migrations/2024_09_24_194122_create_referenceoccurlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referenceoccurlink', function (Blueprint $table) { $table->integer('refid')->index('fk_refoccurlink_refid_idx'); $table->unsignedInteger('occid')->index('fk_refoccurlink_occid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referenceoccurlink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php b/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php index e272c75..8a4a6ae 100644 --- a/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_referencetaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencetaxalink', function (Blueprint $table) { $table->integer('refid')->index('fk_reftaxalink_refid_idx'); $table->unsignedInteger('tid')->index('fk_reftaxalink_tid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencetaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_referencetype_table.php b/database/migrations/2024_09_24_194122_create_referencetype_table.php index 10cad10..b096394 100644 --- a/database/migrations/2024_09_24_194122_create_referencetype_table.php +++ b/database/migrations/2024_09_24_194122_create_referencetype_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('referencetype', function (Blueprint $table) { $table->integer('ReferenceTypeId', true); $table->string('ReferenceType', 45)->unique('referencetype_unique'); @@ -40,8 +38,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('referencetype'); } }; diff --git a/database/migrations/2024_09_24_194122_create_salixwordstats_table.php b/database/migrations/2024_09_24_194122_create_salixwordstats_table.php index 5ee03fd..ac8c97d 100644 --- a/database/migrations/2024_09_24_194122_create_salixwordstats_table.php +++ b/database/migrations/2024_09_24_194122_create_salixwordstats_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('salixwordstats', function (Blueprint $table) { $table->integer('swsid', true); $table->string('firstword', 45); @@ -35,8 +33,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('salixwordstats'); } }; diff --git a/database/migrations/2024_09_24_194122_create_schemaversion_table.php b/database/migrations/2024_09_24_194122_create_schemaversion_table.php index da39b17..b4a9a59 100644 --- a/database/migrations/2024_09_24_194122_create_schemaversion_table.php +++ b/database/migrations/2024_09_24_194122_create_schemaversion_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('schemaversion', function (Blueprint $table) { $table->integer('id', true); $table->string('versionnumber', 20)->unique('versionnumber_unique'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('schemaversion'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php b/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php index f7a3bba..1fb3ec3 100644 --- a/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocessorprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocessorprojects', function (Blueprint $table) { $table->increments('spprid'); $table->unsignedInteger('collid')->index('fk_specprocessorprojects_coll'); @@ -45,8 +43,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocessorprojects'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php b/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php index ffd4fa4..e7785cf 100644 --- a/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocessorrawlabels_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocessorrawlabels', function (Blueprint $table) { $table->increments('prlid'); $table->unsignedInteger('imgid')->nullable()->index('fk_specproc_images'); @@ -28,8 +26,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocessorrawlabels'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php b/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php index dd6f482..a41c2f3 100644 --- a/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocessorrawlabelsfulltext_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocessorrawlabelsfulltext', function (Blueprint $table) { $table->integer('prlid')->primary(); $table->integer('imgid')->index('index_ocr_imgid'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocessorrawlabelsfulltext'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlp_table.php b/database/migrations/2024_09_24_194122_create_specprocnlp_table.php index 3c63fc0..dd2f5ff 100644 --- a/database/migrations/2024_09_24_194122_create_specprocnlp_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocnlp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocnlp', function (Blueprint $table) { $table->integer('spnlpid', true); $table->string('title', 45); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocnlp'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php b/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php index 3c0161c..51c1ef0 100644 --- a/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocnlpfrag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocnlpfrag', function (Blueprint $table) { $table->integer('spnlpfragid', true); $table->integer('spnlpid')->index('fk_specprocnlpfrag_spnlpid'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocnlpfrag'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php b/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php index 676529e..d52b395 100644 --- a/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocnlpversion_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocnlpversion', function (Blueprint $table) { $table->comment('Archives field name - value pairs of NLP results loading int'); $table->integer('nlpverid', true); @@ -27,8 +25,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocnlpversion'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php b/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php index c8fdc4c..533d36d 100644 --- a/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php +++ b/database/migrations/2024_09_24_194122_create_specprococrfrag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprococrfrag', function (Blueprint $table) { $table->increments('ocrfragid'); $table->unsignedInteger('prlid')->index('fk_specprococrfrag_prlid_idx'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprococrfrag'); } }; diff --git a/database/migrations/2024_09_24_194122_create_specprocstatus_table.php b/database/migrations/2024_09_24_194122_create_specprocstatus_table.php index abab9dc..639e1a5 100644 --- a/database/migrations/2024_09_24_194122_create_specprocstatus_table.php +++ b/database/migrations/2024_09_24_194122_create_specprocstatus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('specprocstatus', function (Blueprint $table) { $table->increments('spsID'); $table->unsignedInteger('occid')->index('specprocstatus_occid_idx'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('specprocstatus'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxa_table.php b/database/migrations/2024_09_24_194122_create_taxa_table.php index c357a58..da3de23 100644 --- a/database/migrations/2024_09_24_194122_create_taxa_table.php +++ b/database/migrations/2024_09_24_194122_create_taxa_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxa', function (Blueprint $table) { $table->increments('tid'); $table->string('kingdomName', 45)->default(''); @@ -46,8 +44,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxa'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php b/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php index 644f44c..bbfa315 100644 --- a/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php +++ b/database/migrations/2024_09_24_194122_create_taxadescrblock_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxadescrblock', function (Blueprint $table) { $table->increments('tdbid'); $table->unsignedInteger('tdProfileID')->index('fk_taxadescrblock_tdprofileid_idx'); @@ -30,8 +28,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxadescrblock'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php b/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php index db32a1a..5c11afe 100644 --- a/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php +++ b/database/migrations/2024_09_24_194122_create_taxadescrprofile_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxadescrprofile', function (Blueprint $table) { $table->increments('tdProfileID'); $table->string('title', 150); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxadescrprofile'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php b/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php index 3be99f8..377d5b5 100644 --- a/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php +++ b/database/migrations/2024_09_24_194122_create_taxadescrstmts_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxadescrstmts', function (Blueprint $table) { $table->increments('tdsid'); $table->unsignedInteger('tdbid')->index('fk_taxadescrstmts_tblock'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxadescrstmts'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php b/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php index 7cea5d6..0e1cd0a 100644 --- a/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaenumtree_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaenumtree', function (Blueprint $table) { $table->unsignedInteger('tid')->index('fk_tet_taxa'); $table->unsignedInteger('taxauthid')->index('fk_tet_taxauth'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaenumtree'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxalinks_table.php b/database/migrations/2024_09_24_194122_create_taxalinks_table.php index b68fbc6..b656f57 100644 --- a/database/migrations/2024_09_24_194122_create_taxalinks_table.php +++ b/database/migrations/2024_09_24_194122_create_taxalinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxalinks', function (Blueprint $table) { $table->increments('tlid'); $table->unsignedInteger('tid')->index('fk_taxalinks_tid'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxalinks'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxamaps_table.php b/database/migrations/2024_09_24_194122_create_taxamaps_table.php index 24e5954..6105e5d 100644 --- a/database/migrations/2024_09_24_194122_create_taxamaps_table.php +++ b/database/migrations/2024_09_24_194122_create_taxamaps_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxamaps', function (Blueprint $table) { $table->increments('mid'); $table->unsignedInteger('tid')->index('fk_tid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxamaps'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php b/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php index 5cdaffc..fd40c5e 100644 --- a/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php +++ b/database/migrations/2024_09_24_194122_create_taxanestedtree_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxanestedtree', function (Blueprint $table) { $table->unsignedInteger('tid')->index('fk_tnt_taxa'); $table->unsignedInteger('taxauthid')->index('fk_tnt_taxauth'); @@ -25,8 +23,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxanestedtree'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php index 850029a..be21b32 100644 --- a/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubdesclink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaprofilepubdesclink', function (Blueprint $table) { $table->unsignedInteger('tdbid'); $table->integer('tppid')->index('fk_tppubdesclink_id_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaprofilepubdesclink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php index 0f7e62d..109432b 100644 --- a/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubimagelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaprofilepubimagelink', function (Blueprint $table) { $table->unsignedInteger('imgid'); $table->integer('tppid')->index('fk_tppubimagelink_id_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaprofilepubimagelink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php index 4d2ea7c..036db1c 100644 --- a/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubmaplink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaprofilepubmaplink', function (Blueprint $table) { $table->unsignedInteger('mid'); $table->integer('tppid')->index('fk_tppubmaplink_id_idx'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaprofilepubmaplink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php b/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php index 381c9d1..882e527 100644 --- a/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaprofilepubs_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaprofilepubs', function (Blueprint $table) { $table->integer('tppid', true); $table->string('pubtitle', 150)->index('index_taxaprofilepubs_title'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaprofilepubs'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php b/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php index b617dbf..d68f872 100644 --- a/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php +++ b/database/migrations/2024_09_24_194122_create_taxaresourcelinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxaresourcelinks', function (Blueprint $table) { $table->integer('taxaresourceid', true); $table->unsignedInteger('tid')->index('fk_taxaresource_tid_idx'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxaresourcelinks'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxauthority_table.php b/database/migrations/2024_09_24_194122_create_taxauthority_table.php index 9616f59..28bc725 100644 --- a/database/migrations/2024_09_24_194122_create_taxauthority_table.php +++ b/database/migrations/2024_09_24_194122_create_taxauthority_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxauthority', function (Blueprint $table) { $table->increments('taxauthid'); $table->unsignedInteger('isprimary')->default(0); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxauthority'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php b/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php index 7b44df6..e1c97cd 100644 --- a/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php +++ b/database/migrations/2024_09_24_194122_create_taxavernaculars_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxavernaculars', function (Blueprint $table) { $table->unsignedInteger('TID')->default(0)->index('tid1'); $table->string('VernacularName', 80)->index('vernacularsnames'); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxavernaculars'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxonunits_table.php b/database/migrations/2024_09_24_194122_create_taxonunits_table.php index 7670a90..4c968c6 100644 --- a/database/migrations/2024_09_24_194122_create_taxonunits_table.php +++ b/database/migrations/2024_09_24_194122_create_taxonunits_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxonunits', function (Blueprint $table) { $table->integer('taxonunitid', true); $table->string('kingdomName', 45)->default('Organism'); @@ -30,8 +28,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxonunits'); } }; diff --git a/database/migrations/2024_09_24_194122_create_taxstatus_table.php b/database/migrations/2024_09_24_194122_create_taxstatus_table.php index 3890eca..09f61cb 100644 --- a/database/migrations/2024_09_24_194122_create_taxstatus_table.php +++ b/database/migrations/2024_09_24_194122_create_taxstatus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('taxstatus', function (Blueprint $table) { $table->unsignedInteger('tid')->index('index_tid'); $table->unsignedInteger('tidaccepted')->index('fk_taxstatus_tidacc'); @@ -34,8 +32,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('taxstatus'); } }; diff --git a/database/migrations/2024_09_24_194122_create_tmattributes_table.php b/database/migrations/2024_09_24_194122_create_tmattributes_table.php index 99a7a9c..81d39b0 100644 --- a/database/migrations/2024_09_24_194122_create_tmattributes_table.php +++ b/database/migrations/2024_09_24_194122_create_tmattributes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('tmattributes', function (Blueprint $table) { $table->unsignedInteger('stateid')->index('fk_tmattr_stateid_idx'); $table->unsignedInteger('occid')->index('fk_tmattr_occid_idx'); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('tmattributes'); } }; diff --git a/database/migrations/2024_09_24_194122_create_tmstates_table.php b/database/migrations/2024_09_24_194122_create_tmstates_table.php index f462132..38f2d88 100644 --- a/database/migrations/2024_09_24_194122_create_tmstates_table.php +++ b/database/migrations/2024_09_24_194122_create_tmstates_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('tmstates', function (Blueprint $table) { $table->increments('stateid'); $table->unsignedInteger('traitid'); @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('tmstates'); } }; diff --git a/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php b/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php index 0574d84..8ef14f9 100644 --- a/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php +++ b/database/migrations/2024_09_24_194122_create_tmtraitdependencies_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('tmtraitdependencies', function (Blueprint $table) { $table->unsignedInteger('traitid')->index('fk_tmdepend_traitid_idx'); $table->unsignedInteger('parentstateid')->index('fk_tmdepend_stateid_idx'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('tmtraitdependencies'); } }; diff --git a/database/migrations/2024_09_24_194122_create_tmtraits_table.php b/database/migrations/2024_09_24_194122_create_tmtraits_table.php index 8230597..d4d3aad 100644 --- a/database/migrations/2024_09_24_194122_create_tmtraits_table.php +++ b/database/migrations/2024_09_24_194122_create_tmtraits_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('tmtraits', function (Blueprint $table) { $table->increments('traitid'); $table->string('traitname', 100)->index('traitsname'); @@ -33,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('tmtraits'); } }; diff --git a/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php b/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php index 1622e31..429c4fc 100644 --- a/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php +++ b/database/migrations/2024_09_24_194122_create_tmtraittaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('tmtraittaxalink', function (Blueprint $table) { $table->unsignedInteger('traitid')->index('fk_traittaxalink_traitid_idx'); $table->unsignedInteger('tid')->index('fk_traittaxalink_tid_idx'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('tmtraittaxalink'); } }; diff --git a/database/migrations/2024_09_24_194122_create_unknowncomments_table.php b/database/migrations/2024_09_24_194122_create_unknowncomments_table.php index 5a31f74..26fb7b3 100644 --- a/database/migrations/2024_09_24_194122_create_unknowncomments_table.php +++ b/database/migrations/2024_09_24_194122_create_unknowncomments_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('unknowncomments', function (Blueprint $table) { $table->increments('unkcomid'); $table->unsignedInteger('unkid')->index('fk_unknowncomments'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('unknowncomments'); } }; diff --git a/database/migrations/2024_09_24_194122_create_unknownimages_table.php b/database/migrations/2024_09_24_194122_create_unknownimages_table.php index a1c0b95..e4798dd 100644 --- a/database/migrations/2024_09_24_194122_create_unknownimages_table.php +++ b/database/migrations/2024_09_24_194122_create_unknownimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('unknownimages', function (Blueprint $table) { $table->increments('unkimgid'); $table->unsignedInteger('unkid')->index('fk_unknowns'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('unknownimages'); } }; diff --git a/database/migrations/2024_09_24_194122_create_unknowns_table.php b/database/migrations/2024_09_24_194122_create_unknowns_table.php index ccbfc80..4e01613 100644 --- a/database/migrations/2024_09_24_194122_create_unknowns_table.php +++ b/database/migrations/2024_09_24_194122_create_unknowns_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('unknowns', function (Blueprint $table) { $table->increments('unkid'); $table->unsignedInteger('tid')->nullable()->index('fk_unknowns_tid'); @@ -29,8 +27,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('unknowns'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php b/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php index 6fe72a4..6da680e 100644 --- a/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php +++ b/database/migrations/2024_09_24_194122_create_uploaddetermtemp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploaddetermtemp', function (Blueprint $table) { $table->unsignedInteger('occid')->nullable()->index('index_uploaddet_occid'); $table->unsignedInteger('collid')->nullable()->index('index_uploaddet_collid'); @@ -45,8 +43,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploaddetermtemp'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadglossary_table.php b/database/migrations/2024_09_24_194122_create_uploadglossary_table.php index 8fbb2e7..d465980 100644 --- a/database/migrations/2024_09_24_194122_create_uploadglossary_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadglossary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadglossary', function (Blueprint $table) { $table->string('term', 150)->nullable()->index('term_index'); $table->string('definition', 1000)->nullable(); @@ -31,8 +29,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadglossary'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php b/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php index 4c68c2e..4a70db9 100644 --- a/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadimagetemp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadimagetemp', function (Blueprint $table) { $table->unsignedInteger('tid')->nullable(); $table->string('url')->nullable(); @@ -43,8 +41,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadimagetemp'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php b/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php index 477a501..61d57aa 100644 --- a/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadspecmap_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadspecmap', function (Blueprint $table) { $table->increments('usmid'); $table->unsignedInteger('uspid'); @@ -26,8 +24,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadspecmap'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php b/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php index 36ce987..355da7d 100644 --- a/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadspecparameters_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadspecparameters', function (Blueprint $table) { $table->increments('uspid'); $table->unsignedInteger('collid')->index('fk_uploadspecparameters_coll'); @@ -39,8 +37,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadspecparameters'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php b/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php index d5d05f7..8ded95d 100644 --- a/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadspectemp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadspectemp', function (Blueprint $table) { $table->unsignedInteger('collid')->index('fk_uploadspectemp_coll'); $table->string('dbpk', 150)->nullable()->index('index_uploadspectemp_dbpk'); @@ -175,8 +173,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadspectemp'); } }; diff --git a/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php b/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php index cd9fd6d..68bc013 100644 --- a/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php +++ b/database/migrations/2024_09_24_194122_create_uploadtaxa_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('uploadtaxa', function (Blueprint $table) { $table->unsignedInteger('TID')->nullable(); $table->unsignedInteger('SourceId')->nullable()->index('sourceid_index'); @@ -52,8 +50,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('uploadtaxa'); } }; diff --git a/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php b/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php index ca0526d..e264069 100644 --- a/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php +++ b/database/migrations/2024_09_24_194122_create_useraccesstokens_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('useraccesstokens', function (Blueprint $table) { $table->integer('tokenID', true); $table->unsignedInteger('uid')->index('fk_useraccesstokens_uid_idx'); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('useraccesstokens'); } }; diff --git a/database/migrations/2024_09_24_194122_create_userlogin_table.php b/database/migrations/2024_09_24_194122_create_userlogin_table.php index 796196e..98ed4dd 100644 --- a/database/migrations/2024_09_24_194122_create_userlogin_table.php +++ b/database/migrations/2024_09_24_194122_create_userlogin_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('userlogin', function (Blueprint $table) { $table->unsignedInteger('uid')->index('fk_login_user'); $table->string('username', 45)->primary(); @@ -24,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('userlogin'); } }; diff --git a/database/migrations/2024_09_24_194122_create_userroles_table.php b/database/migrations/2024_09_24_194122_create_userroles_table.php index 951f825..6778400 100644 --- a/database/migrations/2024_09_24_194122_create_userroles_table.php +++ b/database/migrations/2024_09_24_194122_create_userroles_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('userroles', function (Blueprint $table) { $table->increments('userRoleID'); $table->unsignedInteger('uid')->index('fk_userroles_uid_idx'); @@ -30,8 +28,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('userroles'); } }; diff --git a/database/migrations/2024_09_24_194122_create_users_table.php b/database/migrations/2024_09_24_194122_create_users_table.php index 4744341..28d0d5a 100644 --- a/database/migrations/2024_09_24_194122_create_users_table.php +++ b/database/migrations/2024_09_24_194122_create_users_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('users', function (Blueprint $table) { $table->increments('uid'); $table->string('firstName', 45)->nullable(); @@ -52,8 +50,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('users'); } }; diff --git a/database/migrations/2024_09_24_194122_create_users_table_add_two_factor_columns.php b/database/migrations/2024_09_24_194122_create_users_table_add_two_factor_columns.php index b490e24..157255d 100644 --- a/database/migrations/2024_09_24_194122_create_users_table_add_two_factor_columns.php +++ b/database/migrations/2024_09_24_194122_create_users_table_add_two_factor_columns.php @@ -5,13 +5,11 @@ use Illuminate\Support\Facades\Schema; use Laravel\Fortify\Fortify; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->text('two_factor_secret') ->after('password') @@ -32,8 +30,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn(array_merge([ 'two_factor_secret', diff --git a/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php b/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php index 6d47fb7..00ee454 100644 --- a/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php +++ b/database/migrations/2024_09_24_194122_create_usertaxonomy_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::create('usertaxonomy', function (Blueprint $table) { $table->integer('idusertaxonomy', true); $table->unsignedInteger('uid')->index('fk_usertaxonomy_uid_idx'); @@ -30,8 +28,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::dropIfExists('usertaxonomy'); } }; diff --git a/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php b/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php index 450ed21..1894e06 100644 --- a/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php +++ b/database/migrations/2024_09_24_194124_create_insertGeographicPolygon_proc.php @@ -3,24 +3,21 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { - DB::unprepared("CREATE PROCEDURE `insertGeographicPolygon`(IN geo_id int, IN geo_json longtext) + public function up(): void { + DB::unprepared('CREATE PROCEDURE `insertGeographicPolygon`(IN geo_id int, IN geo_json longtext) BEGIN INSERT INTO geographicpolygon (geoThesID, footprintPolygon, geoJSON) VALUES (geo_id, ST_GeomFromGeoJSON(geo_json), geo_json); - END"); + END'); } /** * Reverse the migrations. */ - public function down(): void - { - DB::unprepared("DROP PROCEDURE IF EXISTS insertGeographicPolygon"); + public function down(): void { + DB::unprepared('DROP PROCEDURE IF EXISTS insertGeographicPolygon'); } }; diff --git a/database/migrations/2024_09_24_194124_create_updateGeographicPolygon_proc.php b/database/migrations/2024_09_24_194124_create_updateGeographicPolygon_proc.php index fb9ab3b..05918fd 100644 --- a/database/migrations/2024_09_24_194124_create_updateGeographicPolygon_proc.php +++ b/database/migrations/2024_09_24_194124_create_updateGeographicPolygon_proc.php @@ -3,24 +3,21 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { - DB::unprepared("CREATE PROCEDURE `updateGeographicPolygon`(IN geo_id int, IN geo_json longtext) + public function up(): void { + DB::unprepared('CREATE PROCEDURE `updateGeographicPolygon`(IN geo_id int, IN geo_json longtext) BEGIN UPDATE geographicpolygon SET geoJSON = geo_json, footprintPolygon = ST_GeomFromGeoJSON(geo_json) WHERE geoThesID = geo_id; - END"); + END'); } /** * Reverse the migrations. */ - public function down(): void - { - DB::unprepared("DROP PROCEDURE IF EXISTS updateGeographicPolygon"); + public function down(): void { + DB::unprepared('DROP PROCEDURE IF EXISTS updateGeographicPolygon'); } }; diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_actionrequest_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_actionrequest_table.php index a8343d4..9c2e3cb 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_actionrequest_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_actionrequest_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('actionrequest', function (Blueprint $table) { $table->foreign(['requesttype'], 'FK_actionreq_type')->references(['requesttype'])->on('actionrequesttype')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid_requestor'], 'FK_actionreq_uid1')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('actionrequest', function (Blueprint $table) { $table->dropForeign('FK_actionreq_type'); $table->dropForeign('FK_actionreq_uid1'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php index 134b04f..1ed166a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminconfig_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('adminconfig', function (Blueprint $table) { $table->foreign(['modifiedUid'], 'FK_adminConfig_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('adminconfig', function (Blueprint $table) { $table->dropForeign('FK_adminConfig_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php index 816f927..2647c6e 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_adminstats_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('adminstats', function (Blueprint $table) { $table->foreign(['collid'], 'FK_adminstats_collid')->references(['CollID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid'], 'FK_adminstats_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('adminstats', function (Blueprint $table) { $table->dropForeign('FK_adminstats_collid'); $table->dropForeign('FK_adminstats_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php index 537b629..b51e4f1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentdeterminationlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentdeterminationlink', function (Blueprint $table) { $table->foreign(['agentID'], 'FK_agentdetlink_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_agentdetlink_created')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentdeterminationlink', function (Blueprint $table) { $table->dropForeign('FK_agentdetlink_agentID'); $table->dropForeign('FK_agentdetlink_created'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php index 05b5a95..3c73f27 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentlinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentlinks', function (Blueprint $table) { $table->foreign(['agentID'], 'FK_agentlinks_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_agentlinks_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentlinks', function (Blueprint $table) { $table->dropForeign('FK_agentlinks_agentID'); $table->dropForeign('FK_agentlinks_createdUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php index c250f26..f6471d4 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnames_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentnames', function (Blueprint $table) { $table->foreign(['agentID'], 'FK_agentnames_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentnames', function (Blueprint $table) { $table->dropForeign('FK_agentnames_agentID'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php index 06aa82b..525f1a3 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentnumberpattern_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentnumberpattern', function (Blueprint $table) { $table->foreign(['agentID'], 'agentnumberpattern_ibfk_1')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentnumberpattern', function (Blueprint $table) { $table->dropForeign('agentnumberpattern_ibfk_1'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php index 3b9d050..cd5a8c0 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentoccurrencelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentoccurrencelink', function (Blueprint $table) { $table->foreign(['agentID'], 'FK_agentoccurlink_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_agentoccurlink_created')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentoccurrencelink', function (Blueprint $table) { $table->dropForeign('FK_agentoccurlink_agentID'); $table->dropForeign('FK_agentoccurlink_created'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php index 43edcba..4461ebb 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentrelations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentrelations', function (Blueprint $table) { $table->foreign(['createdUid'], 'FK_agentrelations_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['fromAgentID'], 'FK_agentrelations_ibfk_1')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('cascade'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentrelations', function (Blueprint $table) { $table->dropForeign('FK_agentrelations_createUid'); $table->dropForeign('FK_agentrelations_ibfk_1'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php index efe0bc8..cbe697d 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agents_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agents', function (Blueprint $table) { $table->foreign(['createdUid'], 'FK_agents_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['modifiedUid'], 'FK_agents_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agents', function (Blueprint $table) { $table->dropForeign('FK_agents_createdUid'); $table->dropForeign('FK_agents_modUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php index 6eb773b..f53d70b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_agentteams_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('agentteams', function (Blueprint $table) { $table->foreign(['memberAgentID'], 'FK_agentteams_memberAgentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('no action'); $table->foreign(['teamAgentID'], 'FK_agentteams_teamAgentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('no action'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('agentteams', function (Blueprint $table) { $table->dropForeign('FK_agentteams_memberAgentID'); $table->dropForeign('FK_agentteams_teamAgentID'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php index 1652709..becf253 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_chotomouskey_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('chotomouskey', function (Blueprint $table) { $table->foreign(['tid'], 'FK_chotomouskey_taxa')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('chotomouskey', function (Blueprint $table) { $table->dropForeign('FK_chotomouskey_taxa'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php index 0d3ce18..82d610a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_configpageattributes_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('configpageattributes', function (Blueprint $table) { $table->foreign(['configpageid'], 'FK_configpageattributes_id')->references(['configpageid'])->on('configpage')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('configpageattributes', function (Blueprint $table) { $table->dropForeign('FK_configpageattributes_id'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php index 64bf252..fd61171 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocab_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('ctcontrolvocab', function (Blueprint $table) { $table->foreign(['collid'], 'FK_ctControlVocab_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_ctControlVocab_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('ctcontrolvocab', function (Blueprint $table) { $table->dropForeign('FK_ctControlVocab_collid'); $table->dropForeign('FK_ctControlVocab_createUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php index 608cc04..2491a7f 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ctcontrolvocabterm_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('ctcontrolvocabterm', function (Blueprint $table) { $table->foreign(['createdUid'], 'FK_ctControlVocabTerm_createUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['cvID'], 'FK_ctControlVocabTerm_cvID')->references(['cvID'])->on('ctcontrolvocab')->onUpdate('cascade')->onDelete('cascade'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('ctcontrolvocabterm', function (Blueprint $table) { $table->dropForeign('FK_ctControlVocabTerm_createUid'); $table->dropForeign('FK_ctControlVocabTerm_cvID'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php index 3596722..bf000bd 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchecklists_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmchecklists', function (Blueprint $table) { $table->foreign(['uid'], 'FK_checklists_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmchecklists', function (Blueprint $table) { $table->dropForeign('FK_checklists_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php index 7ea9c9f..3734015 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstchildren_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmchklstchildren', function (Blueprint $table) { $table->foreign(['clidchild'], 'FK_fmchklstchild_child')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['clid'], 'FK_fmchklstchild_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmchklstchildren', function (Blueprint $table) { $table->dropForeign('FK_fmchklstchild_child'); $table->dropForeign('FK_fmchklstchild_clid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php index 37fe454..4cee517 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstcoordinates_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmchklstcoordinates', function (Blueprint $table) { $table->foreign(['clid'], 'FK_checklistCoord_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_checklistCoord_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmchklstcoordinates', function (Blueprint $table) { $table->dropForeign('FK_checklistCoord_clid'); $table->dropForeign('FK_checklistCoord_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php index 6347558..2ef8271 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklstprojlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmchklstprojlink', function (Blueprint $table) { $table->foreign(['clid'], 'FK_chklstprojlink_clid')->references(['clid'])->on('fmchecklists')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['pid'], 'FK_chklstprojlink_proj')->references(['pid'])->on('fmprojects')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmchklstprojlink', function (Blueprint $table) { $table->dropForeign('FK_chklstprojlink_clid'); $table->dropForeign('FK_chklstprojlink_proj'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php index f79f577..9a8d8e7 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmchklsttaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmchklsttaxalink', function (Blueprint $table) { $table->foreign(['clid'], 'FK_chklsttaxalink_cid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_chklsttaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmchklsttaxalink', function (Blueprint $table) { $table->dropForeign('FK_chklsttaxalink_cid'); $table->dropForeign('FK_chklsttaxalink_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php index 7ff2949..f01f6b8 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmdyncltaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmdyncltaxalink', function (Blueprint $table) { $table->foreign(['dynclid'], 'FK_dyncltaxalink_dynclid')->references(['dynclid'])->on('fmdynamicchecklists')->onUpdate('restrict')->onDelete('cascade'); $table->foreign(['tid'], 'FK_dyncltaxalink_taxa')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmdyncltaxalink', function (Blueprint $table) { $table->dropForeign('FK_dyncltaxalink_dynclid'); $table->dropForeign('FK_dyncltaxalink_taxa'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php index b74640e..42c5617 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojectcategories_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmprojectcategories', function (Blueprint $table) { $table->foreign(['pid'], 'FK_fmprojcat_pid')->references(['pid'])->on('fmprojects')->onUpdate('no action')->onDelete('no action'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmprojectcategories', function (Blueprint $table) { $table->dropForeign('FK_fmprojcat_pid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php index bb625d1..8d32fa0 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmprojects', function (Blueprint $table) { $table->foreign(['parentpid'], 'FK_parentpid_proj')->references(['pid'])->on('fmprojects')->onUpdate('no action')->onDelete('no action'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmprojects', function (Blueprint $table) { $table->dropForeign('FK_parentpid_proj'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php index f9e53c7..f469979 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_fmvouchers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('fmvouchers', function (Blueprint $table) { $table->foreign(['clTaxaID'], 'FK_fmvouchers_tidclid')->references(['clTaxaID'])->on('fmchklsttaxalink')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('fmvouchers', function (Blueprint $table) { $table->dropForeign('FK_fmvouchers_tidclid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php index cf9b27e..90c9211 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_geographicthesaurus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('geographicthesaurus', function (Blueprint $table) { $table->foreign(['acceptedID'], 'FK_geothes_acceptedID')->references(['geoThesID'])->on('geographicthesaurus')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['parentID'], 'FK_geothes_parentID')->references(['geoThesID'])->on('geographicthesaurus')->onUpdate('cascade')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('geographicthesaurus', function (Blueprint $table) { $table->dropForeign('FK_geothes_acceptedID'); $table->dropForeign('FK_geothes_parentID'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php index 18c7f66..5659815 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossary', function (Blueprint $table) { $table->foreign(['uid'], 'FK_glossary_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossary', function (Blueprint $table) { $table->dropForeign('FK_glossary_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php index 34af517..8db830f 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategory_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossarycategory', function (Blueprint $table) { $table->foreign(['langID'], 'FK_glossarycategory_lang')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['parentCatID'], 'FK_glossarycategory_parentCatID')->references(['glossCatID'])->on('glossarycategory')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossarycategory', function (Blueprint $table) { $table->dropForeign('FK_glossarycategory_lang'); $table->dropForeign('FK_glossarycategory_parentCatID'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php index 7de3a49..c78ed21 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarycategorylink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossarycategorylink', function (Blueprint $table) { $table->foreign(['glossCatID'], 'FK_glossCatLink_glossCatID')->references(['glossCatID'])->on('glossarycategory')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['glossID'], 'FK_glossCatLink_glossID')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossarycategorylink', function (Blueprint $table) { $table->dropForeign('FK_glossCatLink_glossCatID'); $table->dropForeign('FK_glossCatLink_glossID'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php index 50fd6d8..7ed580a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossaryimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossaryimages', function (Blueprint $table) { $table->foreign(['glossid'], 'FK_glossaryimages_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid'], 'FK_glossaryimages_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossaryimages', function (Blueprint $table) { $table->dropForeign('FK_glossaryimages_glossid'); $table->dropForeign('FK_glossaryimages_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php index eed0305..1a0acef 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossarytaxalink', function (Blueprint $table) { $table->foreign(['glossid'], 'FK_glossarytaxa_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_glossarytaxa_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossarytaxalink', function (Blueprint $table) { $table->dropForeign('FK_glossarytaxa_glossid'); $table->dropForeign('FK_glossarytaxa_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php index 3d2eaf4..e980085 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_glossarytermlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('glossarytermlink', function (Blueprint $table) { $table->foreign(['glossgrpid'], 'FK_glossarytermlink_glossgrpid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['glossid'], 'FK_glossarytermlink_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('glossarytermlink', function (Blueprint $table) { $table->dropForeign('FK_glossarytermlink_glossgrpid'); $table->dropForeign('FK_glossarytermlink_glossid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php index e198233..cff1501 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_igsnverification_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('igsnverification', function (Blueprint $table) { $table->foreign(['occidInPortal'], 'FK_igsn_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('igsnverification', function (Blueprint $table) { $table->dropForeign('FK_igsn_occid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php index 2005fcf..2221249 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageannotations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imageannotations', function (Blueprint $table) { $table->foreign(['imgid'], 'FK_resourceannotations_imgid')->references(['imgid'])->on('images')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['tid'], 'FK_resourceannotations_tid')->references(['TID'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imageannotations', function (Blueprint $table) { $table->dropForeign('FK_resourceannotations_imgid'); $table->dropForeign('FK_resourceannotations_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php index 4bff312..8675a54 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagekeywords_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imagekeywords', function (Blueprint $table) { $table->foreign(['imgid'], 'FK_imagekeywords_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uidassignedby'], 'FK_imagekeyword_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imagekeywords', function (Blueprint $table) { $table->dropForeign('FK_imagekeywords_imgid'); $table->dropForeign('FK_imagekeyword_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php index a84c73f..730593e 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojectlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imageprojectlink', function (Blueprint $table) { $table->foreign(['imgid'], 'FK_imageprojectlink_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['imgprojid'], 'FK_imageprojlink_imgprojid')->references(['imgprojid'])->on('imageprojects')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imageprojectlink', function (Blueprint $table) { $table->dropForeign('FK_imageprojectlink_imgid'); $table->dropForeign('FK_imageprojlink_imgprojid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php index 40139fd..497fe73 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imageprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imageprojects', function (Blueprint $table) { $table->foreign(['collid'], 'FK_imageproject_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uidcreated'], 'FK_imageproject_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imageprojects', function (Blueprint $table) { $table->dropForeign('FK_imageproject_collid'); $table->dropForeign('FK_imageproject_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php index 0781711..bfcdc62 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_images_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('images', function (Blueprint $table) { $table->foreign(['occid'], 'FK_images_occ')->references(['occid'])->on('omoccurrences')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['photographerUid'], 'FK_photographeruid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('images', function (Blueprint $table) { $table->dropForeign('FK_images_occ'); $table->dropForeign('FK_photographeruid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php index b860332..16f2c54 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imagetag', function (Blueprint $table) { $table->foreign(['keyvalue'], 'FK_imagetag_tagkey')->references(['tagkey'])->on('imagetagkey')->onUpdate('cascade')->onDelete('no action'); $table->foreign(['imgid'], 'imagetag_ibfk_1')->references(['media_id'])->on('media')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imagetag', function (Blueprint $table) { $table->dropForeign('FK_imagetag_tagkey'); $table->dropForeign('imagetag_ibfk_1'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php index 5aea74d..75bbaf8 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_imagetagkey_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('imagetagkey', function (Blueprint $table) { $table->foreign(['imgTagGroupID'], 'FK_imageTagKey_imgTagGroupID')->references(['imgTagGroupID'])->on('imagetaggroup')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('imagetagkey', function (Blueprint $table) { $table->dropForeign('FK_imageTagKey_imgTagGroupID'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php index 0bdc62e..40fa19a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_institutions_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('institutions', function (Blueprint $table) { $table->foreign(['modifieduid'], 'FK_inst_uid')->references(['uid'])->on('users')->onUpdate('no action')->onDelete('no action'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('institutions', function (Blueprint $table) { $table->dropForeign('FK_inst_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php index 21d0702..ee944bd 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacterlang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcharacterlang', function (Blueprint $table) { $table->foreign(['cid'], 'FK_characterlang_1')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['langid'], 'FK_charlang_lang')->references(['langid'])->on('adminlanguages')->onUpdate('no action')->onDelete('no action'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcharacterlang', function (Blueprint $table) { $table->dropForeign('FK_characterlang_1'); $table->dropForeign('FK_charlang_lang'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php index 937639f..41c46a9 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharacters_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcharacters', function (Blueprint $table) { $table->foreign(['hid'], 'FK_charheading')->references(['hid'])->on('kmcharheading')->onUpdate('cascade')->onDelete('restrict'); $table->foreign(['glossid'], 'FK_kmchar_glossary')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcharacters', function (Blueprint $table) { $table->dropForeign('FK_charheading'); $table->dropForeign('FK_kmchar_glossary'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php index 9e78a9f..102d0f1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchardependance_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmchardependance', function (Blueprint $table) { $table->foreign(['CID'], 'FK_chardependance_cid')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['CIDDependance', 'CSDependance'], 'FK_chardependance_cs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmchardependance', function (Blueprint $table) { $table->dropForeign('FK_chardependance_cid'); $table->dropForeign('FK_chardependance_cs'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php index 6e35f5e..e394ff4 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheading_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcharheading', function (Blueprint $table) { $table->foreign(['langid'], 'FK_kmcharheading_lang')->references(['langid'])->on('adminlanguages')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcharheading', function (Blueprint $table) { $table->dropForeign('FK_kmcharheading_lang'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php index 73bac1b..b5c6ec5 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcharheadinglang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcharheadinglang', function (Blueprint $table) { $table->foreign(['hid'], 'FK_kmcharheadinglang_hid')->references(['hid'])->on('kmcharheading')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['langid'], 'FK_kmcharheadinglang_langid')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcharheadinglang', function (Blueprint $table) { $table->dropForeign('FK_kmcharheadinglang_hid'); $table->dropForeign('FK_kmcharheadinglang_langid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php index 9c5c321..08e548c 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmchartaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmchartaxalink', function (Blueprint $table) { $table->foreign(['CID'], 'FK_chartaxalink_cid')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['TID'], 'FK_chartaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmchartaxalink', function (Blueprint $table) { $table->dropForeign('FK_chartaxalink_cid'); $table->dropForeign('FK_chartaxalink_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php index e13c6a1..a687892 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcs_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcs', function (Blueprint $table) { $table->foreign(['cid'], 'FK_cs_chars')->references(['cid'])->on('kmcharacters')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['glossid'], 'FK_kmcs_glossid')->references(['glossid'])->on('glossary')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcs', function (Blueprint $table) { $table->dropForeign('FK_cs_chars'); $table->dropForeign('FK_kmcs_glossid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php index 035aedc..412061a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcsimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcsimages', function (Blueprint $table) { $table->foreign(['cid', 'cs'], 'FK_kscsimages_kscs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcsimages', function (Blueprint $table) { $table->dropForeign('FK_kscsimages_kscs'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php index 26d25e7..88ea858 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmcslang_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmcslang', function (Blueprint $table) { $table->foreign(['cid', 'cs'], 'FK_cslang_1')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['langid'], 'FK_cslang_lang')->references(['langid'])->on('adminlanguages')->onUpdate('no action')->onDelete('no action'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmcslang', function (Blueprint $table) { $table->dropForeign('FK_cslang_1'); $table->dropForeign('FK_cslang_lang'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php index 1c53b87..4ed3de5 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_kmdescr_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('kmdescr', function (Blueprint $table) { $table->foreign(['CID', 'CS'], 'FK_descr_cs')->references(['cid', 'cs'])->on('kmcs')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['TID'], 'FK_descr_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('kmdescr', function (Blueprint $table) { $table->dropForeign('FK_descr_cs'); $table->dropForeign('FK_descr_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php index b96450c..87e5512 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupcounty_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('lkupcounty', function (Blueprint $table) { $table->foreign(['stateId'], 'fk_stateprovince')->references(['stateId'])->on('lkupstateprovince')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('lkupcounty', function (Blueprint $table) { $table->dropForeign('fk_stateprovince'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php index 77c267f..2e2be4c 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupmunicipality_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('lkupmunicipality', function (Blueprint $table) { $table->foreign(['stateId'], 'lkupmunicipality_ibfk_1')->references(['stateId'])->on('lkupstateprovince')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('lkupmunicipality', function (Blueprint $table) { $table->dropForeign('lkupmunicipality_ibfk_1'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php index 6495382..3595d66 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_lkupstateprovince_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('lkupstateprovince', function (Blueprint $table) { $table->foreign(['countryId'], 'fk_country')->references(['countryId'])->on('lkupcountry')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('lkupstateprovince', function (Blueprint $table) { $table->dropForeign('fk_country'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php index ea907b4..88743b3 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_media_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('media', function (Blueprint $table) { $table->foreign(['creatoruid'], 'FK_creator_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['occid'], 'FK_media_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('media', function (Blueprint $table) { $table->dropForeign('FK_creator_uid'); $table->dropForeign('FK_media_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php index 79db079..72b616e 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollcatlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollcatlink', function (Blueprint $table) { $table->foreign(['ccpk'], 'FK_collcatlink_cat')->references(['ccpk'])->on('omcollcategories')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['collid'], 'FK_collcatlink_coll')->references(['CollID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollcatlink', function (Blueprint $table) { $table->dropForeign('FK_collcatlink_cat'); $table->dropForeign('FK_collcatlink_coll'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php index 021d4b6..6e60997 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollections_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollections', function (Blueprint $table) { $table->foreign(['iid'], 'FK_collid_iid')->references(['iid'])->on('institutions')->onUpdate('cascade')->onDelete('set null'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollections', function (Blueprint $table) { $table->dropForeign('FK_collid_iid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php index dfccd88..44550a9 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollectionstats_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollectionstats', function (Blueprint $table) { $table->foreign(['collid'], 'FK_collectionstats_coll')->references(['collID'])->on('omcollections')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollectionstats', function (Blueprint $table) { $table->dropForeign('FK_collectionstats_coll'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php index a8aaf34..2bb2143 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollproperties_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollproperties', function (Blueprint $table) { $table->foreign(['collid'], 'FK_omcollproperties_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['modifiedUid'], 'FK_omcollproperties_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollproperties', function (Blueprint $table) { $table->dropForeign('FK_omcollproperties_collid'); $table->dropForeign('FK_omcollproperties_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php index 3c60ae0..caa6487 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpublications_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollpublications', function (Blueprint $table) { $table->foreign(['collid'], 'FK_adminpub_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollpublications', function (Blueprint $table) { $table->dropForeign('FK_adminpub_collid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php index db02e78..6b39128 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollpuboccurlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollpuboccurlink', function (Blueprint $table) { $table->foreign(['occid'], 'FK_ompuboccid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['pubid'], 'FK_ompubpubid')->references(['pubid'])->on('omcollpublications')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollpuboccurlink', function (Blueprint $table) { $table->dropForeign('FK_ompuboccid'); $table->dropForeign('FK_ompubpubid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php index bd48b43..68eccea 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcollsecondary_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcollsecondary', function (Blueprint $table) { $table->foreign(['collid'], 'FK_omcollsecondary_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcollsecondary', function (Blueprint $table) { $table->dropForeign('FK_omcollsecondary_coll'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php index 4588761..6fccf96 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcecentral_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcrowdsourcecentral', function (Blueprint $table) { $table->foreign(['collid'], 'FK_omcrowdsourcecentral_collid')->references(['collID'])->on('omcollections')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcrowdsourcecentral', function (Blueprint $table) { $table->dropForeign('FK_omcrowdsourcecentral_collid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php index 6b3d8d3..5a7051c 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourceproject_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcrowdsourceproject', function (Blueprint $table) { $table->foreign(['modifiedUid'], 'FK_croudsourceproj_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcrowdsourceproject', function (Blueprint $table) { $table->dropForeign('FK_croudsourceproj_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php index 2914a22..69f919e 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omcrowdsourcequeue_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omcrowdsourcequeue', function (Blueprint $table) { $table->foreign(['csProjID'], 'FK_omcrowdsourcequeue_csProjID')->references(['csProjID'])->on('omcrowdsourceproject')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['occid'], 'FK_omcrowdsourcequeue_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omcrowdsourcequeue', function (Blueprint $table) { $table->dropForeign('FK_omcrowdsourcequeue_csProjID'); $table->dropForeign('FK_omcrowdsourcequeue_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php index c58a670..dff2d01 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatinumbers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omexsiccatinumbers', function (Blueprint $table) { $table->foreign(['ometid'], 'FK_exsiccatiTitleNumber')->references(['ometid'])->on('omexsiccatititles')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omexsiccatinumbers', function (Blueprint $table) { $table->dropForeign('FK_exsiccatiTitleNumber'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php index fdc319f..71e9131 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omexsiccatiocclink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omexsiccatiocclink', function (Blueprint $table) { $table->foreign(['omenid'], 'FKExsiccatiNumOccLink1')->references(['omenid'])->on('omexsiccatinumbers')->onUpdate('restrict')->onDelete('cascade'); $table->foreign(['occid'], 'FKExsiccatiNumOccLink2')->references(['occid'])->on('omoccurrences')->onUpdate('restrict')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omexsiccatiocclink', function (Blueprint $table) { $table->dropForeign('FKExsiccatiNumOccLink1'); $table->dropForeign('FKExsiccatiNumOccLink2'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php index 7306fb2..816c473 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_ommaterialsample_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('ommaterialsample', function (Blueprint $table) { $table->foreign(['occid'], 'FK_ommatsample_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['preparedByUid'], 'FK_ommatsample_prepUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('ommaterialsample', function (Blueprint $table) { $table->dropForeign('FK_ommatsample_occid'); $table->dropForeign('FK_ommatsample_prepUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php index bcad37b..416e311 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuraccesssummarylink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccuraccesssummarylink', function (Blueprint $table) { $table->foreign(['oasid'], 'FK_omoccuraccesssummarylink_oasid')->references(['oasid'])->on('omoccuraccesssummary')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['occid'], 'FK_omoccuraccesssummarylink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccuraccesssummarylink', function (Blueprint $table) { $table->dropForeign('FK_omoccuraccesssummarylink_oasid'); $table->dropForeign('FK_omoccuraccesssummarylink_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php index 3432b1e..1225ea9 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurarchive_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurarchive', function (Blueprint $table) { $table->foreign(['createdUid'], 'FK_occurarchive_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurarchive', function (Blueprint $table) { $table->dropForeign('FK_occurarchive_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php index 885df03..a1c7aa4 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurassociations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurassociations', function (Blueprint $table) { $table->foreign(['occid'], 'FK_occurassoc_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['occidAssociate'], 'FK_occurassoc_occidassoc')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('set null'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurassociations', function (Blueprint $table) { $table->dropForeign('FK_occurassoc_occid'); $table->dropForeign('FK_occurassoc_occidassoc'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php index a1d3781..fb4403b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurcomments_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurcomments', function (Blueprint $table) { $table->foreign(['occid'], 'fk_omoccurcomments_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid'], 'fk_omoccurcomments_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurcomments', function (Blueprint $table) { $table->dropForeign('fk_omoccurcomments_occid'); $table->dropForeign('fk_omoccurcomments_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php index 8e9e8a5..6f1bccb 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasetlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurdatasetlink', function (Blueprint $table) { $table->foreign(['datasetid'], 'FK_omoccurdatasetlink_datasetid')->references(['datasetid'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['occid'], 'FK_omoccurdatasetlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurdatasetlink', function (Blueprint $table) { $table->dropForeign('FK_omoccurdatasetlink_datasetid'); $table->dropForeign('FK_omoccurdatasetlink_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php index 0dea7e5..603ad23 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdatasets_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurdatasets', function (Blueprint $table) { $table->foreign(['collid'], 'FK_omcollections_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['parentDatasetID'], 'FK_omoccurdatasets_parent')->references(['datasetID'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurdatasets', function (Blueprint $table) { $table->dropForeign('FK_omcollections_collid'); $table->dropForeign('FK_omoccurdatasets_parent'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php index 14ee97a..530ab5e 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurdeterminations_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurdeterminations', function (Blueprint $table) { $table->foreign(['identifiedByAgentID'], 'FK_omoccurdets_agentID')->references(['agentID'])->on('agents')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['occid'], 'FK_omoccurdets_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurdeterminations', function (Blueprint $table) { $table->dropForeign('FK_omoccurdets_agentID'); $table->dropForeign('FK_omoccurdets_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php index 49b59ba..6b205f1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurduplicatelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurduplicatelink', function (Blueprint $table) { $table->foreign(['duplicateid'], 'FK_omoccurdupelink_dupeid')->references(['duplicateid'])->on('omoccurduplicates')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['occid'], 'FK_omoccurdupelink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurduplicatelink', function (Blueprint $table) { $table->dropForeign('FK_omoccurdupelink_dupeid'); $table->dropForeign('FK_omoccurdupelink_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php index b48184f..b0c1ef1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuredits_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccuredits', function (Blueprint $table) { $table->foreign(['occid'], 'fk_omoccuredits_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid'], 'fk_omoccuredits_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccuredits', function (Blueprint $table) { $table->dropForeign('fk_omoccuredits_occid'); $table->dropForeign('fk_omoccuredits_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php index 96b65b8..443cacd 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurexchange_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurexchange', function (Blueprint $table) { $table->foreign(['collid'], 'FK_occexch_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurexchange', function (Blueprint $table) { $table->dropForeign('FK_occexch_coll'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php index 05e3d08..55a14aa 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgenetic_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurgenetic', function (Blueprint $table) { $table->foreign(['occid'], 'FK_omoccurgenetic')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurgenetic', function (Blueprint $table) { $table->dropForeign('FK_omoccurgenetic'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php index 6872bed..9c0f9ef 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurgeoindex_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurgeoindex', function (Blueprint $table) { $table->foreign(['tid'], 'FK_specgeoindex_taxa')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurgeoindex', function (Blueprint $table) { $table->dropForeign('FK_specgeoindex_taxa'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php index 8dd9fd7..cae9142 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccuridentifiers_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccuridentifiers', function (Blueprint $table) { $table->foreign(['occid'], 'FK_omoccuridentifiers_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccuridentifiers', function (Blueprint $table) { $table->dropForeign('FK_omoccuridentifiers_occid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php index 6e9ec08..b6f6722 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloans_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurloans', function (Blueprint $table) { $table->foreign(['collidBorr'], 'FK_occurloans_borrcoll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('restrict'); $table->foreign(['iidBorrower'], 'FK_occurloans_borrinst')->references(['iid'])->on('institutions')->onUpdate('cascade')->onDelete('restrict'); @@ -22,8 +20,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurloans', function (Blueprint $table) { $table->dropForeign('FK_occurloans_borrcoll'); $table->dropForeign('FK_occurloans_borrinst'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php index 177bd91..e9cbe03 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloansattachment_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurloansattachment', function (Blueprint $table) { $table->foreign(['exchangeid'], 'FK_occurloansattachment_exchangeid')->references(['exchangeid'])->on('omoccurexchange')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['loanid'], 'FK_occurloansattachment_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurloansattachment', function (Blueprint $table) { $table->dropForeign('FK_occurloansattachment_exchangeid'); $table->dropForeign('FK_occurloansattachment_loanid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php index e396e2d..bc15ea0 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanslink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurloanslink', function (Blueprint $table) { $table->foreign(['loanid'], 'FK_occurloanlink_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['occid'], 'FK_occurloanlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurloanslink', function (Blueprint $table) { $table->dropForeign('FK_occurloanlink_loanid'); $table->dropForeign('FK_occurloanlink_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php index b7f295d..a18a683 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurloanuser_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurloanuser', function (Blueprint $table) { $table->foreign(['loanid'], 'FK_occurloan_loanid')->references(['loanid'])->on('omoccurloans')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['modifiedByUid'], 'FK_occurloan_modifiedByUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurloanuser', function (Blueprint $table) { $table->dropForeign('FK_occurloan_loanid'); $table->dropForeign('FK_occurloan_modifiedByUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php index fb8b06e..78520c3 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleo_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurpaleo', function (Blueprint $table) { $table->foreign(['occid'], 'FK_paleo_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurpaleo', function (Blueprint $table) { $table->dropForeign('FK_paleo_occid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php index d0db547..130998a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurpaleogts_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurpaleogts', function (Blueprint $table) { $table->foreign(['parentgtsid'], 'FK_gtsparent')->references(['gtsid'])->on('omoccurpaleogts')->onUpdate('cascade')->onDelete('no action'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurpaleogts', function (Blueprint $table) { $table->dropForeign('FK_gtsparent'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php index c5978ff..7dfd66d 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurrences_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurrences', function (Blueprint $table) { $table->foreign(['collid'], 'FK_omoccurrences_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurrences', function (Blueprint $table) { $table->dropForeign('FK_omoccurrences_collid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php index 2905c39..1333a17 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurresource_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurresource', function (Blueprint $table) { $table->foreign(['createdUid'], 'FK_omoccurresource_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['modifiedUid'], 'FK_omoccurresource_modUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurresource', function (Blueprint $table) { $table->dropForeign('FK_omoccurresource_createdUid'); $table->dropForeign('FK_omoccurresource_modUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php index 378a2b2..7952e25 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_omoccurverification_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('omoccurverification', function (Blueprint $table) { $table->foreign(['occid'], 'FK_omoccurverification_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uid'], 'FK_omoccurverification_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('omoccurverification', function (Blueprint $table) { $table->dropForeign('FK_omoccurverification_occid'); $table->dropForeign('FK_omoccurverification_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php index 23a2c0b..1971cc3 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portaloccurrences_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('portaloccurrences', function (Blueprint $table) { $table->foreign(['occid'], 'FK_portalOccur_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['pubid'], 'FK_portalOccur_pubid')->references(['pubid'])->on('portalpublications')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('portaloccurrences', function (Blueprint $table) { $table->dropForeign('FK_portalOccur_occid'); $table->dropForeign('FK_portalOccur_pubid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php index e2c120c..d09d8dd 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_portalpublications_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('portalpublications', function (Blueprint $table) { $table->foreign(['collid'], 'FK_portalpub_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_portalpub_createdUid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('restrict'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('portalpublications', function (Blueprint $table) { $table->dropForeign('FK_portalpub_collid'); $table->dropForeign('FK_portalpub_createdUid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php index 604f3dc..dca16a8 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceauthorlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referenceauthorlink', function (Blueprint $table) { $table->foreign(['refauthid'], 'FK_refauthlink_refauthid')->references(['refauthorid'])->on('referenceauthors')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refauthlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referenceauthorlink', function (Blueprint $table) { $table->dropForeign('FK_refauthlink_refauthid'); $table->dropForeign('FK_refauthlink_refid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php index ce74637..e829778 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechecklistlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referencechecklistlink', function (Blueprint $table) { $table->foreign(['clid'], 'FK_refchecklistlink_clid')->references(['clid'])->on('fmchecklists')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refchecklistlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referencechecklistlink', function (Blueprint $table) { $table->dropForeign('FK_refchecklistlink_clid'); $table->dropForeign('FK_refchecklistlink_refid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php index 5dba070..903721c 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencechklsttaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referencechklsttaxalink', function (Blueprint $table) { $table->foreign(['clid', 'tid'], 'FK_refchktaxalink_clidtid')->references(['clid', 'tid'])->on('fmchklsttaxalink')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refchktaxalink_ref')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referencechklsttaxalink', function (Blueprint $table) { $table->dropForeign('FK_refchktaxalink_clidtid'); $table->dropForeign('FK_refchktaxalink_ref'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php index db38197..354ea76 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencecollectionlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referencecollectionlink', function (Blueprint $table) { $table->foreign(['collid'], 'FK_refcollectionlink_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refcollectionlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('no action')->onDelete('no action'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referencecollectionlink', function (Blueprint $table) { $table->dropForeign('FK_refcollectionlink_collid'); $table->dropForeign('FK_refcollectionlink_refid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php index a73771b..1e48580 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencedatasetlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referencedatasetlink', function (Blueprint $table) { $table->foreign(['datasetid'], 'FK_refdataset_datasetid')->references(['datasetID'])->on('omoccurdatasets')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refdataset_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referencedatasetlink', function (Blueprint $table) { $table->dropForeign('FK_refdataset_datasetid'); $table->dropForeign('FK_refdataset_refid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php index 38be082..51c1e93 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceobject_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referenceobject', function (Blueprint $table) { $table->foreign(['parentRefId'], 'FK_refobj_parentrefid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['ReferenceTypeId'], 'FK_refobj_reftypeid')->references(['ReferenceTypeId'])->on('referencetype')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referenceobject', function (Blueprint $table) { $table->dropForeign('FK_refobj_parentrefid'); $table->dropForeign('FK_refobj_reftypeid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php index e7f82c2..50a18e3 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referenceoccurlink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referenceoccurlink', function (Blueprint $table) { $table->foreign(['occid'], 'FK_refoccurlink_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['refid'], 'FK_refoccurlink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referenceoccurlink', function (Blueprint $table) { $table->dropForeign('FK_refoccurlink_occid'); $table->dropForeign('FK_refoccurlink_refid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php index 321b3cf..c6bc0f2 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_referencetaxalink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('referencetaxalink', function (Blueprint $table) { $table->foreign(['refid'], 'FK_reftaxalink_refid')->references(['refid'])->on('referenceobject')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_reftaxalink_tid')->references(['TID'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('referencetaxalink', function (Blueprint $table) { $table->dropForeign('FK_reftaxalink_refid'); $table->dropForeign('FK_reftaxalink_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php index 35e9f8e..069de4b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorprojects_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocessorprojects', function (Blueprint $table) { $table->foreign(['collid'], 'FK_specprocessorprojects_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdByUid'], 'FK_specprocprojects_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocessorprojects', function (Blueprint $table) { $table->dropForeign('FK_specprocessorprojects_coll'); $table->dropForeign('FK_specprocprojects_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php index cd54381..e3ccd17 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocessorrawlabels_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocessorrawlabels', function (Blueprint $table) { $table->foreign(['imgid'], 'FK_specproc_images')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('restrict'); $table->foreign(['occid'], 'FK_specproc_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocessorrawlabels', function (Blueprint $table) { $table->dropForeign('FK_specproc_images'); $table->dropForeign('FK_specproc_occid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php index 7faa5ef..c06e78f 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocnlp', function (Blueprint $table) { $table->foreign(['collid'], 'FK_specprocnlp_collid')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocnlp', function (Blueprint $table) { $table->dropForeign('FK_specprocnlp_collid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php index 9e5d502..17c4590 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpfrag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocnlpfrag', function (Blueprint $table) { $table->foreign(['spnlpid'], 'FK_specprocnlpfrag_spnlpid')->references(['spnlpid'])->on('specprocnlp')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocnlpfrag', function (Blueprint $table) { $table->dropForeign('FK_specprocnlpfrag_spnlpid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php index a202cad..f049436 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocnlpversion_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocnlpversion', function (Blueprint $table) { $table->foreign(['prlid'], 'FK_specprocnlpver_rawtext')->references(['prlid'])->on('specprocessorrawlabels')->onUpdate('cascade')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocnlpversion', function (Blueprint $table) { $table->dropForeign('FK_specprocnlpver_rawtext'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php index abd1abc..5b2b907 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprococrfrag_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprococrfrag', function (Blueprint $table) { $table->foreign(['prlid'], 'FK_specprococrfrag_prlid')->references(['prlid'])->on('specprocessorrawlabels')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprococrfrag', function (Blueprint $table) { $table->dropForeign('FK_specprococrfrag_prlid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php index d9389df..f540de1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_specprocstatus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('specprocstatus', function (Blueprint $table) { $table->foreign(['occid'], 'specprocstatus_occid')->references(['occid'])->on('omoccurrences')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['processorUid'], 'specprocstatus_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('specprocstatus', function (Blueprint $table) { $table->dropForeign('specprocstatus_occid'); $table->dropForeign('specprocstatus_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php index 2ac71d5..ae19421 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxa_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxa', function (Blueprint $table) { $table->foreign(['modifiedUid'], 'FK_taxa_uid')->references(['uid'])->on('users')->onUpdate('restrict')->onDelete('no action'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxa', function (Blueprint $table) { $table->dropForeign('FK_taxa_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php index 10767a4..c351f19 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrblock_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxadescrblock', function (Blueprint $table) { $table->foreign(['tdProfileID'], 'FK_taxadescrblock_tdProfileID')->references(['tdProfileID'])->on('taxadescrprofile')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_taxadescrblock_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('restrict'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxadescrblock', function (Blueprint $table) { $table->dropForeign('FK_taxadescrblock_tdProfileID'); $table->dropForeign('FK_taxadescrblock_tid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php index b434edb..085438b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrprofile_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxadescrprofile', function (Blueprint $table) { $table->foreign(['langid'], 'FK_taxadescrprofile_langid')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); $table->foreign(['modifiedUid'], 'FK_taxadescrprofile_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxadescrprofile', function (Blueprint $table) { $table->dropForeign('FK_taxadescrprofile_langid'); $table->dropForeign('FK_taxadescrprofile_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php index d7589fd..810c8ca 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxadescrstmts_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxadescrstmts', function (Blueprint $table) { $table->foreign(['tdbid'], 'FK_taxadescrstmts_tblock')->references(['tdbid'])->on('taxadescrblock')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxadescrstmts', function (Blueprint $table) { $table->dropForeign('FK_taxadescrstmts_tblock'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php index 6894b68..3bb010b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaenumtree_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaenumtree', function (Blueprint $table) { $table->foreign(['tid'], 'FK_tet_taxa')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['parenttid'], 'FK_tet_taxa2')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaenumtree', function (Blueprint $table) { $table->dropForeign('FK_tet_taxa'); $table->dropForeign('FK_tet_taxa2'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php index 3834941..82acfc1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxalinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxalinks', function (Blueprint $table) { $table->foreign(['tid'], 'FK_taxalinks_taxa')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxalinks', function (Blueprint $table) { $table->dropForeign('FK_taxalinks_taxa'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php index 7b34c83..dc761b9 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxamaps_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxamaps', function (Blueprint $table) { $table->foreign(['tid'], 'FK_taxamaps_taxa')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxamaps', function (Blueprint $table) { $table->dropForeign('FK_taxamaps_taxa'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php index 6b2a318..2c8c143 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxanestedtree_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxanestedtree', function (Blueprint $table) { $table->foreign(['tid'], 'FK_tnt_taxa')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['taxauthid'], 'FK_tnt_taxauth')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxanestedtree', function (Blueprint $table) { $table->dropForeign('FK_tnt_taxa'); $table->dropForeign('FK_tnt_taxauth'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php index a3dd81d..76329a5 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubdesclink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaprofilepubdesclink', function (Blueprint $table) { $table->foreign(['tppid'], 'FK_tppubdesclink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tdbid'], 'FK_tppubdesclink_tdbid')->references(['tdbid'])->on('taxadescrblock')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaprofilepubdesclink', function (Blueprint $table) { $table->dropForeign('FK_tppubdesclink_id'); $table->dropForeign('FK_tppubdesclink_tdbid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php index 4520d08..4a88abd 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubimagelink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaprofilepubimagelink', function (Blueprint $table) { $table->foreign(['tppid'], 'FK_tppubimagelink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['imgid'], 'FK_tppubimagelink_imgid')->references(['imgid'])->on('images')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaprofilepubimagelink', function (Blueprint $table) { $table->dropForeign('FK_tppubimagelink_id'); $table->dropForeign('FK_tppubimagelink_imgid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php index 95a8ea5..33322b5 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubmaplink_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaprofilepubmaplink', function (Blueprint $table) { $table->foreign(['tppid'], 'FK_tppubmaplink_id')->references(['tppid'])->on('taxaprofilepubs')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['mid'], 'FK_tppubmaplink_tdbid')->references(['mid'])->on('taxamaps')->onUpdate('cascade')->onDelete('cascade'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaprofilepubmaplink', function (Blueprint $table) { $table->dropForeign('FK_tppubmaplink_id'); $table->dropForeign('FK_tppubmaplink_tdbid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php index 0a253c9..5a8f11b 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaprofilepubs_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaprofilepubs', function (Blueprint $table) { $table->foreign(['uidowner'], 'FK_taxaprofilepubs_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaprofilepubs', function (Blueprint $table) { $table->dropForeign('FK_taxaprofilepubs_uid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php index 0a1110d..19efa1a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxaresourcelinks_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxaresourcelinks', function (Blueprint $table) { $table->foreign(['tid'], 'FK_taxaresource_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxaresourcelinks', function (Blueprint $table) { $table->dropForeign('FK_taxaresource_tid'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php index 55728db..aa893b7 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxavernaculars_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxavernaculars', function (Blueprint $table) { $table->foreign(['TID'], 'FK_vernaculars_tid')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['langid'], 'FK_vern_lang')->references(['langid'])->on('adminlanguages')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxavernaculars', function (Blueprint $table) { $table->dropForeign('FK_vernaculars_tid'); $table->dropForeign('FK_vern_lang'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php index 0d19d69..f17d3d2 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_taxstatus_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('taxstatus', function (Blueprint $table) { $table->foreign(['parenttid'], 'FK_taxstatus_parent')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['taxauthid'], 'FK_taxstatus_taid')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('restrict'); @@ -23,8 +21,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('taxstatus', function (Blueprint $table) { $table->dropForeign('FK_taxstatus_parent'); $table->dropForeign('FK_taxstatus_taid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php index ee3b8b8..438eeb1 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowncomments_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('unknowncomments', function (Blueprint $table) { $table->foreign(['unkid'], 'FK_unknowncomments')->references(['unkid'])->on('unknowns')->onUpdate('restrict')->onDelete('restrict'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('unknowncomments', function (Blueprint $table) { $table->dropForeign('FK_unknowncomments'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php index 2d59f94..d90fad8 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknownimages_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('unknownimages', function (Blueprint $table) { $table->foreign(['unkid'], 'FK_unknowns')->references(['unkid'])->on('unknowns')->onUpdate('restrict')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('unknownimages', function (Blueprint $table) { $table->dropForeign('FK_unknowns'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php index 17b077e..6181c75 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_unknowns_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('unknowns', function (Blueprint $table) { $table->foreign(['tid'], 'FK_unknowns_tid')->references(['tid'])->on('taxa')->onUpdate('restrict')->onDelete('restrict'); $table->foreign(['username'], 'FK_unknowns_username')->references(['username'])->on('userlogin')->onUpdate('restrict')->onDelete('restrict'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('unknowns', function (Blueprint $table) { $table->dropForeign('FK_unknowns_tid'); $table->dropForeign('FK_unknowns_username'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php index 1ae0a6e..a904027 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecmap_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('uploadspecmap', function (Blueprint $table) { $table->foreign(['uspid'], 'FK_uploadspecmap_usp')->references(['uspid'])->on('uploadspecparameters')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('uploadspecmap', function (Blueprint $table) { $table->dropForeign('FK_uploadspecmap_usp'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php index 10b4ba7..a8371fc 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspecparameters_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('uploadspecparameters', function (Blueprint $table) { $table->foreign(['collid'], 'FK_uploadspecparameters_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['createdUid'], 'FK_uploadspecparameters_uid')->references(['uid'])->on('users')->onUpdate('set null')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('uploadspecparameters', function (Blueprint $table) { $table->dropForeign('FK_uploadspecparameters_coll'); $table->dropForeign('FK_uploadspecparameters_uid'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php index ae9c76d..9a66249 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_uploadspectemp_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('uploadspectemp', function (Blueprint $table) { $table->foreign(['collid'], 'FK_uploadspectemp_coll')->references(['collID'])->on('omcollections')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('uploadspectemp', function (Blueprint $table) { $table->dropForeign('FK_uploadspectemp_coll'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php index e8f183f..de121c8 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userlogin_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('userlogin', function (Blueprint $table) { $table->foreign(['uid'], 'FK_login_user')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); }); @@ -19,8 +17,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('userlogin', function (Blueprint $table) { $table->dropForeign('FK_login_user'); }); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php index 2c2d9cd..3aaf65a 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_userroles_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('userroles', function (Blueprint $table) { $table->foreign(['uid'], 'FK_userrole_uid')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['uidAssignedBy'], 'FK_userrole_uid_assigned')->references(['uid'])->on('users')->onUpdate('cascade')->onDelete('set null'); @@ -20,8 +18,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('userroles', function (Blueprint $table) { $table->dropForeign('FK_userrole_uid'); $table->dropForeign('FK_userrole_uid_assigned'); diff --git a/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php b/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php index b530918..4bded3f 100644 --- a/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php +++ b/database/migrations/2024_09_24_194125_add_foreign_keys_to_usertaxonomy_table.php @@ -4,13 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class() extends Migration { /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::table('usertaxonomy', function (Blueprint $table) { $table->foreign(['taxauthid'], 'FK_usertaxonomy_taxauthid')->references(['taxauthid'])->on('taxauthority')->onUpdate('cascade')->onDelete('cascade'); $table->foreign(['tid'], 'FK_usertaxonomy_tid')->references(['tid'])->on('taxa')->onUpdate('cascade')->onDelete('cascade'); @@ -21,8 +19,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::table('usertaxonomy', function (Blueprint $table) { $table->dropForeign('FK_usertaxonomy_taxauthid'); $table->dropForeign('FK_usertaxonomy_tid'); diff --git a/database/migrations/2024_12_04_205155_add_user_oauth_tokens.php b/database/migrations/2024_12_04_205155_add_user_oauth_tokens.php index d3d6571..a895f1c 100644 --- a/database/migrations/2024_12_04_205155_add_user_oauth_tokens.php +++ b/database/migrations/2024_12_04_205155_add_user_oauth_tokens.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class() extends Migration { /** * Run the migrations. */ diff --git a/database/seeders/ChecklistSeeder.php b/database/seeders/ChecklistSeeder.php index 408b607..d8cd422 100644 --- a/database/seeders/ChecklistSeeder.php +++ b/database/seeders/ChecklistSeeder.php @@ -2,16 +2,13 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; -class ChecklistSeeder extends Seeder -{ +class ChecklistSeeder extends Seeder { /** * Run the database seeds. */ - public function run(): void - { + public function run(): void { // } } diff --git a/database/seeders/CollectionSeeder.php b/database/seeders/CollectionSeeder.php index 7a72c39..93ee49f 100644 --- a/database/seeders/CollectionSeeder.php +++ b/database/seeders/CollectionSeeder.php @@ -2,16 +2,13 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; -class CollectionSeeder extends Seeder -{ +class CollectionSeeder extends Seeder { /** * Run the database seeds. */ - public function run(): void - { + public function run(): void { // } } diff --git a/database/seeders/OccurrenceSeeder.php b/database/seeders/OccurrenceSeeder.php index 805f47f..bb4c8cf 100644 --- a/database/seeders/OccurrenceSeeder.php +++ b/database/seeders/OccurrenceSeeder.php @@ -2,7 +2,6 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use App\Models\Occurrence; use Illuminate\Database\Seeder; diff --git a/database/seeders/SampleSeeder.php b/database/seeders/SampleSeeder.php index 3616b87..fad1658 100644 --- a/database/seeders/SampleSeeder.php +++ b/database/seeders/SampleSeeder.php @@ -5,7 +5,6 @@ use App\Models\Collection; use App\Models\Institution; use App\Models\Occurrence; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class SampleSeeder extends Seeder { diff --git a/database/seeders/TaxonomySeeder.php b/database/seeders/TaxonomySeeder.php index 52f1555..be56b30 100644 --- a/database/seeders/TaxonomySeeder.php +++ b/database/seeders/TaxonomySeeder.php @@ -2,12 +2,10 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; class TaxonomySeeder extends Seeder { - // Note I (@Muchquak) am not a biologist as so this variable name is not correct // [rank_name, [rank_id, dir_parent_id, reqparentrankid]] private static $plants = [ @@ -20,7 +18,7 @@ class TaxonomySeeder extends Seeder { 'Class' => [60, 50, 30], 'Subclass' => [70, 60, 60], 'Order' => [100, 70, 60], - 'Suborder' => [110,100, 100], + 'Suborder' => [110, 100, 100], 'Family' => [140, 110, 100], 'Subfamily' => [150, 140, 140], 'Tribe' => [160, 150, 140], @@ -30,7 +28,7 @@ class TaxonomySeeder extends Seeder { 'Section' => [200, 190, 180], 'Subsection' => [210, 200, 180], 'Species' => [220, 210, 180], - 'Subspecies' => [230,220, 180], + 'Subspecies' => [230, 220, 180], 'Variety' => [240, 220, 180], 'Subvariety' => [250, 240, 180], 'Form' => [260, 220, 180], @@ -62,8 +60,8 @@ class TaxonomySeeder extends Seeder { ]; /** - * @param mixed $kingdom_names - * @param mixed $rank_tree + * @param mixed $kingdom_names + * @param mixed $rank_tree */ private static function load_taxon_units($kingdom_names, $rank_tree): void { foreach ($kingdom_names as $kingdom_name) { @@ -98,7 +96,7 @@ public function run(): void { self::load_taxon_units(['Monera', 'Protista', 'Animalia'], self::$animals); foreach (['Organism', 'Monera', 'Protista', 'Plantae', 'Fungi', 'Animalia'] as $kingdom) { - $rank_id = $kingdom === 'Organism'? 1: 10; + $rank_id = $kingdom === 'Organism' ? 1 : 10; DB::table('taxa')->insert([ 'rankID' => $rank_id, 'sciName' => $kingdom, diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 726b1c1..4c5e357 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -3,7 +3,6 @@ namespace Database\Seeders; use App\Models\User; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; class UserSeeder extends Seeder { diff --git a/lang/en/header.php b/lang/en/header.php index b3ce3b4..ae2a69e 100644 --- a/lang/en/header.php +++ b/lang/en/header.php @@ -12,40 +12,40 @@ | */ - 'home' =>'Home', - 'search' =>'Search', - 'collections' =>'Collections', - 'map' =>'Map', - 'map_search' =>'Map Search', - 'taxonomic_explorer' =>'Taxonomic Explorer', - 'images' =>'Images', - 'image_browser' =>'Image Browser', - 'image_search' =>'Image Search', - 'species_checklists' =>'Species Checklists', - 'checklist_project 1' =>'Checklist Project 1', + 'home' => 'Home', + 'search' => 'Search', + 'collections' => 'Collections', + 'map' => 'Map', + 'map_search' => 'Map Search', + 'taxonomic_explorer' => 'Taxonomic Explorer', + 'images' => 'Images', + 'image_browser' => 'Image Browser', + 'image_search' => 'Image Search', + 'species_checklists' => 'Species Checklists', + 'checklist_project 1' => 'Checklist Project 1', 'checklist_project 2' => 'Checklist Project 2', - 'dynamic_species_list' =>'Dynamic Species List', - 'identification_keys' =>'Identification Keys', - 'amphibians' =>'Amphibians', - 'birds' =>'Birds', - 'fish' =>'Fish', - 'invertebrates' =>'Invertebrates', - 'mammals' =>'Mammals', - 'plants'=>'Plants', - 'reptiles'=>'Reptiles', - 'more_information'=>'More Information', - 'about_project'=>'About Project', - 'partners'=>'Partners', - 'contacts'=>'Contacts', + 'dynamic_species_list' => 'Dynamic Species List', + 'identification_keys' => 'Identification Keys', + 'amphibians' => 'Amphibians', + 'birds' => 'Birds', + 'fish' => 'Fish', + 'invertebrates' => 'Invertebrates', + 'mammals' => 'Mammals', + 'plants' => 'Plants', + 'reptiles' => 'Reptiles', + 'more_information' => 'More Information', + 'about_project' => 'About Project', + 'partners' => 'Partners', + 'contacts' => 'Contacts', 'contact_us' => 'Contact Us', - 'symbiota_help'=>'Symbiota Help', - 'sitemap'=>'Sitemap', - 'data_use'=>'Data Use', - 'welcome'=>'Welcome', - 'my_profile'=>'My Profile', - 'sign_out'=>'Sign Out', - 'sign_in'=>'Sign In', - 'new_account'=>'New Account', + 'symbiota_help' => 'Symbiota Help', + 'sitemap' => 'Sitemap', + 'data_use' => 'Data Use', + 'welcome' => 'Welcome', + 'my_profile' => 'My Profile', + 'sign_out' => 'Sign Out', + 'sign_in' => 'Sign In', + 'new_account' => 'New Account', ]; ?> diff --git a/lang/en/home.php b/lang/en/home.php index 0fc3ef7..005158d 100644 --- a/lang/en/home.php +++ b/lang/en/home.php @@ -1,4 +1,5 @@ 'Welcome', - 'welcome-text' => 'This data portal has been established to promote collaborative... Replace with introductory text in English.If the portal is not meant to be multilingual, remove the unneeded language sections' + 'welcome-text' => 'This data portal has been established to promote collaborative... Replace with introductory text in English.If the portal is not meant to be multilingual, remove the unneeded language sections', ]; - -?> diff --git a/lang/es/header.php b/lang/es/header.php index 0ca616b..cc4b65a 100644 --- a/lang/es/header.php +++ b/lang/es/header.php @@ -1,4 +1,5 @@ 'Inicio', - 'search' =>'Búsqueda', - 'collections' =>'Colecciones', - 'map' =>'Mapa', - 'map_search' =>'Búsqueda Mapa', - 'taxonomic_explorer' =>'Explorador Taxonómico', - 'images' =>'Imágenes', - 'image_browser' =>'Navegador de Imágenes', - 'image_search' =>'Búsqueda de Imágenes', - 'species_checklists' =>'Lista de Especies', - 'checklist_project 1' =>'Proyecto 1', + 'home' => 'Inicio', + 'search' => 'Búsqueda', + 'collections' => 'Colecciones', + 'map' => 'Mapa', + 'map_search' => 'Búsqueda Mapa', + 'taxonomic_explorer' => 'Explorador Taxonómico', + 'images' => 'Imágenes', + 'image_browser' => 'Navegador de Imágenes', + 'image_search' => 'Búsqueda de Imágenes', + 'species_checklists' => 'Lista de Especies', + 'checklist_project 1' => 'Proyecto 1', 'checklist_project 2' => 'Proyecto 2', - 'dynamic_species_list' =>'Listados Dinámicos', - 'identification_keys' =>'Claves de identificación', + 'dynamic_species_list' => 'Listados Dinámicos', + 'identification_keys' => 'Claves de identificación', - 'amphibians' =>'Anfibios', - 'birds' =>'Aves', - 'fish' =>'Peces', - 'invertebrates' =>'Invertebrados', - 'mammals' =>'Mamíferos', - 'plants'=>'Plantas', - 'reptiles'=>'Reptiles', + 'amphibians' => 'Anfibios', + 'birds' => 'Aves', + 'fish' => 'Peces', + 'invertebrates' => 'Invertebrados', + 'mammals' => 'Mamíferos', + 'plants' => 'Plantas', + 'reptiles' => 'Reptiles', 'contact_us' => 'Contacta con Nosotros', - 'more_information'=>'Más Información', - 'about_project'=>'Información sobre el Proyecto', - 'partners'=>'Socios', - 'contacts'=>'Contactos', - 'symbiota_help'=>'Ayuda de Symbiota', - 'sitemap'=>'Mapa del Sitio', - 'data_use'=>'Uso de Datos', + 'more_information' => 'Más Información', + 'about_project' => 'Información sobre el Proyecto', + 'partners' => 'Socios', + 'contacts' => 'Contactos', + 'symbiota_help' => 'Ayuda de Symbiota', + 'sitemap' => 'Mapa del Sitio', + 'data_use' => 'Uso de Datos', - 'welcome'=>'Bienvenido', - 'my_profile'=>'Mi Perfil', - 'sign_out'=>'Finalizar Sesión', - 'sign_in'=>'Iniciar Sesión', - 'new_account'=>'Nueva Cuenta', + 'welcome' => 'Bienvenido', + 'my_profile' => 'Mi Perfil', + 'sign_out' => 'Finalizar Sesión', + 'sign_in' => 'Iniciar Sesión', + 'new_account' => 'Nueva Cuenta', ]; - -?> diff --git a/lang/es/home.php b/lang/es/home.php index 6fa054b..f8a1400 100644 --- a/lang/es/home.php +++ b/lang/es/home.php @@ -1,4 +1,5 @@ 'Bienvenue', - 'welcome-text' => 'Ce portail de données a été créé pour promouvoir la collaboration... Remplacer par le texte d\'introduction en anglais' + 'welcome-text' => 'Ce portail de données a été créé pour promouvoir la collaboration... Remplacer par le texte d\'introduction en anglais', ]; - -?> diff --git a/lang/fr/home.php b/lang/fr/home.php index c91c769..43211ea 100644 --- a/lang/fr/home.php +++ b/lang/fr/home.php @@ -1,4 +1,5 @@ 'Bienvenidos', - 'welcome-text' => 'Este portal de datos se ha establecido para promover la colaboración... Reemplazar con texto introductorio en inglés' + 'welcome-text' => 'Este portal de datos se ha establecido para promover la colaboración... Reemplazar con texto introductorio en inglés', ]; - -?> diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..08d168b --- /dev/null +++ b/pint.json @@ -0,0 +1,22 @@ +{ + "preset": "laravel", + "rules": { + "simplified_null_return": true, + "array_indentation": false, + "braces_position": { + "classes_opening_brace": "same_line", + "control_structures_opening_brace": "same_line", + "functions_opening_brace": "same_line" + }, + "concat_space": { + "spacing": "one" + }, + "new_with_parentheses": { + "anonymous_class": true, + "named_class": true + } + }, + "exclude": [ + "Portal" + ] +} diff --git a/public/index.php b/public/index.php index 539facf..bde7d0b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,22 +1,19 @@ bootstrap($app); +(new IlluminateLoadEnvironmentVariables())->bootstrap($app); //(new LoadConfiguration)->bootstrap($app); - /* |-------------------------------------------------------------------------- | Load Legacy Routing @@ -86,8 +82,8 @@ /* Routes that we want to fall through to laravel implementation */ $legacy_routes = [ 'index.php' => '/', - 'profile/index.php' => isset($_REQUEST['submit']) && $_REQUEST['submit'] === 'logout'? - '/logout': '/login' , + 'profile/index.php' => isset($_REQUEST['submit']) && $_REQUEST['submit'] === 'logout' ? + '/logout' : '/login', 'profile/newprofile.php' => '/signup', 'collections/list.php' => '/collections/list', //'sitemap.php' => '/sitemap', @@ -96,23 +92,23 @@ /* Generate Legacy Redirects to Laravel */ $legacy_black_list = []; foreach ($legacy_routes as $route => $redirect) { - $legacy_black_list['/' . $_ENV['PORTAL_NAME'] . '/' . $route] = $_ENV["APP_URL"] . $redirect; + $legacy_black_list['/' . $_ENV['PORTAL_NAME'] . '/' . $route] = $_ENV['APP_URL'] . $redirect; } /* Parse URI */ $query_pos = strpos($_SERVER['REQUEST_URI'], '?'); -$uri = $query_pos? - substr($_SERVER['REQUEST_URI'], 0, $query_pos): +$uri = $query_pos ? + substr($_SERVER['REQUEST_URI'], 0, $query_pos) : $_SERVER['REQUEST_URI']; -$query = $query_pos? - substr($_SERVER['REQUEST_URI'], $query_pos): +$query = $query_pos ? + substr($_SERVER['REQUEST_URI'], $query_pos) : ''; /* Clean out host url if present */ $https = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://'); -$app_url = str_replace([$https, $_SERVER['HTTP_HOST']],'', $_ENV["APP_URL"]); -if($app_url) { +$app_url = str_replace([$https, $_SERVER['HTTP_HOST']], '', $_ENV['APP_URL']); +if ($app_url) { $uri = str_replace($app_url, '', $uri); } @@ -193,32 +189,35 @@ 'zip' => 'application/zip', '3gp' => 'video/3gpp', '3g2' => 'video/3gpp2', - '7z' => 'application/x-7z-compressed' + '7z' => 'application/x-7z-compressed', ]; -if(isset($legacy_black_list[$uri]) && $blacklist_redirect = $legacy_black_list[$uri]) { +if (isset($legacy_black_list[$uri]) && $blacklist_redirect = $legacy_black_list[$uri]) { header('Location:' . $blacklist_redirect . $query); -} else if(preg_match("/^\/Portal.*\.(.*)/", $uri, $matches)) { +} elseif (preg_match("/^\/Portal.*\.(.*)/", $uri, $matches)) { try { [$path, $file_type] = $matches; - if($file_type === "php") { - include_once(__DIR__ . '/../' . $_ENV['PORTAL_NAME'] . '/config/symbini.php'); + if ($file_type === 'php') { + include_once __DIR__ . '/../' . $_ENV['PORTAL_NAME'] . '/config/symbini.php'; // This Class parses laravel file session auth into legacy user globals // On the surface his might seem overkill but laravel locks down most of // its facades behind within the kernal which will break the legacy application. class LegacyProfile extends ProfileManager { public function authenticate($pwd = '') { - $session_name = str_replace([" ", "-"], "_", strtolower($_ENV["APP_NAME"])) . '_session'; + $session_name = str_replace([' ', '-'], '_', strtolower($_ENV['APP_NAME'])) . '_session'; $session = $_COOKIE[$session_name]; - if(!$session) return; + if (! $session) { + return; + } $key = base64_decode(Str::after($_ENV['APP_KEY'], 'base64:')); - if(!$key) { + if (! $key) { error_log('No encryption key for legacy application'); + return; - }; + } $encrypter = new IlluminateEncrypter($key, 'AES-256-CBC'); $decrypted_cookie = $encrypter->decrypt($session, false); $store_id = CookieValuePrefix::validate($session_name, $decrypted_cookie, [$key]); @@ -232,7 +231,7 @@ public function authenticate($pwd = '') { // TODO (Logan) why is this web? $this->uid = $store->get('login_web_' . sha1(SessionGuard::class)); - if($this->uid) { + if ($this->uid) { global $PARAMS_ARR; global $USERNAME; global $USER_DISPLAY_NAME; @@ -247,7 +246,7 @@ public function authenticate($pwd = '') { $USER_DISPLAY_NAME = $person->getFirstName(); $USERNAME = $person->getUserName(); $SYMB_UID = $this->uid; - $IS_ADMIN = (array_key_exists('SuperAdmin',$USER_RIGHTS)?1:0); + $IS_ADMIN = (array_key_exists('SuperAdmin', $USER_RIGHTS) ? 1 : 0); } } } @@ -255,20 +254,20 @@ public function authenticate($pwd = '') { try { $profile = new LegacyProfile(); $profile->authenticate(); - } catch(Throwable $e) { + } catch (Throwable $e) { echo $e->getMessage(); error_log('ERROR Failure to decrypt and load laravel use in legacy system: ' . $e->getMessage()); } - include_once(__DIR__ . '/..' . $uri); - } else if($mime = $mime_types[$file_type]) { - header("Content-Type: " . $mime); + include_once __DIR__ . '/..' . $uri; + } elseif ($mime = $mime_types[$file_type]) { + header('Content-Type: ' . $mime); echo file_get_contents(__DIR__ . '/..' . $uri); } - } catch(Throwable $e) { + } catch (Throwable $e) { echo $e->getMessage(); } -// Do Laravel stuff if legacy route doesn't exist or its black listed + // Do Laravel stuff if legacy route doesn't exist or its black listed } else { $kernel = $app->make(Kernel::class); diff --git a/routes/api.php b/routes/api.php index af7f5ce..2daaed8 100644 --- a/routes/api.php +++ b/routes/api.php @@ -3,11 +3,11 @@ use App\Http\Controllers\CollectionController; use App\Http\Controllers\InstallationController; use App\Http\Controllers\InventoryController; -use App\Http\Controllers\MediaController; use App\Http\Controllers\InventoryPackageController; -use App\Http\Controllers\TaxonomyController; +use App\Http\Controllers\MediaController; use App\Http\Controllers\OccurrenceAnnotationController; use App\Http\Controllers\OccurrenceController; +use App\Http\Controllers\TaxonomyController; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Route; @@ -30,9 +30,9 @@ Route::get('/taxa/search', function (Request $request) { $sciname = $request->query('taxa'); $format = strtolower($request->query('format', 'html')); - $result = DB::select("SELECT sciname, tid FROM taxa WHERE sciname LIKE ? LIMIT 20", ["%" . $sciname . "%" ]); + $result = DB::select('SELECT sciname, tid FROM taxa WHERE sciname LIKE ? LIMIT 20', ['%' . $sciname . '%']); - if($format === 'json') { + if ($format === 'json') { return $result; } else { return view( @@ -47,17 +47,17 @@ }); Route::get('/v2', function () { - //return redirect('/v2/documentation'); - return view('/vendor/l5-swagger/index'); + //return redirect('/v2/documentation'); + return view('/vendor/l5-swagger/index'); }); Route::group(['prefix' => 'v2'], function () { Route::get('collection', [CollectionController::class, 'showAllCollections']); - Route::get('collection/{id}', [CollectionController::class ,'showOneCollection']); + Route::get('collection/{id}', [CollectionController::class, 'showOneCollection']); Route::get('occurrence/search', [OccurrenceController::class, 'showAllOccurrences']); - //Temporarily keep following route until new documentation is created. The one above will be keep so that I follows GBIF API layout + //Temporarily keep following route until new documentation is created. The one above will be keep so that I follows GBIF API layout Route::get('occurrence', [OccurrenceController::class, 'showAllOccurrences']); Route::get('occurrence/{id}', [OccurrenceController::class, 'showOneOccurrence']); Route::get('occurrence/{id}/media', [OccurrenceController::class, 'showOneOccurrenceMedia']); @@ -66,17 +66,17 @@ Route::get('occurrence/{id}/reharvest', [OccurrenceController::class, 'oneOccurrenceReharvest']); Route::get('occurrence/annotation/search', [OccurrenceAnnotationController::class, 'showAllAnnotations']); Route::post('occurrence/skeletal', [OccurrenceController::class, 'skeletalImport']); - Route::get('installation', [InstallationController::class, 'showAllPortals']); + Route::get('installation', [InstallationController::class, 'showAllPortals']); Route::get('installation/ping', [InstallationController::class, 'pingPortal']); Route::get('installation/{id}', [InstallationController::class, 'showOnePortal']); - Route::get('installation/{id}/touch', [InstallationController::class, 'portalHandshake']); - Route::get('installation/{id}/occurrence', [InstallationController::class, 'showOccurrences']); - Route::get('inventory', [InventoryController::class, 'showAllInventories']); + Route::get('installation/{id}/touch', [InstallationController::class, 'portalHandshake']); + Route::get('installation/{id}/occurrence', [InstallationController::class, 'showOccurrences']); + Route::get('inventory', [InventoryController::class, 'showAllInventories']); Route::get('inventory/{id}', [InventoryController::class, 'showOneInventory']); Route::get('inventory/{id}/taxa', [InventoryController::class, 'showOneInventoryTaxa']); Route::get('inventory/{id}/package', [InventoryPackageController::class, 'oneInventoryDataPackage']); - Route::get('media', [MediaController::class, 'showAllMedia']); - Route::get('media/{id}', [MediaController::class, 'showOneMedia']); + Route::get('media', [MediaController::class, 'showAllMedia']); + Route::get('media/{id}', [MediaController::class, 'showOneMedia']); Route::get('media/{id}', [MediaController::class, 'showOneMedia']); Route::post('media', [MediaController::class, 'insert']); Route::patch('media/{id}', [MediaController::class, 'update']); diff --git a/routes/web.php b/routes/web.php index c37671e..9ce341a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,19 +1,14 @@ user(); $user = User::updateOrCreate([ 'guid' => $orcid_user->id, - 'oauth_provider' => 'orcid' + 'oauth_provider' => 'orcid', ], - [ - 'name' => $orcid_user->name, - 'firstName' => $orcid_user->attributes['firstName'], - 'lastName' => $orcid_user->attributes['lastName'], - 'email' => $orcid_user->email ?? null, - //'guid' => $orcid_user->id, - 'access_token' => $orcid_user->token, - 'refresh_token' => $orcid_user->refreshToken, - ]); + [ + 'name' => $orcid_user->name, + 'firstName' => $orcid_user->attributes['firstName'], + 'lastName' => $orcid_user->attributes['lastName'], + 'email' => $orcid_user->email ?? null, + //'guid' => $orcid_user->id, + 'access_token' => $orcid_user->token, + 'refresh_token' => $orcid_user->refreshToken, + ]); Auth::login($user); return redirect('/'); }); -Route::get('/auth/redirect', function(Request $request) { +Route::get('/auth/redirect', function (Request $request) { return Socialite::driver('orcid')->redirect(); }); @@ -69,12 +64,12 @@ Route::view('/user/profile', 'pages/user/profile'); // Collection -Route::get('/collections/list', function(Request $request) { +Route::get('/collections/list', function (Request $request) { $params = $request->except(['page', '_token']); Cache::forget($request->fullUrl()); - $occurrences = Cache::remember($request->fullUrl(), now()->addMinutes(1), function() use ($params) { - if(count($params) === 0) { + $occurrences = Cache::remember($request->fullUrl(), now()->addMinutes(1), function () use ($params) { + if (count($params) === 0) { return []; } @@ -87,7 +82,7 @@ ->join('omcollections as c', 'c.collid', '=', 'o.collid') ->groupBy('o.occid'); - if(isset($params['taxa'])) { + if (isset($params['taxa'])) { $query->whereLike('o.sciname', $params['taxa']); } @@ -97,7 +92,7 @@ return view('pages/collections/list', ['occurrences' => $occurrences]); }); -Route::get('/collections/table', function (Request $request){ +Route::get('/collections/table', function (Request $request) { $collection = DB::table('omcollections')->where('collid', '=', $request->query('collid'))->select('*')->first(); $query = DB::table('omoccurrences as o') @@ -143,32 +138,32 @@ 'dateLastModified', 'processingStatus', 'recordEnteredBy', - 'basisOfRecord' + 'basisOfRecord', ]; foreach ($sortables as $property) { - if($request->query($property)) { + if ($request->query($property)) { $query->where('o.' . $property, '=', $request->query($property)); } } - if($request->query('sort')) { - if(($idx = array_search($request->query('sort'), $sortables)) > 0) { - $query->orderByRaw('ISNULL(o.'. $sortables[$idx].') ASC'); + if ($request->query('sort')) { + if (($idx = array_search($request->query('sort'), $sortables)) > 0) { + $query->orderByRaw('ISNULL(o.' . $sortables[$idx] . ') ASC'); } $query->orderBy( $request->query('sort'), - $request->query('sortDirection') === 'DESC'? 'DESC' : 'ASC' + $request->query('sortDirection') === 'DESC' ? 'DESC' : 'ASC' ); } - if($request->query('hasImages')) { - if($request->query('hasImages') === 'with_images') { - $query->whereIn('o.occid', function(Builder $query) { + if ($request->query('hasImages')) { + if ($request->query('hasImages') === 'with_images') { + $query->whereIn('o.occid', function (Builder $query) { $query->select('i.occid')->from('images as i')->groupBy('i.occid'); }); - } else if($request->query('hasImages') === 'without_images') { - $query->whereNotIn('o.occid', function(Builder $query) { + } elseif ($request->query('hasImages') === 'without_images') { + $query->whereNotIn('o.occid', function (Builder $query) { $query->select('i.occid')->from('images as i')->whereNotNull('i.occid')->groupBy('i.occid'); }); } @@ -177,13 +172,13 @@ $view = view('pages/collections/table', [ 'occurrences' => $query->paginate(100), 'collection' => $collection, - 'page' => $request->query('page') ?? 0 + 'page' => $request->query('page') ?? 0, ]); - if($request->header('HX-Request')) { - if($request->query('fragment') === 'rows') { + if ($request->header('HX-Request')) { + if ($request->query('fragment') === 'rows') { return $view->fragment('rows'); - } else if ($request->query('fragment') === 'table') { + } elseif ($request->query('fragment') === 'table') { return $view->fragment('table'); } } @@ -192,7 +187,7 @@ }); // Checklist -Route::get('/checklist/{clid}', function(int $clid) { +Route::get('/checklist/{clid}', function (int $clid) { $checklist = DB::table('fmchecklists as c') ->select('*') ->where('c.clid', '=', $clid) @@ -201,8 +196,7 @@ return view('pages/checklist/profile', ['checklist' => $checklist]); }); - -Route::get('/checklists', function (Request $request){ +Route::get('/checklists', function (Request $request) { $checklists = DB::table('fmchecklists as c') ->select('proj.pid', 'c.clid', 'c.name', 'projname', 'mapChecklist') ->leftJoin('fmchklstprojlink as link', 'link.clid', '=', 'c.clid') @@ -213,7 +207,7 @@ return view('pages/checklists', ['checklists' => $checklists]); }); -Route::get('/project', function (Request $request){ +Route::get('/project', function (Request $request) { $project = DB::table('fmprojects') ->select('pid', 'projname', 'managers') ->where('pid', '=', request('pid')) @@ -230,7 +224,7 @@ }); //occurrence -Route::get('/occurrence/{occid}', function(int $occid) { +Route::get('/occurrence/{occid}', function (int $occid) { $occurrence = DB::table('omoccurrences as o') ->select('*') ->where('o.occid', '=', $occid) @@ -239,7 +233,7 @@ return view('pages/occurrence/profile', ['occurrence' => $occurrence]); }); -Route::get('/occurrence/{occid}/edit', function(int $occid) { +Route::get('/occurrence/{occid}/edit', function (int $occid) { $occurrence = DB::table('omoccurrences as o') ->select('*') ->where('o.occid', '=', $occid) @@ -261,24 +255,24 @@ Route::get('/media/search', function (Request $request) { $media = []; $start = $request->query('start') ?? 0; - if(count($request->all()) > 0) { + if (count($request->all()) > 0) { $media = DB::table('media as m') ->leftJoin('taxa as t', 't.tid', '=', 'm.tid') ->leftJoin('users as u', 'u.uid', '=', 'm.creatoruid') ->leftJoin('omoccurrences as o', 'o.occid', '=', 'm.occid') - ->when($request->query('media_type'), function(Builder $query, $type) { + ->when($request->query('media_type'), function (Builder $query, $type) { $query->where('m.media_type', '=', $type); }) - ->when($request->query('tid'), function(Builder $query, $tid) { - $query->whereIn('t.tid', is_array($tid)? $tid: [$tid]); + ->when($request->query('tid'), function (Builder $query, $tid) { + $query->whereIn('t.tid', is_array($tid) ? $tid : [$tid]); }) - ->when($request->query('taxa'), function(Builder $query, $taxa) { + ->when($request->query('taxa'), function (Builder $query, $taxa) { $query->whereIn('t.sciName', array_map('trim', explode(',', $taxa))); }) - ->when($request->query('uid'), function(Builder $query, $uid) { + ->when($request->query('uid'), function (Builder $query, $uid) { $query->where('u.uid', '=', $uid); }) - ->when($request->query('tag'), function(Builder $query, $tag) { + ->when($request->query('tag'), function (Builder $query, $tag) { $query->leftJoin('imagetag as tag', 'tag.imgid', '=', 'm.media_id') ->leftJoin('imagetagkey as imgkey', 'imgkey.tagkey', '=', 'tag.keyvalue') ->where('imgkey.tagkey', '=', $tag); @@ -296,7 +290,7 @@ ->limit(30) ->offset($start) ->get(); - if($request->query('partial')) { + if ($request->query('partial')) { $query_params = $request->except('partial'); $query_params['start'] = $start; @@ -306,14 +300,15 @@ $new_url = $base_url . '?' . http_build_query($query_params); - return response(view('media/item', ['media' => $media ])) + + return response(view('media/item', ['media' => $media])) ->header('HX-Replace-URL', $new_url); } } $creators = DB::table('users as u') ->join('media as m', 'm.creatoruid', '=', 'u.uid') - ->select('uid','name') + ->select('uid', 'name') ->distinct() ->get(); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index cc68301..66a3d18 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -5,14 +5,12 @@ use Illuminate\Contracts\Console\Kernel; use Illuminate\Foundation\Application; -trait CreatesApplication -{ +trait CreatesApplication { /** * Creates the application. */ - public function createApplication(): Application - { - $app = require __DIR__.'/../bootstrap/app.php'; + public function createApplication(): Application { + $app = require __DIR__ . '/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index 8364a84..3ca9650 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -5,13 +5,11 @@ // use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; -class ExampleTest extends TestCase -{ +class ExampleTest extends TestCase { /** * A basic test example. */ - public function test_the_application_returns_a_successful_response(): void - { + public function test_the_application_returns_a_successful_response(): void { $response = $this->get('/'); $response->assertStatus(200); diff --git a/tests/TestCase.php b/tests/TestCase.php index 2932d4a..74bf669 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,7 +4,6 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase; -abstract class TestCase extends BaseTestCase -{ +abstract class TestCase extends BaseTestCase { use CreatesApplication; } diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 5773b0c..7d80b3c 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -4,13 +4,11 @@ use PHPUnit\Framework\TestCase; -class ExampleTest extends TestCase -{ +class ExampleTest extends TestCase { /** * A basic test example. */ - public function test_that_true_is_true(): void - { + public function test_that_true_is_true(): void { $this->assertTrue(true); } }