[{"data":1,"prerenderedAt":2606},["ShallowReactive",2],{"libs":3,"navigation-laravel-openapi-generator":115,"\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fwebhooks-and-callbacks":296,"\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fwebhooks-and-callbacks-surround":2601},[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,169,191,213,243,258,284],{"title":117,"since":118,"experimental":119,"icon":120,"path":121,"stem":122,"children":123,"page":119},"Getting started",null,false,"i-lucide-rocket","\u002Flaravel-openapi-generator\u002Fgetting-started","laravel-openapi-generator\u002F1.getting-started",[124,127,131],{"title":125,"path":92,"stem":126,"since":118,"experimental":119},"Introduction","laravel-openapi-generator\u002F1.getting-started\u002F1.introduction",{"title":128,"path":129,"stem":130,"since":118,"experimental":119},"Installation","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Finstallation","laravel-openapi-generator\u002F1.getting-started\u002F2.installation",{"title":132,"path":133,"stem":134,"since":118,"experimental":119},"Quick start","\u002Flaravel-openapi-generator\u002Fgetting-started\u002Fquick-start","laravel-openapi-generator\u002F1.getting-started\u002F3.quick-start",{"title":136,"since":118,"experimental":119,"icon":137,"path":138,"stem":139,"children":140,"page":119},"Documenting endpoints","i-lucide-route","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints","laravel-openapi-generator\u002F2.documenting-endpoints",[141,145,149,153,157,161,165],{"title":142,"path":143,"stem":144,"since":118,"experimental":119},"How it works","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fhow-it-works","laravel-openapi-generator\u002F2.documenting-endpoints\u002F1.how-it-works",{"title":146,"path":147,"stem":148,"since":118,"experimental":119},"Routes & operations","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Froutes-and-operations","laravel-openapi-generator\u002F2.documenting-endpoints\u002F2.routes-and-operations",{"title":150,"path":151,"stem":152,"since":118,"experimental":119},"Requests","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Frequests","laravel-openapi-generator\u002F2.documenting-endpoints\u002F3.requests",{"title":154,"path":155,"stem":156,"since":118,"experimental":119},"Responses","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fresponses","laravel-openapi-generator\u002F2.documenting-endpoints\u002F4.responses",{"title":158,"path":159,"stem":160,"since":118,"experimental":119},"Sampling","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fsampling","laravel-openapi-generator\u002F2.documenting-endpoints\u002F5.sampling",{"title":162,"path":163,"stem":164,"since":118,"experimental":119},"Security & errors","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fsecurity-and-errors","laravel-openapi-generator\u002F2.documenting-endpoints\u002F6.security-and-errors",{"title":166,"path":167,"stem":168,"since":118,"experimental":119},"Webhooks & callbacks","\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fwebhooks-and-callbacks","laravel-openapi-generator\u002F2.documenting-endpoints\u002F7.webhooks-and-callbacks",{"title":170,"since":118,"experimental":119,"icon":171,"path":172,"stem":173,"children":174,"page":119},"Documents","i-lucide-files","\u002Flaravel-openapi-generator\u002Fdocuments","laravel-openapi-generator\u002F3.documents",[175,179,183,187],{"title":176,"path":177,"stem":178,"since":118,"experimental":119},"Configuring a document","\u002Flaravel-openapi-generator\u002Fdocuments\u002Fconfiguring-a-document","laravel-openapi-generator\u002F3.documents\u002F1.configuring-a-document",{"title":180,"path":181,"stem":182,"since":118,"experimental":119},"Several documents","\u002Flaravel-openapi-generator\u002Fdocuments\u002Fseveral-documents","laravel-openapi-generator\u002F3.documents\u002F2.several-documents",{"title":184,"path":185,"stem":186,"since":118,"experimental":119},"Output","\u002Flaravel-openapi-generator\u002Fdocuments\u002Foutput","laravel-openapi-generator\u002F3.documents\u002F3.output",{"title":188,"path":189,"stem":190,"since":118,"experimental":119},"Translations","\u002Flaravel-openapi-generator\u002Fdocuments\u002Ftranslations","laravel-openapi-generator\u002F3.documents\u002F4.translations",{"title":192,"since":118,"experimental":119,"icon":193,"path":194,"stem":195,"children":196,"page":119},"Workflow","i-lucide-terminal","\u002Flaravel-openapi-generator\u002Fworkflow","laravel-openapi-generator\u002F4.workflow",[197,201,205,209],{"title":198,"path":199,"stem":200,"since":118,"experimental":119},"Diagnostics","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fdiagnostics","laravel-openapi-generator\u002F4.workflow\u002F1.diagnostics",{"title":202,"path":203,"stem":204,"since":118,"experimental":119},"Continuous integration","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fcontinuous-integration","laravel-openapi-generator\u002F4.workflow\u002F2.continuous-integration",{"title":206,"path":207,"stem":208,"since":118,"experimental":119},"Troubleshooting","\u002Flaravel-openapi-generator\u002Fworkflow\u002Ftroubleshooting","laravel-openapi-generator\u002F4.workflow\u002F3.troubleshooting",{"title":210,"path":211,"stem":212,"since":118,"experimental":119},"Agent skills","\u002Flaravel-openapi-generator\u002Fworkflow\u002Fagent-skills","laravel-openapi-generator\u002F4.workflow\u002F4.agent-skills",{"title":214,"since":118,"experimental":119,"icon":215,"path":216,"stem":217,"children":218,"page":119},"Extending","i-lucide-puzzle","\u002Flaravel-openapi-generator\u002Fextending","laravel-openapi-generator\u002F5.extending",[219,223,227,231,235,239],{"title":220,"path":221,"stem":222,"since":118,"experimental":119},"Overview","\u002Flaravel-openapi-generator\u002Fextending\u002Foverview","laravel-openapi-generator\u002F5.extending\u002F1.overview",{"title":224,"path":225,"stem":226,"since":118,"experimental":119},"Rule mappers","\u002Flaravel-openapi-generator\u002Fextending\u002Frule-mappers","laravel-openapi-generator\u002F5.extending\u002F2.rule-mappers",{"title":228,"path":229,"stem":230,"since":118,"experimental":119},"Request & response extractors","\u002Flaravel-openapi-generator\u002Fextending\u002Frequest-and-response-extractors","laravel-openapi-generator\u002F5.extending\u002F3.request-and-response-extractors",{"title":232,"path":233,"stem":234,"since":118,"experimental":119},"Operations & strategies","\u002Flaravel-openapi-generator\u002Fextending\u002Foperations-and-strategies","laravel-openapi-generator\u002F5.extending\u002F4.operations-and-strategies",{"title":236,"path":237,"stem":238,"since":118,"experimental":119},"Samplers","\u002Flaravel-openapi-generator\u002Fextending\u002Fsamplers","laravel-openapi-generator\u002F5.extending\u002F5.samplers",{"title":240,"path":241,"stem":242,"since":118,"experimental":119},"Passes & middlewares","\u002Flaravel-openapi-generator\u002Fextending\u002Fpasses-and-middlewares","laravel-openapi-generator\u002F5.extending\u002F6.passes-and-middlewares",{"title":244,"since":118,"experimental":119,"icon":245,"path":246,"stem":247,"children":248,"page":119},"Integrations","i-lucide-plug","\u002Flaravel-openapi-generator\u002Fintegrations","laravel-openapi-generator\u002F6.integrations",[249,253],{"title":250,"path":251,"stem":252,"since":118,"experimental":119},"JSON:API","\u002Flaravel-openapi-generator\u002Fintegrations\u002Fjson-api","laravel-openapi-generator\u002F6.integrations\u002F1.json-api",{"title":254,"path":255,"stem":256,"since":257,"experimental":119},"API revisions","\u002Flaravel-openapi-generator\u002Fintegrations\u002Fapi-revisions","laravel-openapi-generator\u002F6.integrations\u002F2.api-revisions","1.2",{"title":259,"since":118,"experimental":119,"icon":260,"path":261,"stem":262,"children":263,"page":119},"Reference","i-lucide-library","\u002Flaravel-openapi-generator\u002Freference","laravel-openapi-generator\u002F7.reference",[264,268,272,276,280],{"title":265,"path":266,"stem":267,"since":118,"experimental":119},"Configuration","\u002Flaravel-openapi-generator\u002Freference\u002Fconfiguration","laravel-openapi-generator\u002F7.reference\u002F1.configuration",{"title":269,"path":270,"stem":271,"since":118,"experimental":119},"Attributes","\u002Flaravel-openapi-generator\u002Freference\u002Fattributes","laravel-openapi-generator\u002F7.reference\u002F2.attributes",{"title":273,"path":274,"stem":275,"since":118,"experimental":119},"Commands","\u002Flaravel-openapi-generator\u002Freference\u002Fcommands","laravel-openapi-generator\u002F7.reference\u002F3.commands",{"title":277,"path":278,"stem":279,"since":118,"experimental":119},"Validation rules","\u002Flaravel-openapi-generator\u002Freference\u002Fvalidation-rules","laravel-openapi-generator\u002F7.reference\u002F4.validation-rules",{"title":281,"path":282,"stem":283,"since":118,"experimental":119},"PHPDoc types","\u002Flaravel-openapi-generator\u002Freference\u002Fphpdoc-types","laravel-openapi-generator\u002F7.reference\u002F5.phpdoc-types",{"title":285,"path":286,"children":287},"Releases","\u002Flaravel-openapi-generator\u002Freleases",[288,292],{"title":289,"path":290,"stem":291,"since":118,"experimental":119},"Upgrade guide","\u002Flaravel-openapi-generator\u002Fupgrade","laravel-openapi-generator\u002FUPGRADE",{"title":293,"path":294,"stem":295,"since":118,"experimental":119},"Changelog","\u002Flaravel-openapi-generator\u002Fchangelog","laravel-openapi-generator\u002FCHANGELOG",{"id":297,"title":166,"body":298,"description":2595,"experimental":119,"extension":2596,"links":118,"meta":2597,"navigation":486,"path":167,"rawbody":2598,"seo":2599,"since":118,"stem":168,"__hash__":2600},"laravel_openapi_generator\u002Flaravel-openapi-generator\u002F2.documenting-endpoints\u002F7.webhooks-and-callbacks.md",{"type":299,"value":300,"toc":2583},"minimark",[301,331,340,969,974,1518,1528,1549,1553,1676,1682,1830,1834,1847,1927,1936,1942,1946,1953,1999,2005,2154,2172,2176,2181,2203,2207,2213,2217,2224,2384,2390,2478,2576,2579],[302,303,304,305,309,310,314,315,318,319,322,323,326,327,330],"p",{},"A webhook is a request your application ",[306,307,308],"strong",{},"sends",". Declare it by its payload: a ",[311,312,313],"code",{},"JsonResource"," marked ",[311,316,317],{},"#[Webhook]",".\nThe generator finds the class without any route and writes it under ",[311,320,321],{},"webhooks",", never under ",[311,324,325],{},"paths",". The same class\nis what your application sends, so the document describes exactly what goes out. ",[311,328,329],{},"#[Callback]"," documents a request\nsent back to a URL the client gave in its own request.",[332,333,335,336],"h2",{"id":334},"declare-a-webhook","Declare a webhook ",[337,338],"since",{"v":339},"1.3",[341,342,344,349,815,821,825,828],"steps",{"level":343},"3",[345,346,348],"h3",{"id":347},"write-the-payload-as-a-resource","Write the payload as a resource",[350,351,357],"pre",{"className":352,"code":353,"filename":354,"language":355,"meta":356,"style":356},"language-php shiki shiki-themes material-theme-lighter github-light github-dark","use Ark4ne\\OpenApi\\Attributes\\Header;\nuse Ark4ne\\OpenApi\\Attributes\\Webhook;\nuse App\\Models\\Article;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Http\\Resources\\Json\\JsonResource;\n\n\u002F**\n * An article was published.\n *\n * Sent once, when the article goes live.\n *\n * @mixin Article\n *\u002F\n#[Webhook('article.published')]\n#[Header('X-Signature', required: true, description: 'HMAC of the body')]\n#[Header('X-Attempt', type: 'positive-int', example: 1)]\nfinal class ArticlePublished extends JsonResource\n{\n    public function toArray(Request $request): array\n    {\n        return [\n            'id' => $this->id,\n            'title' => $this->title,\n            'author' => $this->whenLoaded('author'),\n        ];\n    }\n}\n","app\u002FWebhooks\u002FArticlePublished.php","php","",[311,358,359,392,414,434,454,481,488,495,501,507,512,517,523,529,557,605,650,669,675,707,712,722,747,767,797,803,809],{"__ignoreMap":356},[360,361,364,368,372,376,379,381,383,385,388],"span",{"class":362,"line":363},"line",1,[360,365,367],{"class":366},"sw1J6","use",[360,369,371],{"class":370},"s_hVV"," Ark4ne",[360,373,375],{"class":374},"s39Yj","\\",[360,377,378],{"class":370},"OpenApi",[360,380,375],{"class":374},[360,382,269],{"class":370},[360,384,375],{"class":374},[360,386,387],{"class":370},"Header",[360,389,391],{"class":390},"sP7_E",";\n",[360,393,395,397,399,401,403,405,407,409,412],{"class":362,"line":394},2,[360,396,367],{"class":366},[360,398,371],{"class":370},[360,400,375],{"class":374},[360,402,378],{"class":370},[360,404,375],{"class":374},[360,406,269],{"class":370},[360,408,375],{"class":374},[360,410,411],{"class":370},"Webhook",[360,413,391],{"class":390},[360,415,417,419,422,424,427,429,432],{"class":362,"line":416},3,[360,418,367],{"class":366},[360,420,421],{"class":370}," App",[360,423,375],{"class":374},[360,425,426],{"class":370},"Models",[360,428,375],{"class":374},[360,430,431],{"class":370},"Article",[360,433,391],{"class":390},[360,435,437,439,442,444,447,449,452],{"class":362,"line":436},4,[360,438,367],{"class":366},[360,440,441],{"class":370}," Illuminate",[360,443,375],{"class":374},[360,445,446],{"class":370},"Http",[360,448,375],{"class":374},[360,450,451],{"class":370},"Request",[360,453,391],{"class":390},[360,455,457,459,461,463,465,467,470,472,475,477,479],{"class":362,"line":456},5,[360,458,367],{"class":366},[360,460,441],{"class":370},[360,462,375],{"class":374},[360,464,446],{"class":370},[360,466,375],{"class":374},[360,468,469],{"class":370},"Resources",[360,471,375],{"class":374},[360,473,474],{"class":370},"Json",[360,476,375],{"class":374},[360,478,313],{"class":370},[360,480,391],{"class":390},[360,482,484],{"class":362,"line":483},6,[360,485,487],{"emptyLinePlaceholder":486},true,"\n",[360,489,491],{"class":362,"line":490},7,[360,492,494],{"class":493},"sutJx","\u002F**\n",[360,496,498],{"class":362,"line":497},8,[360,499,500],{"class":493}," * An article was published.\n",[360,502,504],{"class":362,"line":503},9,[360,505,506],{"class":493}," *\n",[360,508,509],{"class":362,"line":29},[360,510,511],{"class":493}," * Sent once, when the article goes live.\n",[360,513,515],{"class":362,"line":514},11,[360,516,506],{"class":493},[360,518,520],{"class":362,"line":519},12,[360,521,522],{"class":493}," * @mixin Article\n",[360,524,526],{"class":362,"line":525},13,[360,527,528],{"class":493}," *\u002F\n",[360,530,532,536,538,541,545,549,551,554],{"class":362,"line":531},14,[360,533,535],{"class":534},"su5hD","#[",[360,537,411],{"class":370},[360,539,540],{"class":390},"(",[360,542,544],{"class":543},"sjJ54","'",[360,546,548],{"class":547},"s_sjI","article.published",[360,550,544],{"class":543},[360,552,553],{"class":390},")",[360,555,556],{"class":534},"]\n",[360,558,560,562,564,566,568,571,573,576,580,583,586,588,591,593,596,599,601,603],{"class":362,"line":559},15,[360,561,535],{"class":534},[360,563,387],{"class":370},[360,565,540],{"class":390},[360,567,544],{"class":543},[360,569,570],{"class":547},"X-Signature",[360,572,544],{"class":543},[360,574,575],{"class":390},",",[360,577,579],{"class":578},"sbgvK"," required",[360,581,582],{"class":390},":",[360,584,585],{"class":374}," true",[360,587,575],{"class":390},[360,589,590],{"class":578}," description",[360,592,582],{"class":390},[360,594,595],{"class":543}," '",[360,597,598],{"class":547},"HMAC of the body",[360,600,544],{"class":543},[360,602,553],{"class":390},[360,604,556],{"class":534},[360,606,608,610,612,614,616,619,621,623,626,628,630,633,635,637,640,642,646,648],{"class":362,"line":607},16,[360,609,535],{"class":534},[360,611,387],{"class":370},[360,613,540],{"class":390},[360,615,544],{"class":543},[360,617,618],{"class":547},"X-Attempt",[360,620,544],{"class":543},[360,622,575],{"class":390},[360,624,625],{"class":578}," type",[360,627,582],{"class":390},[360,629,595],{"class":543},[360,631,632],{"class":547},"positive-int",[360,634,544],{"class":543},[360,636,575],{"class":390},[360,638,639],{"class":578}," example",[360,641,582],{"class":390},[360,643,645],{"class":644},"srdBf"," 1",[360,647,553],{"class":390},[360,649,556],{"class":534},[360,651,653,657,660,663,666],{"class":362,"line":652},17,[360,654,656],{"class":655},"sbsja","final",[360,658,659],{"class":655}," class",[360,661,662],{"class":578}," ArticlePublished",[360,664,665],{"class":655}," extends",[360,667,668],{"class":578}," JsonResource\n",[360,670,672],{"class":362,"line":671},18,[360,673,674],{"class":390},"{\n",[360,676,678,681,684,688,690,693,696,699,701,704],{"class":362,"line":677},19,[360,679,680],{"class":655},"    public",[360,682,683],{"class":655}," function",[360,685,687],{"class":686},"sGLFI"," toArray",[360,689,540],{"class":390},[360,691,451],{"class":692},"sZMiF",[360,694,695],{"class":390}," $",[360,697,698],{"class":534},"request",[360,700,553],{"class":390},[360,702,582],{"class":703},"smGrS",[360,705,706],{"class":366}," array\n",[360,708,709],{"class":362,"line":58},[360,710,711],{"class":390},"    {\n",[360,713,715,719],{"class":362,"line":714},21,[360,716,718],{"class":717},"sVHd0","        return",[360,720,721],{"class":390}," [\n",[360,723,725,728,731,733,736,739,742,744],{"class":362,"line":724},22,[360,726,727],{"class":543},"            '",[360,729,730],{"class":547},"id",[360,732,544],{"class":543},[360,734,735],{"class":703}," =>",[360,737,738],{"class":374}," $this",[360,740,741],{"class":703},"->",[360,743,730],{"class":534},[360,745,746],{"class":390},",\n",[360,748,750,752,755,757,759,761,763,765],{"class":362,"line":749},23,[360,751,727],{"class":543},[360,753,754],{"class":547},"title",[360,756,544],{"class":543},[360,758,735],{"class":703},[360,760,738],{"class":374},[360,762,741],{"class":703},[360,764,754],{"class":534},[360,766,746],{"class":390},[360,768,770,772,775,777,779,781,783,786,788,790,792,794],{"class":362,"line":769},24,[360,771,727],{"class":543},[360,773,774],{"class":547},"author",[360,776,544],{"class":543},[360,778,735],{"class":703},[360,780,738],{"class":374},[360,782,741],{"class":703},[360,784,785],{"class":686},"whenLoaded",[360,787,540],{"class":390},[360,789,544],{"class":543},[360,791,774],{"class":547},[360,793,544],{"class":543},[360,795,796],{"class":390},"),\n",[360,798,800],{"class":362,"line":799},25,[360,801,802],{"class":390},"        ];\n",[360,804,806],{"class":362,"line":805},26,[360,807,808],{"class":390},"    }\n",[360,810,812],{"class":362,"line":811},27,[360,813,814],{"class":390},"}\n",[302,816,817,818,820],{},"The name of ",[311,819,317],{}," is the key of the webhook and its operationId. It is required.",[345,822,824],{"id":823},"send-it","Send it",[302,826,827],{},"The resource resolves to an array, so any client sends it:",[350,829,831],{"className":352,"code":830,"language":355,"meta":356,"style":356},"$payload = ArticlePublished::make($article)->resolve();\n\nHttp::withHeaders(['X-Signature' => $signature])->post($url, $payload);\n\n\u002F\u002F spatie\u002Flaravel-webhook-server, or any other library\nWebhookCall::create()->url($url)->payload($payload)->dispatch();\n",[311,832,833,868,872,920,924,929],{"__ignoreMap":356},[360,834,835,838,841,844,846,849,852,855,858,860,862,865],{"class":362,"line":363},[360,836,837],{"class":390},"$",[360,839,840],{"class":534},"payload ",[360,842,843],{"class":703},"=",[360,845,662],{"class":692},[360,847,848],{"class":703},"::",[360,850,851],{"class":686},"make",[360,853,854],{"class":390},"($",[360,856,857],{"class":534},"article",[360,859,553],{"class":390},[360,861,741],{"class":703},[360,863,864],{"class":686},"resolve",[360,866,867],{"class":390},"();\n",[360,869,870],{"class":362,"line":394},[360,871,487],{"emptyLinePlaceholder":486},[360,873,874,876,878,881,884,886,888,890,892,894,897,900,902,905,907,910,912,914,917],{"class":362,"line":416},[360,875,446],{"class":692},[360,877,848],{"class":703},[360,879,880],{"class":686},"withHeaders",[360,882,883],{"class":390},"([",[360,885,544],{"class":543},[360,887,570],{"class":547},[360,889,544],{"class":543},[360,891,735],{"class":703},[360,893,695],{"class":390},[360,895,896],{"class":534},"signature",[360,898,899],{"class":390},"])",[360,901,741],{"class":703},[360,903,904],{"class":686},"post",[360,906,854],{"class":390},[360,908,909],{"class":534},"url",[360,911,575],{"class":390},[360,913,695],{"class":390},[360,915,916],{"class":534},"payload",[360,918,919],{"class":390},");\n",[360,921,922],{"class":362,"line":436},[360,923,487],{"emptyLinePlaceholder":486},[360,925,926],{"class":362,"line":456},[360,927,928],{"class":493},"\u002F\u002F spatie\u002Flaravel-webhook-server, or any other library\n",[360,930,931,934,936,939,942,944,946,948,950,952,954,956,958,960,962,964,967],{"class":362,"line":483},[360,932,933],{"class":692},"WebhookCall",[360,935,848],{"class":703},[360,937,938],{"class":686},"create",[360,940,941],{"class":390},"()",[360,943,741],{"class":703},[360,945,909],{"class":686},[360,947,854],{"class":390},[360,949,909],{"class":534},[360,951,553],{"class":390},[360,953,741],{"class":703},[360,955,916],{"class":686},[360,957,854],{"class":390},[360,959,916],{"class":534},[360,961,553],{"class":390},[360,963,741],{"class":703},[360,965,966],{"class":686},"dispatch",[360,968,867],{"class":390},[302,970,971,972,582],{},"The result, under ",[311,973,321],{},[350,975,979],{"className":976,"code":977,"language":978,"meta":356,"style":356},"language-json shiki shiki-themes material-theme-lighter github-light github-dark","{\n  \"webhooks\": {\n    \"article.published\": {\n      \"post\": {\n        \"tags\": [\"Webhooks\"],\n        \"summary\": \"An article was published.\",\n        \"description\": \"Sent once, when the article goes live.\",\n        \"operationId\": \"article.published\",\n        \"parameters\": [\n          {\n            \"name\": \"X-Signature\",\n            \"in\": \"header\",\n            \"description\": \"HMAC of the body\",\n            \"required\": true,\n            \"schema\": { \"type\": \"string\" }\n          },\n          {\n            \"name\": \"X-Attempt\",\n            \"in\": \"header\",\n            \"schema\": { \"type\": \"integer\", \"minimum\": 1, \"example\": 1 }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application\u002Fjson\": {\n              \"schema\": { \"$ref\": \"#\u002Fcomponents\u002Fschemas\u002FArticlePublished\" }\n            }\n          }\n        },\n        \"responses\": { \"200\": { \"description\": \"OK\" } }\n      }\n    }\n  }\n}\n","json",[311,980,981,985,1001,1014,1027,1053,1074,1094,1113,1126,1131,1152,1172,1190,1205,1239,1244,1248,1266,1284,1339,1344,1349,1362,1377,1390,1403,1435,1441,1446,1451,1496,1502,1507,1513],{"__ignoreMap":356},[360,982,983],{"class":362,"line":363},[360,984,674],{"class":390},[360,986,987,990,993,996,998],{"class":362,"line":394},[360,988,989],{"class":374},"  \"",[360,991,321],{"class":992},"sseR_",[360,994,995],{"class":374},"\"",[360,997,582],{"class":390},[360,999,1000],{"class":390}," {\n",[360,1002,1003,1006,1008,1010,1012],{"class":362,"line":416},[360,1004,1005],{"class":374},"    \"",[360,1007,548],{"class":692},[360,1009,995],{"class":374},[360,1011,582],{"class":390},[360,1013,1000],{"class":390},[360,1015,1016,1019,1021,1023,1025],{"class":362,"line":436},[360,1017,1018],{"class":374},"      \"",[360,1020,904],{"class":644},[360,1022,995],{"class":374},[360,1024,582],{"class":390},[360,1026,1000],{"class":390},[360,1028,1029,1032,1036,1038,1040,1043,1045,1048,1050],{"class":362,"line":456},[360,1030,1031],{"class":374},"        \"",[360,1033,1035],{"class":1034},"swQdS","tags",[360,1037,995],{"class":374},[360,1039,582],{"class":390},[360,1041,1042],{"class":390}," [",[360,1044,995],{"class":543},[360,1046,1047],{"class":547},"Webhooks",[360,1049,995],{"class":543},[360,1051,1052],{"class":390},"],\n",[360,1054,1055,1057,1060,1062,1064,1067,1070,1072],{"class":362,"line":483},[360,1056,1031],{"class":374},[360,1058,1059],{"class":1034},"summary",[360,1061,995],{"class":374},[360,1063,582],{"class":390},[360,1065,1066],{"class":543}," \"",[360,1068,1069],{"class":547},"An article was published.",[360,1071,995],{"class":543},[360,1073,746],{"class":390},[360,1075,1076,1078,1081,1083,1085,1087,1090,1092],{"class":362,"line":490},[360,1077,1031],{"class":374},[360,1079,1080],{"class":1034},"description",[360,1082,995],{"class":374},[360,1084,582],{"class":390},[360,1086,1066],{"class":543},[360,1088,1089],{"class":547},"Sent once, when the article goes live.",[360,1091,995],{"class":543},[360,1093,746],{"class":390},[360,1095,1096,1098,1101,1103,1105,1107,1109,1111],{"class":362,"line":497},[360,1097,1031],{"class":374},[360,1099,1100],{"class":1034},"operationId",[360,1102,995],{"class":374},[360,1104,582],{"class":390},[360,1106,1066],{"class":543},[360,1108,548],{"class":547},[360,1110,995],{"class":543},[360,1112,746],{"class":390},[360,1114,1115,1117,1120,1122,1124],{"class":362,"line":503},[360,1116,1031],{"class":374},[360,1118,1119],{"class":1034},"parameters",[360,1121,995],{"class":374},[360,1123,582],{"class":390},[360,1125,721],{"class":390},[360,1127,1128],{"class":362,"line":29},[360,1129,1130],{"class":390},"          {\n",[360,1132,1133,1136,1140,1142,1144,1146,1148,1150],{"class":362,"line":514},[360,1134,1135],{"class":374},"            \"",[360,1137,1139],{"class":1138},"sAQsV","name",[360,1141,995],{"class":374},[360,1143,582],{"class":390},[360,1145,1066],{"class":543},[360,1147,570],{"class":547},[360,1149,995],{"class":543},[360,1151,746],{"class":390},[360,1153,1154,1156,1159,1161,1163,1165,1168,1170],{"class":362,"line":519},[360,1155,1135],{"class":374},[360,1157,1158],{"class":1138},"in",[360,1160,995],{"class":374},[360,1162,582],{"class":390},[360,1164,1066],{"class":543},[360,1166,1167],{"class":547},"header",[360,1169,995],{"class":543},[360,1171,746],{"class":390},[360,1173,1174,1176,1178,1180,1182,1184,1186,1188],{"class":362,"line":525},[360,1175,1135],{"class":374},[360,1177,1080],{"class":1138},[360,1179,995],{"class":374},[360,1181,582],{"class":390},[360,1183,1066],{"class":543},[360,1185,598],{"class":547},[360,1187,995],{"class":543},[360,1189,746],{"class":390},[360,1191,1192,1194,1197,1199,1201,1203],{"class":362,"line":531},[360,1193,1135],{"class":374},[360,1195,1196],{"class":1138},"required",[360,1198,995],{"class":374},[360,1200,582],{"class":390},[360,1202,585],{"class":374},[360,1204,746],{"class":390},[360,1206,1207,1209,1212,1214,1216,1219,1221,1225,1227,1229,1231,1234,1236],{"class":362,"line":559},[360,1208,1135],{"class":374},[360,1210,1211],{"class":1138},"schema",[360,1213,995],{"class":374},[360,1215,582],{"class":390},[360,1217,1218],{"class":390}," {",[360,1220,1066],{"class":374},[360,1222,1224],{"class":1223},"sptTA","type",[360,1226,995],{"class":374},[360,1228,582],{"class":390},[360,1230,1066],{"class":543},[360,1232,1233],{"class":547},"string",[360,1235,995],{"class":543},[360,1237,1238],{"class":390}," }\n",[360,1240,1241],{"class":362,"line":607},[360,1242,1243],{"class":390},"          },\n",[360,1245,1246],{"class":362,"line":652},[360,1247,1130],{"class":390},[360,1249,1250,1252,1254,1256,1258,1260,1262,1264],{"class":362,"line":671},[360,1251,1135],{"class":374},[360,1253,1139],{"class":1138},[360,1255,995],{"class":374},[360,1257,582],{"class":390},[360,1259,1066],{"class":543},[360,1261,618],{"class":547},[360,1263,995],{"class":543},[360,1265,746],{"class":390},[360,1267,1268,1270,1272,1274,1276,1278,1280,1282],{"class":362,"line":677},[360,1269,1135],{"class":374},[360,1271,1158],{"class":1138},[360,1273,995],{"class":374},[360,1275,582],{"class":390},[360,1277,1066],{"class":543},[360,1279,1167],{"class":547},[360,1281,995],{"class":543},[360,1283,746],{"class":390},[360,1285,1286,1288,1290,1292,1294,1296,1298,1300,1302,1304,1306,1309,1311,1313,1315,1318,1320,1322,1324,1326,1328,1331,1333,1335,1337],{"class":362,"line":58},[360,1287,1135],{"class":374},[360,1289,1211],{"class":1138},[360,1291,995],{"class":374},[360,1293,582],{"class":390},[360,1295,1218],{"class":390},[360,1297,1066],{"class":374},[360,1299,1224],{"class":1223},[360,1301,995],{"class":374},[360,1303,582],{"class":390},[360,1305,1066],{"class":543},[360,1307,1308],{"class":547},"integer",[360,1310,995],{"class":543},[360,1312,575],{"class":390},[360,1314,1066],{"class":374},[360,1316,1317],{"class":1223},"minimum",[360,1319,995],{"class":374},[360,1321,582],{"class":390},[360,1323,645],{"class":644},[360,1325,575],{"class":390},[360,1327,1066],{"class":374},[360,1329,1330],{"class":1223},"example",[360,1332,995],{"class":374},[360,1334,582],{"class":390},[360,1336,645],{"class":644},[360,1338,1238],{"class":390},[360,1340,1341],{"class":362,"line":714},[360,1342,1343],{"class":390},"          }\n",[360,1345,1346],{"class":362,"line":724},[360,1347,1348],{"class":390},"        ],\n",[360,1350,1351,1353,1356,1358,1360],{"class":362,"line":749},[360,1352,1031],{"class":374},[360,1354,1355],{"class":1034},"requestBody",[360,1357,995],{"class":374},[360,1359,582],{"class":390},[360,1361,1000],{"class":390},[360,1363,1364,1367,1369,1371,1373,1375],{"class":362,"line":769},[360,1365,1366],{"class":374},"          \"",[360,1368,1196],{"class":1138},[360,1370,995],{"class":374},[360,1372,582],{"class":390},[360,1374,585],{"class":374},[360,1376,746],{"class":390},[360,1378,1379,1381,1384,1386,1388],{"class":362,"line":799},[360,1380,1366],{"class":374},[360,1382,1383],{"class":1138},"content",[360,1385,995],{"class":374},[360,1387,582],{"class":390},[360,1389,1000],{"class":390},[360,1391,1392,1394,1397,1399,1401],{"class":362,"line":805},[360,1393,1135],{"class":374},[360,1395,1396],{"class":1223},"application\u002Fjson",[360,1398,995],{"class":374},[360,1400,582],{"class":390},[360,1402,1000],{"class":390},[360,1404,1405,1408,1411,1413,1415,1417,1419,1422,1424,1426,1428,1431,1433],{"class":362,"line":811},[360,1406,1407],{"class":374},"              \"",[360,1409,1211],{"class":1410},"syTEX",[360,1412,995],{"class":374},[360,1414,582],{"class":390},[360,1416,1218],{"class":390},[360,1418,1066],{"class":374},[360,1420,1421],{"class":992},"$ref",[360,1423,995],{"class":374},[360,1425,582],{"class":390},[360,1427,1066],{"class":543},[360,1429,1430],{"class":547},"#\u002Fcomponents\u002Fschemas\u002FArticlePublished",[360,1432,995],{"class":543},[360,1434,1238],{"class":390},[360,1436,1438],{"class":362,"line":1437},28,[360,1439,1440],{"class":390},"            }\n",[360,1442,1444],{"class":362,"line":1443},29,[360,1445,1343],{"class":390},[360,1447,1448],{"class":362,"line":84},[360,1449,1450],{"class":390},"        },\n",[360,1452,1454,1456,1459,1461,1463,1465,1467,1470,1472,1474,1476,1478,1480,1482,1484,1486,1489,1491,1494],{"class":362,"line":1453},31,[360,1455,1031],{"class":374},[360,1457,1458],{"class":1034},"responses",[360,1460,995],{"class":374},[360,1462,582],{"class":390},[360,1464,1218],{"class":390},[360,1466,1066],{"class":374},[360,1468,1469],{"class":1138},"200",[360,1471,995],{"class":374},[360,1473,582],{"class":390},[360,1475,1218],{"class":390},[360,1477,1066],{"class":374},[360,1479,1080],{"class":1223},[360,1481,995],{"class":374},[360,1483,582],{"class":390},[360,1485,1066],{"class":543},[360,1487,1488],{"class":547},"OK",[360,1490,995],{"class":543},[360,1492,1493],{"class":390}," }",[360,1495,1238],{"class":390},[360,1497,1499],{"class":362,"line":1498},32,[360,1500,1501],{"class":390},"      }\n",[360,1503,1505],{"class":362,"line":1504},33,[360,1506,808],{"class":390},[360,1508,1510],{"class":362,"line":1509},34,[360,1511,1512],{"class":390},"  }\n",[360,1514,1516],{"class":362,"line":1515},35,[360,1517,814],{"class":390},[302,1519,1520,1521,1523,1524,1527],{},"The body is described like a resource an action returns: the resource runs on a sampled model, ",[311,1522,774],{}," is optional\nbecause it is loaded conditionally, and the schema is a component. See\n",[1525,1526,158],"a",{"href":159},".",[1529,1530,1531],"note",{},[302,1532,1533,1534,1537,1538,1541,1542,1545,1546,1527],{},"A resource with a format, such as a JSON:API resource, is documented as the document it renders: ",[311,1535,1536],{},"{\"data\": …}",", as\n",[311,1539,1540],{},"application\u002Fvnd.api+json",". Send that document, not ",[311,1543,1544],{},"resolve()",", which gives the resource object alone:\n",[311,1547,1548],{},"ArticlePublished::make($article)->response()->getData(true)",[332,1550,1552],{"id":1551},"what-the-class-carries","What the class carries",[1554,1555,1556,1572],"table",{},[1557,1558,1559],"thead",{},[1560,1561,1562,1566,1569],"tr",{},[1563,1564,1565],"th",{},"Need",[1563,1567,1568],{},"Declaration",[1563,1570,1571],{},"Default",[1573,1574,1575,1588,1603,1617,1633,1649,1661],"tbody",{},[1560,1576,1577,1581,1586],{},[1578,1579,1580],"td",{},"key and operationId",[1578,1582,1583],{},[311,1584,1585],{},"#[Webhook('article.published')]",[1578,1587,1196],{},[1560,1589,1590,1593,1598],{},[1578,1591,1592],{},"HTTP method",[1578,1594,1595],{},[311,1596,1597],{},"#[Webhook('article.published', method: 'PUT')]",[1578,1599,1600],{},[311,1601,1602],{},"POST",[1560,1604,1605,1608,1614],{},[1578,1606,1607],{},"summary, description",[1578,1609,1610,1611],{},"the PHPDoc of the class; ",[311,1612,1613],{},"@deprecated",[1578,1615,1616],{},"none",[1560,1618,1619,1622,1628],{},[1578,1620,1621],{},"operationId, tags, deprecation",[1578,1623,1624,1627],{},[311,1625,1626],{},"#[Operation]"," on the class",[1578,1629,1630,1631],{},"the name; tag ",[311,1632,1047],{},[1560,1634,1635,1638,1647],{},[1578,1636,1637],{},"tags with details",[1578,1639,1640,1643,1644,1646],{},[311,1641,1642],{},"#[Tag]"," on the class (replaces the ",[311,1645,1047],{}," tag)",[1578,1648,1616],{},[1560,1650,1651,1654,1659],{},[1578,1652,1653],{},"headers sent",[1578,1655,1656,1627],{},[311,1657,1658],{},"#[Header]",[1578,1660,1616],{},[1560,1662,1663,1666,1671],{},[1578,1664,1665],{},"what the receiver answers",[1578,1667,1668,1627],{},[311,1669,1670],{},"#[Response]",[1578,1672,1673],{},[311,1674,1675],{},"200 OK",[302,1677,1678,1679,1681],{},"Only the attributes of the class itself are read. An abstract class marked ",[311,1680,317],{}," is never a webhook, and a\nclass without a name is left out with a warning.",[350,1683,1685],{"className":352,"code":1684,"language":355,"meta":356,"style":356},"#[Webhook('article.archived', method: 'PUT')]\n#[Operation(operationId: 'articleArchived', tags: ['Articles'])]\n#[Response(204, description: 'Received')]\n#[Response(410, description: 'The subscription is cancelled')]\nfinal class ArticleArchived extends JsonResource\n",[311,1686,1687,1720,1760,1789,1817],{"__ignoreMap":356},[360,1688,1689,1691,1693,1695,1697,1700,1702,1704,1707,1709,1711,1714,1716,1718],{"class":362,"line":363},[360,1690,535],{"class":534},[360,1692,411],{"class":370},[360,1694,540],{"class":390},[360,1696,544],{"class":543},[360,1698,1699],{"class":547},"article.archived",[360,1701,544],{"class":543},[360,1703,575],{"class":390},[360,1705,1706],{"class":578}," method",[360,1708,582],{"class":390},[360,1710,595],{"class":543},[360,1712,1713],{"class":547},"PUT",[360,1715,544],{"class":543},[360,1717,553],{"class":390},[360,1719,556],{"class":534},[360,1721,1722,1724,1727,1729,1731,1733,1735,1738,1740,1742,1745,1747,1749,1751,1754,1756,1758],{"class":362,"line":394},[360,1723,535],{"class":534},[360,1725,1726],{"class":370},"Operation",[360,1728,540],{"class":390},[360,1730,1100],{"class":578},[360,1732,582],{"class":390},[360,1734,595],{"class":543},[360,1736,1737],{"class":547},"articleArchived",[360,1739,544],{"class":543},[360,1741,575],{"class":390},[360,1743,1744],{"class":578}," tags",[360,1746,582],{"class":390},[360,1748,1042],{"class":390},[360,1750,544],{"class":543},[360,1752,1753],{"class":547},"Articles",[360,1755,544],{"class":543},[360,1757,899],{"class":390},[360,1759,556],{"class":534},[360,1761,1762,1764,1767,1769,1772,1774,1776,1778,1780,1783,1785,1787],{"class":362,"line":416},[360,1763,535],{"class":534},[360,1765,1766],{"class":370},"Response",[360,1768,540],{"class":390},[360,1770,1771],{"class":644},"204",[360,1773,575],{"class":390},[360,1775,590],{"class":578},[360,1777,582],{"class":390},[360,1779,595],{"class":543},[360,1781,1782],{"class":547},"Received",[360,1784,544],{"class":543},[360,1786,553],{"class":390},[360,1788,556],{"class":534},[360,1790,1791,1793,1795,1797,1800,1802,1804,1806,1808,1811,1813,1815],{"class":362,"line":436},[360,1792,535],{"class":534},[360,1794,1766],{"class":370},[360,1796,540],{"class":390},[360,1798,1799],{"class":644},"410",[360,1801,575],{"class":390},[360,1803,590],{"class":578},[360,1805,582],{"class":390},[360,1807,595],{"class":543},[360,1809,1810],{"class":547},"The subscription is cancelled",[360,1812,544],{"class":543},[360,1814,553],{"class":390},[360,1816,556],{"class":534},[360,1818,1819,1821,1823,1826,1828],{"class":362,"line":456},[360,1820,656],{"class":655},[360,1822,659],{"class":655},[360,1824,1825],{"class":578}," ArticleArchived",[360,1827,665],{"class":655},[360,1829,668],{"class":578},[332,1831,1833],{"id":1832},"where-the-classes-are-found","Where the classes are found",[302,1835,1836,1837,1840,1841,1843,1844,582],{},"By default, every class under ",[311,1838,1839],{},"app\u002F"," is a candidate: only the PHP files that mention ",[311,1842,411],{}," are read, so the scan\nloads no other class. Narrow it, or list classes from a package or a module, in ",[311,1845,1846],{},"config\u002Fopenapi.php",[350,1848,1850],{"className":352,"code":1849,"filename":1846,"language":355,"meta":356,"style":356},"'webhooks' => [\n    'paths' => [app_path('Webhooks')],\n    'classes' => [Billing\\Webhooks\\InvoiceIssued::class],\n],\n",[311,1851,1852,1864,1891,1923],{"__ignoreMap":356},[360,1853,1854,1856,1858,1860,1862],{"class":362,"line":363},[360,1855,544],{"class":543},[360,1857,321],{"class":547},[360,1859,544],{"class":543},[360,1861,735],{"class":703},[360,1863,721],{"class":390},[360,1865,1866,1869,1871,1873,1875,1877,1880,1882,1884,1886,1888],{"class":362,"line":394},[360,1867,1868],{"class":543},"    '",[360,1870,325],{"class":547},[360,1872,544],{"class":543},[360,1874,735],{"class":703},[360,1876,1042],{"class":390},[360,1878,1879],{"class":686},"app_path",[360,1881,540],{"class":390},[360,1883,544],{"class":543},[360,1885,1047],{"class":547},[360,1887,544],{"class":543},[360,1889,1890],{"class":390},")],\n",[360,1892,1893,1895,1898,1900,1902,1904,1907,1909,1911,1913,1916,1918,1921],{"class":362,"line":416},[360,1894,1868],{"class":543},[360,1896,1897],{"class":547},"classes",[360,1899,544],{"class":543},[360,1901,735],{"class":703},[360,1903,1042],{"class":390},[360,1905,1906],{"class":370},"Billing",[360,1908,375],{"class":374},[360,1910,1047],{"class":370},[360,1912,375],{"class":374},[360,1914,1915],{"class":692},"InvoiceIssued",[360,1917,848],{"class":703},[360,1919,1920],{"class":366},"class",[360,1922,1052],{"class":390},[360,1924,1925],{"class":362,"line":436},[360,1926,1052],{"class":390},[302,1928,1929,1930,1932,1933,1935],{},"A file whose class cannot be loaded is skipped with a warning. A listed class that is not a concrete ",[311,1931,313],{},"\nmarked ",[311,1934,317],{}," fails the command, before any document is generated.",[302,1937,1938,1939,1527],{},"Check one webhook with ",[311,1940,1941],{},"php artisan openapi:inspect article.published",[332,1943,1945],{"id":1944},"choose-the-webhooks-of-each-document","Choose the webhooks of each document",[302,1947,1948,1949,1952],{},"Every document gets every webhook found. Leave a webhook out of all of them with ",[311,1950,1951],{},"#[Exclude]"," on its class:",[350,1954,1956],{"className":352,"code":1955,"language":355,"meta":356,"style":356},"#[Webhook('article.drafted')]\n#[Exclude]\nfinal class ArticleDrafted extends JsonResource\n",[311,1957,1958,1977,1986],{"__ignoreMap":356},[360,1959,1960,1962,1964,1966,1968,1971,1973,1975],{"class":362,"line":363},[360,1961,535],{"class":534},[360,1963,411],{"class":370},[360,1965,540],{"class":390},[360,1967,544],{"class":543},[360,1969,1970],{"class":547},"article.drafted",[360,1972,544],{"class":543},[360,1974,553],{"class":390},[360,1976,556],{"class":534},[360,1978,1979,1981,1984],{"class":362,"line":394},[360,1980,535],{"class":534},[360,1982,1983],{"class":370},"Exclude",[360,1985,556],{"class":534},[360,1987,1988,1990,1992,1995,1997],{"class":362,"line":416},[360,1989,656],{"class":655},[360,1991,659],{"class":655},[360,1993,1994],{"class":578}," ArticleDrafted",[360,1996,665],{"class":655},[360,1998,668],{"class":578},[302,2000,2001,2002,2004],{},"Choose the webhooks of one document by their name, with shell masks in its own ",[311,2003,321],{},". They apply to the\nwebhooks declared on routes too:",[350,2006,2008],{"className":352,"code":2007,"filename":1846,"language":355,"meta":356,"style":356},"'documents' => [\n    'public' => [\n        'webhooks' => [\n            'include' => ['article.*'],\n            'exclude' => ['article.archived'],\n        ],\n    ],\n    'partners' => [\n        'webhooks' => ['include' => ['invoice.*']],\n    ],\n],\n",[311,2009,2010,2023,2036,2049,2071,2092,2096,2101,2114,2146,2150],{"__ignoreMap":356},[360,2011,2012,2014,2017,2019,2021],{"class":362,"line":363},[360,2013,544],{"class":543},[360,2015,2016],{"class":547},"documents",[360,2018,544],{"class":543},[360,2020,735],{"class":703},[360,2022,721],{"class":390},[360,2024,2025,2027,2030,2032,2034],{"class":362,"line":394},[360,2026,1868],{"class":543},[360,2028,2029],{"class":547},"public",[360,2031,544],{"class":543},[360,2033,735],{"class":703},[360,2035,721],{"class":390},[360,2037,2038,2041,2043,2045,2047],{"class":362,"line":416},[360,2039,2040],{"class":543},"        '",[360,2042,321],{"class":547},[360,2044,544],{"class":543},[360,2046,735],{"class":703},[360,2048,721],{"class":390},[360,2050,2051,2053,2056,2058,2060,2062,2064,2067,2069],{"class":362,"line":436},[360,2052,727],{"class":543},[360,2054,2055],{"class":547},"include",[360,2057,544],{"class":543},[360,2059,735],{"class":703},[360,2061,1042],{"class":390},[360,2063,544],{"class":543},[360,2065,2066],{"class":547},"article.*",[360,2068,544],{"class":543},[360,2070,1052],{"class":390},[360,2072,2073,2075,2078,2080,2082,2084,2086,2088,2090],{"class":362,"line":456},[360,2074,727],{"class":543},[360,2076,2077],{"class":547},"exclude",[360,2079,544],{"class":543},[360,2081,735],{"class":703},[360,2083,1042],{"class":390},[360,2085,544],{"class":543},[360,2087,1699],{"class":547},[360,2089,544],{"class":543},[360,2091,1052],{"class":390},[360,2093,2094],{"class":362,"line":483},[360,2095,1348],{"class":390},[360,2097,2098],{"class":362,"line":490},[360,2099,2100],{"class":390},"    ],\n",[360,2102,2103,2105,2108,2110,2112],{"class":362,"line":497},[360,2104,1868],{"class":543},[360,2106,2107],{"class":547},"partners",[360,2109,544],{"class":543},[360,2111,735],{"class":703},[360,2113,721],{"class":390},[360,2115,2116,2118,2120,2122,2124,2126,2128,2130,2132,2134,2136,2138,2141,2143],{"class":362,"line":503},[360,2117,2040],{"class":543},[360,2119,321],{"class":547},[360,2121,544],{"class":543},[360,2123,735],{"class":703},[360,2125,1042],{"class":390},[360,2127,544],{"class":543},[360,2129,2055],{"class":547},[360,2131,544],{"class":543},[360,2133,735],{"class":703},[360,2135,1042],{"class":390},[360,2137,544],{"class":543},[360,2139,2140],{"class":547},"invoice.*",[360,2142,544],{"class":543},[360,2144,2145],{"class":390},"]],\n",[360,2147,2148],{"class":362,"line":29},[360,2149,2100],{"class":390},[360,2151,2152],{"class":362,"line":514},[360,2153,1052],{"class":390},[302,2155,2156,2158,2159,2161,2162,2164,2165,2167,2168,2171],{},[311,2157,2055],{}," keeps the names it matches (every name when empty), ",[311,2160,2077],{}," leaves out those it matches, over ",[311,2163,2055],{},".\nA document overrides the global ",[311,2166,321],{}," key by key: ",[311,2169,2170],{},"'webhooks' => ['paths' => []]"," gives it no webhook found by\nscanning.",[332,2173,2175],{"id":2174},"openapi-versions","OpenAPI versions",[302,2177,2178,2180],{},[311,2179,321],{}," exists from OpenAPI 3.1. In a 3.0 document:",[2182,2183,2184,2196],"ul",{},[2185,2186,2187,2188,2191,2192,2195],"li",{},"with ",[311,2189,2190],{},"vendor_extensions: redoc",", the webhooks are written as ",[311,2193,2194],{},"x-webhooks",";",[2185,2197,2198,2199,2202],{},"otherwise a strict document fails, and a lenient one (",[311,2200,2201],{},"strict: false",") drops them with a warning.",[332,2204,2206],{"id":2205},"webhooks-declared-on-routes","Webhooks declared on routes",[302,2208,2209,2210,2212],{},"Before 1.3, a webhook was an action marked ",[311,2211,317],{}," behind a route registered only to be documented and kept\nfrom answering by a middleware. It still works, and is deprecated: move the payload to a resource class. When a\npayload class and a route webhook have the same name and method, the payload class is kept, with a warning.",[332,2214,2216],{"id":2215},"callbacks","Callbacks",[302,2218,2219,2220,2223],{},"A callback is a request sent to a URL the client gave, such as a ",[311,2221,2222],{},"callback_url"," field of its request. Declare it on\nthe operation that receives that URL, with a runtime expression:",[350,2225,2228],{"className":352,"code":2226,"filename":2227,"language":355,"meta":356,"style":356},"use Ark4ne\\OpenApi\\Attributes\\Callback;\n\nfinal class ArticleController\n{\n    \u002F**\n     * Submit an article; `callback_url` is called once it is published.\n     *\u002F\n    #[Callback(\n        'articlePublished',\n        url: '{$request.body#\u002Fcallback_url}',\n        webhook: 'article.published',\n    )]\n    public function store(StoreArticleRequest $request): ArticleResource\n    {\n        \u002F\u002F …\n    }\n}\n","app\u002FHttp\u002FControllers\u002FArticleController.php",[311,2229,2230,2251,2255,2264,2268,2273,2278,2283,2293,2304,2320,2335,2342,2367,2371,2376,2380],{"__ignoreMap":356},[360,2231,2232,2234,2236,2238,2240,2242,2244,2246,2249],{"class":362,"line":363},[360,2233,367],{"class":366},[360,2235,371],{"class":370},[360,2237,375],{"class":374},[360,2239,378],{"class":370},[360,2241,375],{"class":374},[360,2243,269],{"class":370},[360,2245,375],{"class":374},[360,2247,2248],{"class":370},"Callback",[360,2250,391],{"class":390},[360,2252,2253],{"class":362,"line":394},[360,2254,487],{"emptyLinePlaceholder":486},[360,2256,2257,2259,2261],{"class":362,"line":416},[360,2258,656],{"class":655},[360,2260,659],{"class":655},[360,2262,2263],{"class":578}," ArticleController\n",[360,2265,2266],{"class":362,"line":436},[360,2267,674],{"class":390},[360,2269,2270],{"class":362,"line":456},[360,2271,2272],{"class":493},"    \u002F**\n",[360,2274,2275],{"class":362,"line":483},[360,2276,2277],{"class":493},"     * Submit an article; `callback_url` is called once it is published.\n",[360,2279,2280],{"class":362,"line":490},[360,2281,2282],{"class":493},"     *\u002F\n",[360,2284,2285,2288,2290],{"class":362,"line":497},[360,2286,2287],{"class":534},"    #[",[360,2289,2248],{"class":370},[360,2291,2292],{"class":390},"(\n",[360,2294,2295,2297,2300,2302],{"class":362,"line":503},[360,2296,2040],{"class":543},[360,2298,2299],{"class":547},"articlePublished",[360,2301,544],{"class":543},[360,2303,746],{"class":390},[360,2305,2306,2309,2311,2313,2316,2318],{"class":362,"line":29},[360,2307,2308],{"class":578},"        url",[360,2310,582],{"class":390},[360,2312,595],{"class":543},[360,2314,2315],{"class":547},"{$request.body#\u002Fcallback_url}",[360,2317,544],{"class":543},[360,2319,746],{"class":390},[360,2321,2322,2325,2327,2329,2331,2333],{"class":362,"line":514},[360,2323,2324],{"class":578},"        webhook",[360,2326,582],{"class":390},[360,2328,595],{"class":543},[360,2330,548],{"class":547},[360,2332,544],{"class":543},[360,2334,746],{"class":390},[360,2336,2337,2340],{"class":362,"line":519},[360,2338,2339],{"class":390},"    )",[360,2341,556],{"class":534},[360,2343,2344,2346,2348,2351,2353,2356,2358,2360,2362,2364],{"class":362,"line":525},[360,2345,680],{"class":655},[360,2347,683],{"class":655},[360,2349,2350],{"class":686}," store",[360,2352,540],{"class":390},[360,2354,2355],{"class":692},"StoreArticleRequest",[360,2357,695],{"class":390},[360,2359,698],{"class":534},[360,2361,553],{"class":390},[360,2363,582],{"class":703},[360,2365,2366],{"class":692}," ArticleResource\n",[360,2368,2369],{"class":362,"line":531},[360,2370,711],{"class":390},[360,2372,2373],{"class":362,"line":559},[360,2374,2375],{"class":493},"        \u002F\u002F …\n",[360,2377,2378],{"class":362,"line":607},[360,2379,808],{"class":390},[360,2381,2382],{"class":362,"line":652},[360,2383,814],{"class":390},[302,2385,2386,2389],{},[311,2387,2388],{},"webhook"," reuses the request and the responses of a webhook, declared by a payload class or on a route.\nWithout it, describe the payload on the attribute:",[350,2391,2393],{"className":352,"code":2392,"language":355,"meta":356,"style":356},"#[Callback(\n    'articlePublished',\n    url: '{$request.body#\u002Fcallback_url}',\n    type: 'array{id: int, status: string}',\n    description: 'Sent once the article is published',\n    status: 204,\n)]\n",[311,2394,2395,2403,2413,2428,2444,2460,2472],{"__ignoreMap":356},[360,2396,2397,2399,2401],{"class":362,"line":363},[360,2398,535],{"class":534},[360,2400,2248],{"class":370},[360,2402,2292],{"class":390},[360,2404,2405,2407,2409,2411],{"class":362,"line":394},[360,2406,1868],{"class":543},[360,2408,2299],{"class":547},[360,2410,544],{"class":543},[360,2412,746],{"class":390},[360,2414,2415,2418,2420,2422,2424,2426],{"class":362,"line":416},[360,2416,2417],{"class":578},"    url",[360,2419,582],{"class":390},[360,2421,595],{"class":543},[360,2423,2315],{"class":547},[360,2425,544],{"class":543},[360,2427,746],{"class":390},[360,2429,2430,2433,2435,2437,2440,2442],{"class":362,"line":436},[360,2431,2432],{"class":578},"    type",[360,2434,582],{"class":390},[360,2436,595],{"class":543},[360,2438,2439],{"class":547},"array{id: int, status: string}",[360,2441,544],{"class":543},[360,2443,746],{"class":390},[360,2445,2446,2449,2451,2453,2456,2458],{"class":362,"line":456},[360,2447,2448],{"class":578},"    description",[360,2450,582],{"class":390},[360,2452,595],{"class":543},[360,2454,2455],{"class":547},"Sent once the article is published",[360,2457,544],{"class":543},[360,2459,746],{"class":390},[360,2461,2462,2465,2467,2470],{"class":362,"line":483},[360,2463,2464],{"class":578},"    status",[360,2466,582],{"class":390},[360,2468,2469],{"class":644}," 204",[360,2471,746],{"class":390},[360,2473,2474,2476],{"class":362,"line":490},[360,2475,553],{"class":390},[360,2477,556],{"class":534},[1554,2479,2480,2490],{},[1557,2481,2482],{},[1560,2483,2484,2487],{},[1563,2485,2486],{},"Parameter",[1563,2488,2489],{},"Gives",[1573,2491,2492,2501,2510,2523,2532,2545,2555,2564],{},[1560,2493,2494,2498],{},[1578,2495,2496],{},[311,2497,1139],{},[1578,2499,2500],{},"the key of the callback in the operation",[1560,2502,2503,2507],{},[1578,2504,2505],{},[311,2506,909],{},[1578,2508,2509],{},"the runtime expression of the URL",[1560,2511,2512,2517],{},[1578,2513,2514],{},[311,2515,2516],{},"method",[1578,2518,2519,2520,2522],{},"the HTTP method, ",[311,2521,1602],{}," by default",[1560,2524,2525,2529],{},[1578,2526,2527],{},[311,2528,2388],{},[1578,2530,2531],{},"a webhook whose request and responses are reused",[1560,2533,2534,2542],{},[1578,2535,2536,2539,2540],{},[311,2537,2538],{},"resource",", ",[311,2541,1224],{},[1578,2543,2544],{},"the payload, from a resource or a PHPDoc type",[1560,2546,2547,2552],{},[1578,2548,2549],{},[311,2550,2551],{},"mediaType",[1578,2553,2554],{},"the media type of the payload",[1560,2556,2557,2561],{},[1578,2558,2559],{},[311,2560,1080],{},[1578,2562,2563],{},"the description of the request",[1560,2565,2566,2571],{},[1578,2567,2568],{},[311,2569,2570],{},"status",[1578,2572,2573,2574,2522],{},"the response expected from the receiver, ",[311,2575,1469],{},[302,2577,2578],{},"A callback that reuses a missing webhook is left out with a warning.",[2580,2581,2582],"style",{},"html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_hVV, html code.shiki .s_hVV{--shiki-light:#90A4AE;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .s39Yj, html code.shiki .s39Yj{--shiki-light:#39ADB5;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}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 .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .srdBf, html code.shiki .srdBf{--shiki-light:#F76D47;--shiki-default:#005CC5;--shiki-dark:#79B8FF}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 .sZMiF, html code.shiki .sZMiF{--shiki-light:#E2931D;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .smGrS, html code.shiki .smGrS{--shiki-light:#39ADB5;--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 .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);}html pre.shiki code .sseR_, html code.shiki .sseR_{--shiki-light:#9C3EDA;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .swQdS, html code.shiki .swQdS{--shiki-light:#E53935;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sAQsV, html code.shiki .sAQsV{--shiki-light:#916B53;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .syTEX, html code.shiki .syTEX{--shiki-light:#FF5370;--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":356,"searchDepth":416,"depth":416,"links":2584},[2585,2589,2590,2591,2592,2593,2594],{"id":334,"depth":394,"text":335,"children":2586},[2587,2588],{"id":347,"depth":416,"text":348},{"id":823,"depth":416,"text":824},{"id":1551,"depth":394,"text":1552},{"id":1832,"depth":394,"text":1833},{"id":1944,"depth":394,"text":1945},{"id":2174,"depth":394,"text":2175},{"id":2205,"depth":394,"text":2206},{"id":2215,"depth":394,"text":2216},"Document the requests your application sends, to subscribers and to URLs the client gives.","md",{},"---\ntitle: Webhooks & callbacks\ndescription: Document the requests your application sends, to subscribers and to URLs the client gives.\n---\n\nA webhook is a request your application **sends**. Declare it by its payload: a `JsonResource` marked `#[Webhook]`.\nThe generator finds the class without any route and writes it under `webhooks`, never under `paths`. The same class\nis what your application sends, so the document describes exactly what goes out. `#[Callback]` documents a request\nsent back to a URL the client gave in its own request.\n\n## Declare a webhook :since{v=\"1.3\"}\n\n::steps{level=\"3\"}\n\n### Write the payload as a resource\n\n```php [app\u002FWebhooks\u002FArticlePublished.php]\nuse Ark4ne\\OpenApi\\Attributes\\Header;\nuse Ark4ne\\OpenApi\\Attributes\\Webhook;\nuse App\\Models\\Article;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Http\\Resources\\Json\\JsonResource;\n\n\u002F**\n * An article was published.\n *\n * Sent once, when the article goes live.\n *\n * @mixin Article\n *\u002F\n#[Webhook('article.published')]\n#[Header('X-Signature', required: true, description: 'HMAC of the body')]\n#[Header('X-Attempt', type: 'positive-int', example: 1)]\nfinal class ArticlePublished extends JsonResource\n{\n    public function toArray(Request $request): array\n    {\n        return [\n            'id' => $this->id,\n            'title' => $this->title,\n            'author' => $this->whenLoaded('author'),\n        ];\n    }\n}\n```\n\nThe name of `#[Webhook]` is the key of the webhook and its operationId. It is required.\n\n### Send it\n\nThe resource resolves to an array, so any client sends it:\n\n```php\n$payload = ArticlePublished::make($article)->resolve();\n\nHttp::withHeaders(['X-Signature' => $signature])->post($url, $payload);\n\n\u002F\u002F spatie\u002Flaravel-webhook-server, or any other library\nWebhookCall::create()->url($url)->payload($payload)->dispatch();\n```\n\n::\n\nThe result, under `webhooks`:\n\n```json\n{\n  \"webhooks\": {\n    \"article.published\": {\n      \"post\": {\n        \"tags\": [\"Webhooks\"],\n        \"summary\": \"An article was published.\",\n        \"description\": \"Sent once, when the article goes live.\",\n        \"operationId\": \"article.published\",\n        \"parameters\": [\n          {\n            \"name\": \"X-Signature\",\n            \"in\": \"header\",\n            \"description\": \"HMAC of the body\",\n            \"required\": true,\n            \"schema\": { \"type\": \"string\" }\n          },\n          {\n            \"name\": \"X-Attempt\",\n            \"in\": \"header\",\n            \"schema\": { \"type\": \"integer\", \"minimum\": 1, \"example\": 1 }\n          }\n        ],\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"application\u002Fjson\": {\n              \"schema\": { \"$ref\": \"#\u002Fcomponents\u002Fschemas\u002FArticlePublished\" }\n            }\n          }\n        },\n        \"responses\": { \"200\": { \"description\": \"OK\" } }\n      }\n    }\n  }\n}\n```\n\nThe body is described like a resource an action returns: the resource runs on a sampled model, `author` is optional\nbecause it is loaded conditionally, and the schema is a component. See\n[Sampling](\u002Flaravel-openapi-generator\u002Fdocumenting-endpoints\u002Fsampling).\n\n::note\nA resource with a format, such as a JSON:API resource, is documented as the document it renders: `{\"data\": …}`, as\n`application\u002Fvnd.api+json`. Send that document, not `resolve()`, which gives the resource object alone:\n`ArticlePublished::make($article)->response()->getData(true)`.\n::\n\n## What the class carries\n\n| Need | Declaration | Default |\n| --- | --- | --- |\n| key and operationId | `#[Webhook('article.published')]` | required |\n| HTTP method | `#[Webhook('article.published', method: 'PUT')]` | `POST` |\n| summary, description | the PHPDoc of the class; `@deprecated` | none |\n| operationId, tags, deprecation | `#[Operation]` on the class | the name; tag `Webhooks` |\n| tags with details | `#[Tag]` on the class (replaces the `Webhooks` tag) | none |\n| headers sent | `#[Header]` on the class | none |\n| what the receiver answers | `#[Response]` on the class | `200 OK` |\n\nOnly the attributes of the class itself are read. An abstract class marked `#[Webhook]` is never a webhook, and a\nclass without a name is left out with a warning.\n\n```php\n#[Webhook('article.archived', method: 'PUT')]\n#[Operation(operationId: 'articleArchived', tags: ['Articles'])]\n#[Response(204, description: 'Received')]\n#[Response(410, description: 'The subscription is cancelled')]\nfinal class ArticleArchived extends JsonResource\n```\n\n## Where the classes are found\n\nBy default, every class under `app\u002F` is a candidate: only the PHP files that mention `Webhook` are read, so the scan\nloads no other class. Narrow it, or list classes from a package or a module, in `config\u002Fopenapi.php`:\n\n```php [config\u002Fopenapi.php]\n'webhooks' => [\n    'paths' => [app_path('Webhooks')],\n    'classes' => [Billing\\Webhooks\\InvoiceIssued::class],\n],\n```\n\nA file whose class cannot be loaded is skipped with a warning. A listed class that is not a concrete `JsonResource`\nmarked `#[Webhook]` fails the command, before any document is generated.\n\nCheck one webhook with `php artisan openapi:inspect article.published`.\n\n## Choose the webhooks of each document\n\nEvery document gets every webhook found. Leave a webhook out of all of them with `#[Exclude]` on its class:\n\n```php\n#[Webhook('article.drafted')]\n#[Exclude]\nfinal class ArticleDrafted extends JsonResource\n```\n\nChoose the webhooks of one document by their name, with shell masks in its own `webhooks`. They apply to the\nwebhooks declared on routes too:\n\n```php [config\u002Fopenapi.php]\n'documents' => [\n    'public' => [\n        'webhooks' => [\n            'include' => ['article.*'],\n            'exclude' => ['article.archived'],\n        ],\n    ],\n    'partners' => [\n        'webhooks' => ['include' => ['invoice.*']],\n    ],\n],\n```\n\n`include` keeps the names it matches (every name when empty), `exclude` leaves out those it matches, over `include`.\nA document overrides the global `webhooks` key by key: `'webhooks' => ['paths' => []]` gives it no webhook found by\nscanning.\n\n## OpenAPI versions\n\n`webhooks` exists from OpenAPI 3.1. In a 3.0 document:\n\n- with `vendor_extensions: redoc`, the webhooks are written as `x-webhooks`;\n- otherwise a strict document fails, and a lenient one (`strict: false`) drops them with a warning.\n\n## Webhooks declared on routes\n\nBefore 1.3, a webhook was an action marked `#[Webhook]` behind a route registered only to be documented and kept\nfrom answering by a middleware. It still works, and is deprecated: move the payload to a resource class. When a\npayload class and a route webhook have the same name and method, the payload class is kept, with a warning.\n\n## Callbacks\n\nA callback is a request sent to a URL the client gave, such as a `callback_url` field of its request. Declare it on\nthe operation that receives that URL, with a runtime expression:\n\n```php [app\u002FHttp\u002FControllers\u002FArticleController.php]\nuse Ark4ne\\OpenApi\\Attributes\\Callback;\n\nfinal class ArticleController\n{\n    \u002F**\n     * Submit an article; `callback_url` is called once it is published.\n     *\u002F\n    #[Callback(\n        'articlePublished',\n        url: '{$request.body#\u002Fcallback_url}',\n        webhook: 'article.published',\n    )]\n    public function store(StoreArticleRequest $request): ArticleResource\n    {\n        \u002F\u002F …\n    }\n}\n```\n\n`webhook` reuses the request and the responses of a webhook, declared by a payload class or on a route.\nWithout it, describe the payload on the attribute:\n\n```php\n#[Callback(\n    'articlePublished',\n    url: '{$request.body#\u002Fcallback_url}',\n    type: 'array{id: int, status: string}',\n    description: 'Sent once the article is published',\n    status: 204,\n)]\n```\n\n| Parameter | Gives |\n| --- | --- |\n| `name` | the key of the callback in the operation |\n| `url` | the runtime expression of the URL |\n| `method` | the HTTP method, `POST` by default |\n| `webhook` | a webhook whose request and responses are reused |\n| `resource`, `type` | the payload, from a resource or a PHPDoc type |\n| `mediaType` | the media type of the payload |\n| `description` | the description of the request |\n| `status` | the response expected from the receiver, `200` by default |\n\nA callback that reuses a missing webhook is left out with a warning.\n",{"title":166,"description":2595},"pZZ44Pbnmq3YJ7k_NEzQnN-iCXPulH7R3HVyFRVJoxw",[2602,2604],{"title":162,"path":163,"stem":164,"description":2603,"children":-1},"Security requirements from the middlewares, and the error responses the generator adds to each operation.",{"title":176,"path":177,"stem":178,"description":2605,"children":-1},"Choose the OpenAPI version of a document and set its info, servers, security and extensions.",1795438903323]