[{"data":1,"prerenderedAt":699},["ShallowReactive",2],{"libs":3,"navigation-laravel-json-api":115,"\u002Flaravel-json-api\u002Fintegrations\u002Fnative-json-api":294,"\u002Flaravel-json-api\u002Fintegrations\u002Fnative-json-api-surround":694},[4,45,69,95],{"id":5,"color":6,"compatibility":7,"extension":20,"icon":21,"links":22,"meta":27,"name":28,"order":29,"package":30,"related":31,"stem":34,"tagline":35,"__hash__":36,"slug":37,"repository":38,"branch":39,"path":40,"collection":41,"entry":42,"home":43,"version":44},"laravel_json_api_meta\u002Fdocs\u002Fsite\u002Flib.yml","violet",[8,13,16],{"version":9,"php":10,"laravel":11,"status":12},"3.x","^8.3","^12.46 || ^13.0","active",{"version":14,"php":10,"laravel":11,"status":15},"2.x","eol",{"version":17,"php":18,"laravel":19,"status":15},"1.x","^8.1","^10.0 || ^11.0 || ^12.0 || ^13.0","yml","i-lucide-braces",[23],{"label":24,"to":25,"icon":26},"JSON:API 1.1","https:\u002F\u002Fjsonapi.org\u002Fformat\u002F","i-lucide-book-marked",{},"Laravel JSON:API",10,"ark4ne\u002Flaravel-json-api",[32,33],"laravel-api-revisions","laravel-openapi-generator","docs\u002Fsite\u002Flib","JSON:API 1.1 resources for Laravel, with typed values, validated includes and fieldsets, and API revisions.","ILGoVp9rzKYDQc18VV8kkXy3EQOQ8rv87JblFKXYDrU","laravel-json-api","Ark4ne\u002Flaravel-json-api","master","docs\u002Fsite","laravel_json_api","\u002Flaravel-json-api\u002Fgetting-started\u002Fintroduction","\u002Flaravel-json-api","v3.0.0",{"id":46,"color":47,"compatibility":48,"extension":20,"icon":50,"links":51,"meta":56,"name":57,"order":58,"package":59,"related":60,"stem":34,"tagline":61,"__hash__":62,"slug":32,"repository":63,"branch":64,"path":40,"collection":65,"entry":66,"home":67,"version":68},"laravel_api_revisions_meta\u002Fdocs\u002Fsite\u002Flib.yml","amber",[49],{"version":17,"php":10,"laravel":11,"status":12},"i-lucide-git-branch",[52],{"label":53,"to":54,"icon":55},"Agent skill","https:\u002F\u002Fgithub.com\u002FArk4ne\u002Flaravel-api-revisions\u002Ftree\u002Fmain\u002Fskills\u002Flaravel-api-revisions","i-lucide-bot",{},"Laravel API Revisions",20,"ark4ne\u002Flaravel-api-revisions",[37,33],"Typed schemas for Laravel resources and form requests, evolved through dated API revisions, Stripe-style.","w24MBVK4_XliIZ8nVcfnuT9OgR-m-Ytxz31Pxua_mLM","Ark4ne\u002Flaravel-api-revisions","main","laravel_api_revisions","\u002Flaravel-api-revisions\u002Fgetting-started\u002Fintroduction","\u002Flaravel-api-revisions","v1.0.0",{"id":70,"color":71,"compatibility":72,"extension":20,"icon":77,"links":78,"meta":82,"name":83,"order":84,"package":85,"related":86,"stem":34,"tagline":88,"__hash__":89,"slug":33,"repository":90,"branch":39,"path":40,"collection":91,"entry":92,"home":93,"version":94},"laravel_openapi_generator_meta\u002Fdocs\u002Fsite\u002Flib.yml","emerald",[73,75],{"version":17,"php":10,"laravel":74,"status":12},"^13.0",{"version":76,"php":18,"laravel":19,"status":15},"0.6","i-lucide-file-json",[79],{"label":80,"to":81,"icon":26},"OpenAPI Specification","https:\u002F\u002Fspec.openapis.org\u002Foas\u002Flatest.html",{},"Laravel OpenAPI Generator",30,"ark4ne\u002Flaravel-openapi-generator",[87,37,32],"openapi-writer","Generates OpenAPI 3.0, 3.1 and 3.2 documents from a Laravel application, its routes, form requests and resources.","DTt0SVqegMImLmWmwL8LCW5lxRCWFYcnBFOaquLpVwc","Ark4ne\u002Flaravel-openapi-generator","laravel_openapi_generator","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Fintroduction","\u002Flaravel-openapi-generator","v1.2.0",{"id":96,"color":97,"compatibility":98,"extension":20,"icon":101,"links":102,"meta":104,"name":105,"order":106,"package":107,"related":108,"stem":34,"tagline":109,"__hash__":110,"slug":87,"repository":111,"branch":64,"path":40,"collection":112,"entry":113,"home":114,"version":68},"openapi_writer_meta\u002Fdocs\u002Fsite\u002Flib.yml","sky",[99],{"version":17,"php":100,"status":12},"^8.2","i-lucide-file-pen-line",[103],{"label":80,"to":81,"icon":26},{},"OpenAPI Writer",40,"ark4ne\u002Fopenapi-writer",[33],"Framework-agnostic, fluent and immutable PHP builder for OpenAPI 3.0, 3.1 and 3.2 documents, written as JSON or YAML and validated.","JFQcdQ9GEChOkfRKibLjoxZOfnt6HYNsayX2melOzMk","Ark4ne\u002Fopenapi-writer","openapi_writer","\u002Fopenapi-writer\u002Fgetting-started\u002Fintroduction","\u002Fopenapi-writer",[116,135,165,187,216,234,248,282],{"title":117,"since":118,"experimental":119,"icon":120,"path":121,"stem":122,"children":123,"page":119},"Getting started",null,false,"i-lucide-rocket","\u002Flaravel-json-api\u002Fgetting-started","laravel-json-api\u002F1.getting-started",[124,127,131],{"title":125,"path":42,"stem":126,"since":118,"experimental":119},"Introduction","laravel-json-api\u002F1.getting-started\u002F1.introduction",{"title":128,"path":129,"stem":130,"since":118,"experimental":119},"Installation","\u002Flaravel-json-api\u002Fgetting-started\u002Finstallation","laravel-json-api\u002F1.getting-started\u002F2.installation",{"title":132,"path":133,"stem":134,"since":118,"experimental":119},"Quick start","\u002Flaravel-json-api\u002Fgetting-started\u002Fquick-start","laravel-json-api\u002F1.getting-started\u002F3.quick-start",{"title":136,"since":118,"experimental":119,"icon":137,"path":138,"stem":139,"children":140,"page":119},"Resources","i-lucide-box","\u002Flaravel-json-api\u002Fresources","laravel-json-api\u002F2.resources",[141,145,149,153,157,161],{"title":142,"path":143,"stem":144,"since":118,"experimental":119},"Anatomy of a resource","\u002Flaravel-json-api\u002Fresources\u002Fanatomy","laravel-json-api\u002F2.resources\u002F1.anatomy",{"title":146,"path":147,"stem":148,"since":118,"experimental":119},"Attributes & values","\u002Flaravel-json-api\u002Fresources\u002Fattributes","laravel-json-api\u002F2.resources\u002F2.attributes",{"title":150,"path":151,"stem":152,"since":118,"experimental":119},"Conditions","\u002Flaravel-json-api\u002Fresources\u002Fconditions","laravel-json-api\u002F2.resources\u002F3.conditions",{"title":154,"path":155,"stem":156,"since":118,"experimental":119},"Relationships","\u002Flaravel-json-api\u002Fresources\u002Frelationships","laravel-json-api\u002F2.resources\u002F4.relationships",{"title":158,"path":159,"stem":160,"since":118,"experimental":119},"Links & meta","\u002Flaravel-json-api\u002Fresources\u002Flinks-and-meta","laravel-json-api\u002F2.resources\u002F5.links-and-meta",{"title":162,"path":163,"stem":164,"since":118,"experimental":119},"Collections & pagination","\u002Flaravel-json-api\u002Fresources\u002Fcollections","laravel-json-api\u002F2.resources\u002F6.collections",{"title":166,"since":118,"experimental":119,"icon":167,"path":168,"stem":169,"children":170,"page":119},"Requests","i-lucide-arrow-down-up","\u002Flaravel-json-api\u002Frequests","laravel-json-api\u002F3.requests",[171,175,179,183],{"title":172,"path":173,"stem":174,"since":118,"experimental":119},"Includes & sparse fieldsets","\u002Flaravel-json-api\u002Frequests\u002Fincludes-and-fieldsets","laravel-json-api\u002F3.requests\u002F1.includes-and-fieldsets",{"title":176,"path":177,"stem":178,"since":118,"experimental":119},"Validating requests","\u002Flaravel-json-api\u002Frequests\u002Fvalidation","laravel-json-api\u002F3.requests\u002F2.validation",{"title":180,"path":181,"stem":182,"since":118,"experimental":119},"Write requests","\u002Flaravel-json-api\u002Frequests\u002Fwrite-requests","laravel-json-api\u002F3.requests\u002F3.write-requests",{"title":184,"path":185,"stem":186,"since":118,"experimental":119},"Errors & content negotiation","\u002Flaravel-json-api\u002Frequests\u002Ferrors","laravel-json-api\u002F3.requests\u002F4.errors",{"title":188,"since":118,"experimental":119,"icon":50,"path":189,"stem":190,"children":191,"page":119},"API revisions","\u002Flaravel-json-api\u002Frevisions","laravel-json-api\u002F4.revisions",[192,196,200,204,208,212],{"title":193,"path":194,"stem":195,"since":118,"experimental":119},"Overview & declaring revisions","\u002Flaravel-json-api\u002Frevisions\u002Foverview","laravel-json-api\u002F4.revisions\u002F1.overview",{"title":197,"path":198,"stem":199,"since":118,"experimental":119},"Changing a field","\u002Flaravel-json-api\u002Frevisions\u002Fchanging-a-field","laravel-json-api\u002F4.revisions\u002F2.changing-a-field",{"title":201,"path":202,"stem":203,"since":118,"experimental":119},"Adding, removing, new types","\u002Flaravel-json-api\u002Frevisions\u002Fadding-and-removing","laravel-json-api\u002F4.revisions\u002F3.adding-and-removing",{"title":205,"path":206,"stem":207,"since":118,"experimental":119},"Guards","\u002Flaravel-json-api\u002Frevisions\u002Fguards","laravel-json-api\u002F4.revisions\u002F4.guards",{"title":209,"path":210,"stem":211,"since":118,"experimental":119},"Write requests across revisions","\u002Flaravel-json-api\u002Frevisions\u002Fwrite-requests","laravel-json-api\u002F4.revisions\u002F5.write-requests",{"title":213,"path":214,"stem":215,"since":118,"experimental":119},"Checking & retiring a revision","\u002Flaravel-json-api\u002Frevisions\u002Fchecking-and-retiring","laravel-json-api\u002F4.revisions\u002F6.checking-and-retiring",{"title":217,"since":118,"experimental":119,"icon":218,"path":219,"stem":220,"children":221,"page":119},"Tooling","i-lucide-wrench","\u002Flaravel-json-api\u002Ftooling","laravel-json-api\u002F5.tooling",[222,226,230],{"title":223,"path":224,"stem":225,"since":118,"experimental":119},"Checking resources","\u002Flaravel-json-api\u002Ftooling\u002Fchecking-resources","laravel-json-api\u002F5.tooling\u002F1.checking-resources",{"title":227,"path":228,"stem":229,"since":118,"experimental":119},"Static analysis","\u002Flaravel-json-api\u002Ftooling\u002Fstatic-analysis","laravel-json-api\u002F5.tooling\u002F2.static-analysis",{"title":231,"path":232,"stem":233,"since":118,"experimental":119},"Deployment","\u002Flaravel-json-api\u002Ftooling\u002Fdeployment","laravel-json-api\u002F5.tooling\u002F3.deployment",{"title":235,"since":118,"experimental":119,"icon":236,"path":237,"stem":238,"children":239,"page":119},"Integrations","i-lucide-plug","\u002Flaravel-json-api\u002Fintegrations","laravel-json-api\u002F6.integrations",[240,244],{"title":241,"path":242,"stem":243,"since":118,"experimental":119},"Laravel's native JSON:API","\u002Flaravel-json-api\u002Fintegrations\u002Fnative-json-api","laravel-json-api\u002F6.integrations\u002F1.native-json-api",{"title":245,"path":246,"stem":247,"since":118,"experimental":119},"OpenAPI","\u002Flaravel-json-api\u002Fintegrations\u002Fopenapi","laravel-json-api\u002F6.integrations\u002F2.openapi",{"title":249,"since":118,"experimental":119,"icon":250,"path":251,"stem":252,"children":253,"page":119},"Reference","i-lucide-library","\u002Flaravel-json-api\u002Freference","laravel-json-api\u002F7.reference",[254,258,262,266,270,274,278],{"title":255,"path":256,"stem":257,"since":118,"experimental":119},"Configuration","\u002Flaravel-json-api\u002Freference\u002Fconfiguration","laravel-json-api\u002F7.reference\u002F1.configuration",{"title":259,"path":260,"stem":261,"since":118,"experimental":119},"Value helpers","\u002Flaravel-json-api\u002Freference\u002Fvalue-helpers","laravel-json-api\u002F7.reference\u002F2.value-helpers",{"title":263,"path":264,"stem":265,"since":118,"experimental":119},"Relation helpers","\u002Flaravel-json-api\u002Freference\u002Frelation-helpers","laravel-json-api\u002F7.reference\u002F3.relation-helpers",{"title":267,"path":268,"stem":269,"since":118,"experimental":119},"PHP attributes","\u002Flaravel-json-api\u002Freference\u002Fphp-attributes","laravel-json-api\u002F7.reference\u002F4.php-attributes",{"title":271,"path":272,"stem":273,"since":118,"experimental":119},"Commands","\u002Flaravel-json-api\u002Freference\u002Fcommands","laravel-json-api\u002F7.reference\u002F5.commands",{"title":275,"path":276,"stem":277,"since":118,"experimental":119},"Diagnostics","\u002Flaravel-json-api\u002Freference\u002Fdiagnostics","laravel-json-api\u002F7.reference\u002F6.diagnostics",{"title":279,"path":280,"stem":281,"since":118,"experimental":119},"Extension points","\u002Flaravel-json-api\u002Freference\u002Fextension-points","laravel-json-api\u002F7.reference\u002F7.extension-points",{"title":283,"path":284,"children":285},"Releases","\u002Flaravel-json-api\u002Freleases",[286,290],{"title":287,"path":288,"stem":289,"since":118,"experimental":119},"Upgrade guide","\u002Flaravel-json-api\u002Fupgrade","laravel-json-api\u002FUPGRADE",{"title":291,"path":292,"stem":293,"since":118,"experimental":119},"Changelog","\u002Flaravel-json-api\u002Fchangelog","laravel-json-api\u002FCHANGELOG",{"id":295,"title":241,"body":296,"description":687,"experimental":119,"extension":688,"links":118,"meta":689,"navigation":690,"path":242,"rawbody":691,"seo":692,"since":118,"stem":243,"__hash__":693},"laravel_json_api\u002Flaravel-json-api\u002F6.integrations\u002F1.native-json-api.md",{"type":297,"value":298,"toc":683},"minimark",[299,308,313,457,461,464,613,672,679],[300,301,302,303,307],"p",{},"Laravel (12.46+, 13) ships ",[304,305,306],"code",{},"Illuminate\\Http\\Resources\\JsonApi\\JsonApiResource",", a lean implementation of the\nspecification that suits many APIs. This package stays independent of it and interoperates with it.",[309,310,312],"h2",{"id":311},"what-each-one-covers","What each one covers",[314,315,316,331],"table",{},[317,318,319],"thead",{},[320,321,322,325,328],"tr",{},[323,324],"th",{},[323,326,327],{},"Laravel's native",[323,329,330],{},"This package",[332,333,334,355,364,379,389,405,422,431,440,449],"tbody",{},[320,335,336,350,353],{},[337,338,339,342,343,346,347],"td",{},[304,340,341],{},"id"," as a string, ",[304,344,345],{},"\"data\": null",", primary data out of ",[304,348,349],{},"included",[337,351,352],{},"yes",[337,354,352],{},[320,356,357,360,362],{},[337,358,359],{},"Attributes resolved after the sparse fieldset",[337,361,352],{},[337,363,352],{},[320,365,366,369,372],{},[337,367,368],{},"Relationships that are not included",[337,370,371],{},"left out",[337,373,374,375,378],{},"linkage loaded in batch, or left out (",[304,376,377],{},"relationship.linkage",")",[320,380,381,384,387],{},[337,382,383],{},"Typed values: nullable, date format, decimal precision, enum",[337,385,386],{},"no",[337,388,352],{},[320,390,391,401,403],{},[337,392,393,394,397,398],{},"Definition of a resource, validation of ",[304,395,396],{},"include"," and ",[304,399,400],{},"fields",[337,402,386],{},[337,404,352],{},[320,406,407,418,420],{},[337,408,409,410,413,414,417],{},"Links and meta per relationship, ",[304,411,412],{},"whenIncluded()",", ",[304,415,416],{},"can()",", filters",[337,419,386],{},[337,421,352],{},[320,423,424,427,429],{},[337,425,426],{},"Resources that are not Eloquent models",[337,428,386],{},[337,430,352],{},[320,432,433,436,438],{},[337,434,435],{},"Public contract for the tooling (OpenAPI)",[337,437,386],{},[337,439,352],{},[320,441,442,445,447],{},[337,443,444],{},"Error documents, content negotiation",[337,446,386],{},[337,448,352],{},[320,450,451,453,455],{},[337,452,188],{},[337,454,386],{},[337,456,352],{},[309,458,460],{"id":459},"relating-native-resources","Relating native resources",[300,462,463],{},"A relationship may relate native resources:",[465,466,471],"pre",{"className":467,"code":468,"language":469,"meta":470,"style":470},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","protected function toRelationships(Request $request): iterable\n{\n    return [\n        'author' => $this->one(NativeUserResource::class),\n        'tags' => $this->many(NativeTagResource::class),\n    ];\n}\n","php","",[304,472,473,514,520,530,571,601,607],{"__ignoreMap":470},[474,475,478,482,485,489,493,497,500,504,506,510],"span",{"class":476,"line":477},"line",1,[474,479,481],{"class":480},"sbsja","protected",[474,483,484],{"class":480}," function",[474,486,488],{"class":487},"sGLFI"," toRelationships",[474,490,492],{"class":491},"sP7_E","(",[474,494,496],{"class":495},"sZMiF","Request",[474,498,499],{"class":491}," $",[474,501,503],{"class":502},"su5hD","request",[474,505,378],{"class":491},[474,507,509],{"class":508},"smGrS",":",[474,511,513],{"class":512},"sw1J6"," iterable\n",[474,515,517],{"class":476,"line":516},2,[474,518,519],{"class":491},"{\n",[474,521,523,527],{"class":476,"line":522},3,[474,524,526],{"class":525},"sVHd0","    return",[474,528,529],{"class":491}," [\n",[474,531,533,537,541,544,547,551,554,557,559,562,565,568],{"class":476,"line":532},4,[474,534,536],{"class":535},"sjJ54","        '",[474,538,540],{"class":539},"s_sjI","author",[474,542,543],{"class":535},"'",[474,545,546],{"class":508}," =>",[474,548,550],{"class":549},"s39Yj"," $this",[474,552,553],{"class":508},"->",[474,555,556],{"class":487},"one",[474,558,492],{"class":491},[474,560,561],{"class":495},"NativeUserResource",[474,563,564],{"class":508},"::",[474,566,567],{"class":512},"class",[474,569,570],{"class":491},"),\n",[474,572,574,576,579,581,583,585,587,590,592,595,597,599],{"class":476,"line":573},5,[474,575,536],{"class":535},[474,577,578],{"class":539},"tags",[474,580,543],{"class":535},[474,582,546],{"class":508},[474,584,550],{"class":549},[474,586,553],{"class":508},[474,588,589],{"class":487},"many",[474,591,492],{"class":491},[474,593,594],{"class":495},"NativeTagResource",[474,596,564],{"class":508},[474,598,567],{"class":512},[474,600,570],{"class":491},[474,602,604],{"class":476,"line":603},6,[474,605,606],{"class":491},"    ];\n",[474,608,610],{"class":476,"line":609},7,[474,611,612],{"class":491},"}\n",[614,615,616,634,658,665],"ul",{},[617,618,619,620,413,623,397,626,629,630,633],"li",{},"Their linkage is rendered and loaded in batch as any other; ",[304,621,622],{},"links()",[304,624,625],{},"meta()",[304,627,628],{},"identifierMeta()"," receive the\nnative resource. A native resource is guessed like any other (",[304,631,632],{},"#[UseResource]",", then the naming convention).",[617,635,636,637,641,642,645,646,649,650,653,654,657],{},"Included, they are rendered as ",[638,639,640],"strong",{},"leaves"," by their own ",[304,643,644],{},"resolve()",", with their ",[304,647,648],{},"fields[type]",": their relationships\nare never rendered, nothing is loaded nor included under them, and the ",[304,651,652],{},"Includes"," rule rejects ",[304,655,656],{},"include=author.posts",".",[617,659,660,661,664],{},"Their fields are unknown without a model: the ",[304,662,663],{},"Fields"," rule accepts those of their type as they are.",[617,666,667,668,671],{},"A polymorphic relationship (",[304,669,670],{},"morph()",") cannot render native resources.",[300,673,674,675,678],{},"A native ",[304,676,677],{},"JsonApiRequest"," is read like any request.",[680,681,682],"style",{},"html pre.shiki code .sbsja, html code.shiki .sbsja{--shiki-light:#9C3EDA;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":470,"searchDepth":522,"depth":522,"links":684},[685,686],{"id":311,"depth":516,"text":312},{"id":459,"depth":516,"text":460},"How this package compares with, and works alongside, Laravel's own JSON:API resources.","md",{},true,"---\ntitle: Laravel's native JSON:API\ndescription: How this package compares with, and works alongside, Laravel's own JSON:API resources.\n---\n\nLaravel (12.46+, 13) ships `Illuminate\\Http\\Resources\\JsonApi\\JsonApiResource`, a lean implementation of the\nspecification that suits many APIs. This package stays independent of it and interoperates with it.\n\n## What each one covers\n\n| | Laravel's native | This package |\n| --- | --- | --- |\n| `id` as a string, `\"data\": null`, primary data out of `included` | yes | yes |\n| Attributes resolved after the sparse fieldset | yes | yes |\n| Relationships that are not included | left out | linkage loaded in batch, or left out (`relationship.linkage`) |\n| Typed values: nullable, date format, decimal precision, enum | no | yes |\n| Definition of a resource, validation of `include` and `fields` | no | yes |\n| Links and meta per relationship, `whenIncluded()`, `can()`, filters | no | yes |\n| Resources that are not Eloquent models | no | yes |\n| Public contract for the tooling (OpenAPI) | no | yes |\n| Error documents, content negotiation | no | yes |\n| API revisions | no | yes |\n\n## Relating native resources\n\nA relationship may relate native resources:\n\n```php\nprotected function toRelationships(Request $request): iterable\n{\n    return [\n        'author' => $this->one(NativeUserResource::class),\n        'tags' => $this->many(NativeTagResource::class),\n    ];\n}\n```\n\n- Their linkage is rendered and loaded in batch as any other; `links()`, `meta()` and `identifierMeta()` receive the\n  native resource. A native resource is guessed like any other (`#[UseResource]`, then the naming convention).\n- Included, they are rendered as **leaves** by their own `resolve()`, with their `fields[type]`: their relationships\n  are never rendered, nothing is loaded nor included under them, and the `Includes` rule rejects `include=author.posts`.\n- Their fields are unknown without a model: the `Fields` rule accepts those of their type as they are.\n- A polymorphic relationship (`morph()`) cannot render native resources.\n\nA native `JsonApiRequest` is read like any request.\n",{"title":241,"description":687},"scfR0BJa8uL4P9H9MV12oSQ02bTl56xofB7Dpnpd9Dg",[695,697],{"title":231,"path":232,"stem":233,"description":696,"children":-1},"Compile the definitions for production.",{"title":245,"path":246,"stem":247,"description":698,"children":-1},"Generate OpenAPI documents of your JSON:API endpoints from the definitions of your resources.",1795438902382]