Thispackagehasnowbeenrewritten,substantiallyimprovedandreleasedasthelaravel-json-api/laravelpackage.Documentationforthenewversionisavailableonournewwebsitelaraveljsonapi.ioandthecodeisnowdevelopedundertheLaravelJSON:APIGithuborganisation.
Thecloudcreativity/laravel-json-apipackageisnowconsideredtobethelegacypackage.Asweknowitisinuseinalotofproductionapplications,itwillcontinuetoreceivebugfixesandupdatesfornewLaravelversions.However,itisnolongersupportedfornewfeatures.
Ifyouarestartinganewproject,pleaseusethenewpackagelaravel-json-api/laravelinstead.
IntroductionBuildfeature-richandstandards-compliantAPIsinLaravel.
ThispackageprovidesallthecapabilitiesyouneedtoaddJSONAPIcompliantAPIstoyourapplication.Extensivesupportforthespecification,including:
FetchingresourcesFetchingrelationshipsInclusionofrelatedresources(compounddocuments)Sparsefieldsets.Sorting.Pagination.FilteringCreatingresources.Updatingresources.Updatingrelationships.Deletingresources.Validationof:JSONAPIdocuments;andQueryparameters.Thefollowingadditionalfeaturesarealsosupported:
FullsupportforEloquentresources,withfeaturessuchas:Automaticeagerloadingwhenincludingrelatedresources.Easyrelationshipend-points.Soft-deletingandrestoringEloquentresources.Pageandcursorbasedpagination.Asynchronousprocessing.Supportmultiplemedia-typeswithinyourAPI.GeneratorsforalltheclassesyouneedtoaddaresourcetoyourAPI.WhatisJSONAPI?Fromjsonapi.org
Ifyou'veeverarguedwithyourteamaboutthewayyourJSONresponsesshouldbeformatted,JSONAPIisyouranti-bikesheddingweapon.
Byfollowingsharedconventions,youcanincreaseproductivity,takeadvantageofgeneralizedtooling,andfocusonwhatmatters:yourapplication.ClientsbuiltaroundJSONAPIareabletotakeadvantageofitsfeaturesaroundefficientlycachingresponses,sometimeseliminatingnetworkrequestsentirely.
Forfullinformationonthespec,plusexamples,seehttps://jsonapi.org.
TutorialandDocumentationWantatutorialtogetstarted?ReadtheHowtoJSON:APILaraveltutorial.
FullpackagedocumentationisavailableonReadtheDocs.
SlackJointheLaravelJSON:APIcommunityonSlack.
LaravelVersionsLaravelThisPackage^8.0^3.0^7.0^2.0^6.0^1.75.8.*^1.75.7.*^1.05.6.*^1.05.5.*^1.0MakesureyouconsulttheUpgradeGuidewhenupgradingbetweenmajororpre-releaseversions.
LicenseApacheLicense(Version2.0).PleaseseeLicenseFileformoreinformation.
InstallationInstallationisviacomposer.Seethedocumentationforcompleteinstructions.
ContributingContributionsareabsolutelywelcome.Ideallysubmitapullrequest,evenmoreideallywithunittests.Pleasenotethefollowing:
BugFixes-submitapullrequestagainstthemasterbranch.Enhancements/NewFeatures-submitapullrequestagainstthedevelopbranch.Werecommendsubmittinganissuebeforetakingthetimetoputtogetherapullrequest.
评论