[{"data":1,"prerenderedAt":680},["ShallowReactive",2],{"navigation":3,"\u002F2.x\u002Fdigging-deeper\u002Fresponses":307,"\u002F2.x\u002Fdigging-deeper\u002Fresponses-surround":675},{"3.x":4,"2.x":203},[5,32,61,99,121,147,165],{"title":6,"icon":7,"path":8,"stem":9,"children":10,"page":31},"Getting Started","i-heroicons-star","\u002Fgetting-started","1.getting-started",[11,15,19,23,27],{"title":12,"path":13,"stem":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":16,"path":17,"stem":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":20,"path":21,"stem":22},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":24,"path":25,"stem":26},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration",{"title":28,"path":29,"stem":30},"Upgrade guide","\u002Fgetting-started\u002Fupgrade-guide","1.getting-started\u002F5.upgrade-guide",false,{"title":33,"icon":34,"path":35,"stem":36,"children":37,"page":31},"Resources","i-heroicons-document-text","\u002Fresources","2.resources",[38,41,45,49,53,57],{"title":33,"path":39,"stem":40},"\u002Fresources\u002Fresources","2.resources\u002F1.resources",{"title":42,"path":43,"stem":44},"Fields","\u002Fresources\u002Ffields","2.resources\u002F2.fields",{"title":46,"path":47,"stem":48},"Relationships","\u002Fresources\u002Frelations","2.resources\u002F3.relations",{"title":50,"path":51,"stem":52},"Validation","\u002Fresources\u002Fvalidation","2.resources\u002F4.validation",{"title":54,"path":55,"stem":56},"Perimeter","\u002Fresources\u002Fperimeter","2.resources\u002F5.perimeter",{"title":58,"path":59,"stem":60},"Limits","\u002Fresources\u002Flimits","2.resources\u002F6.limits",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":31},"Search","i-heroicons-magnifying-glass","\u002Fsearch","3.search",[67,71,75,79,83,87,91,95],{"title":68,"path":69,"stem":70},"Search overview","\u002Fsearch\u002Foverview","3.search\u002F1.overview",{"title":72,"path":73,"stem":74},"Search filters","\u002Fsearch\u002Ffilters","3.search\u002F2.filters",{"title":76,"path":77,"stem":78},"Sorts and selects","\u002Fsearch\u002Fsorts-and-selects","3.search\u002F3.sorts-and-selects",{"title":80,"path":81,"stem":82},"Includes and aggregates","\u002Fsearch\u002Fincludes-and-aggregates","3.search\u002F4.includes-and-aggregates",{"title":84,"path":85,"stem":86},"Scopes and instructions","\u002Fsearch\u002Fscopes-and-instructions","3.search\u002F5.scopes-and-instructions",{"title":88,"path":89,"stem":90},"Text search","\u002Fsearch\u002Ftext-search","3.search\u002F6.text-search",{"title":92,"path":93,"stem":94},"Search engines","\u002Fsearch\u002Fsearch-engines","3.search\u002F7.search-engines",{"title":96,"path":97,"stem":98},"Searching outside HTTP","\u002Fsearch\u002Foutside-http","3.search\u002F8.outside-http",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":31},"Writing","i-heroicons-pencil-square","\u002Fwriting","4.writing",[105,109,113,117],{"title":106,"path":107,"stem":108},"Mutate","\u002Fwriting\u002Fmutate","4.writing\u002F1.mutate",{"title":110,"path":111,"stem":112},"Writing relations","\u002Fwriting\u002Frelations","4.writing\u002F2.relations",{"title":114,"path":115,"stem":116},"Versioned rows","\u002Fwriting\u002Fversioned-rows","4.writing\u002F3.versioned-rows",{"title":118,"path":119,"stem":120},"Deleting and restoring","\u002Fwriting\u002Fdeleting","4.writing\u002F4.deleting",{"title":122,"icon":123,"path":124,"stem":125,"children":126,"page":31},"Actions and Metrics","i-heroicons-bolt","\u002Factions-and-metrics","5.actions-and-metrics",[127,131,135,139,143],{"title":128,"path":129,"stem":130},"Actions","\u002Factions-and-metrics\u002Factions","5.actions-and-metrics\u002F1.actions",{"title":132,"path":133,"stem":134},"Queued Actions","\u002Factions-and-metrics\u002Fqueued-actions","5.actions-and-metrics\u002F2.queued-actions",{"title":136,"path":137,"stem":138},"Confirmation","\u002Factions-and-metrics\u002Fconfirmation","5.actions-and-metrics\u002F3.confirmation",{"title":140,"path":141,"stem":142},"Metrics","\u002Factions-and-metrics\u002Fmetrics","5.actions-and-metrics\u002F4.metrics",{"title":144,"path":145,"stem":146},"Exports","\u002Factions-and-metrics\u002Fexports","5.actions-and-metrics\u002F5.exports",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":31},"Authorization","i-heroicons-lock-closed","\u002Fauthorization","6.authorization",[153,157,161],{"title":154,"path":155,"stem":156},"Policies","\u002Fauthorization\u002Fpolicies","6.authorization\u002F1.policies",{"title":158,"path":159,"stem":160},"Gates","\u002Fauthorization\u002Fgates","6.authorization\u002F2.gates",{"title":162,"path":163,"stem":164},"Decision Cache","\u002Fauthorization\u002Fdecision-cache","6.authorization\u002F3.decision-cache",{"title":166,"icon":167,"path":168,"stem":169,"children":170,"page":31},"Digging Deeper","i-heroicons-list-bullet","\u002Fdigging-deeper","7.digging-deeper",[171,175,179,183,187,191,195,199],{"title":172,"path":173,"stem":174},"Details","\u002Fdigging-deeper\u002Fdetails","7.digging-deeper\u002F1.details",{"title":176,"path":177,"stem":178},"Events and Hooks","\u002Fdigging-deeper\u002Fevents-and-hooks","7.digging-deeper\u002F2.events-and-hooks",{"title":180,"path":181,"stem":182},"Custom Responses","\u002Fdigging-deeper\u002Fresponses","7.digging-deeper\u002F3.responses",{"title":184,"path":185,"stem":186},"OpenAPI Documentation","\u002Fdigging-deeper\u002Fopenapi","7.digging-deeper\u002F4.openapi",{"title":188,"path":189,"stem":190},"Precognition","\u002Fdigging-deeper\u002Fprecognition","7.digging-deeper\u002F5.precognition",{"title":192,"path":193,"stem":194},"Artisan Commands","\u002Fdigging-deeper\u002Fartisan","7.digging-deeper\u002F6.artisan",{"title":196,"path":197,"stem":198},"Laravel Boost Skill","\u002Fdigging-deeper\u002Fai-skill","7.digging-deeper\u002F7.ai-skill",{"title":200,"path":201,"stem":202},"Translations","\u002Fdigging-deeper\u002Ftranslations","7.digging-deeper\u002F8.translations",[204,215,237,260,297],{"title":6,"icon":7,"path":205,"stem":206,"children":207,"page":31},"\u002F2.x\u002Fgetting-started","2.x\u002F1.getting-started",[208,211],{"title":16,"path":209,"stem":210},"\u002F2.x\u002Fgetting-started\u002Finstallation","2.x\u002F1.getting-started\u002F1.installation",{"title":212,"path":213,"stem":214},"Upgrade Guide","\u002F2.x\u002Fgetting-started\u002Fupgrade-guide","2.x\u002F1.getting-started\u002F2.upgrade-guide",{"title":216,"icon":217,"path":218,"stem":219,"children":220,"page":31},"Endpoints","i-heroicons-arrow-uturn-left","\u002F2.x\u002Fendpoints","2.x\u002F2.endpoints",[221,224,227,230,233],{"title":172,"path":222,"stem":223},"\u002F2.x\u002Fendpoints\u002Fdetails","2.x\u002F2.endpoints\u002F1.details",{"title":62,"path":225,"stem":226},"\u002F2.x\u002Fendpoints\u002Fsearch","2.x\u002F2.endpoints\u002F2.search",{"title":106,"path":228,"stem":229},"\u002F2.x\u002Fendpoints\u002Fmutate","2.x\u002F2.endpoints\u002F3.mutate",{"title":128,"path":231,"stem":232},"\u002F2.x\u002Fendpoints\u002Factions","2.x\u002F2.endpoints\u002F4.actions",{"title":234,"path":235,"stem":236},"Delete","\u002F2.x\u002Fendpoints\u002Fdelete","2.x\u002F2.endpoints\u002F5.delete",{"title":33,"icon":34,"path":238,"stem":239,"children":240,"page":31},"\u002F2.x\u002Fresources","2.x\u002F3.resources",[241,245,249,252,256],{"title":242,"path":243,"stem":244},"Basics","\u002F2.x\u002Fresources\u002Fbasics","2.x\u002F3.resources\u002F1.basics",{"title":246,"path":247,"stem":248},"Exposed Data","\u002F2.x\u002Fresources\u002Fexposed-data","2.x\u002F3.resources\u002F2.exposed-data",{"title":46,"path":250,"stem":251},"\u002F2.x\u002Fresources\u002Frelationships","2.x\u002F3.resources\u002F3.relationships",{"title":253,"path":254,"stem":255},"Validations","\u002F2.x\u002Fresources\u002Fvalidations","2.x\u002F3.resources\u002F4.validations",{"title":257,"path":258,"stem":259},"Interactions","\u002F2.x\u002Fresources\u002Finteractions","2.x\u002F3.resources\u002F5.interactions",{"title":166,"icon":167,"path":261,"stem":262,"children":263,"page":31},"\u002F2.x\u002Fdigging-deeper","2.x\u002F4.digging-deeper",[264,267,271,274,278,282,286,290,294],{"title":128,"path":265,"stem":266},"\u002F2.x\u002Fdigging-deeper\u002Factions","2.x\u002F4.digging-deeper\u002F1.actions",{"title":268,"path":269,"stem":270},"Hooks","\u002F2.x\u002Fdigging-deeper\u002Fhooks","2.x\u002F4.digging-deeper\u002F2.hooks",{"title":158,"path":272,"stem":273},"\u002F2.x\u002Fdigging-deeper\u002Fgates","2.x\u002F4.digging-deeper\u002F3.gates",{"title":275,"path":276,"stem":277},"Authorizations","\u002F2.x\u002Fdigging-deeper\u002Fauthorizations","2.x\u002F4.digging-deeper\u002F4.authorizations",{"title":279,"path":280,"stem":281},"Full Text Search","\u002F2.x\u002Fdigging-deeper\u002Ffull-text-search","2.x\u002F4.digging-deeper\u002F5.full-text-search",{"title":283,"path":284,"stem":285},"Instructions","\u002F2.x\u002Fdigging-deeper\u002Finstructions","2.x\u002F4.digging-deeper\u002F6.instructions",{"title":287,"path":288,"stem":289},"Responses","\u002F2.x\u002Fdigging-deeper\u002Fresponses","2.x\u002F4.digging-deeper\u002F7.responses",{"title":291,"path":292,"stem":293},"Documentation","\u002F2.x\u002Fdigging-deeper\u002Fdocumentation","2.x\u002F4.digging-deeper\u002F8.documentation",{"title":188,"path":295,"stem":296},"\u002F2.x\u002Fdigging-deeper\u002Fprecognition","2.x\u002F4.digging-deeper\u002F9.precognition",{"title":298,"icon":299,"path":300,"stem":301,"children":302,"page":31},"Integrations","i-lucide-puzzle","\u002F2.x\u002Fintegrations","2.x\u002F5.integrations",[303],{"title":304,"path":305,"stem":306},"Flutter","\u002F2.x\u002Fintegrations\u002Fflutter","2.x\u002F5.integrations\u002F1.flutter",{"id":308,"title":287,"body":309,"description":668,"extension":669,"links":670,"meta":671,"navigation":672,"path":288,"seo":673,"stem":289,"__hash__":674},"docs2x\u002F2.x\u002F4.digging-deeper\u002F7.responses.md",{"type":310,"value":311,"toc":664},"minimark",[312,319,324,332,360,367,544,555,561,565,572,660],[313,314,315],"warning",{},[316,317,318],"p",{},"The response is the final piece of the API and should be used judiciously, as it can override all the underlying logic of Laravel Rest API.",[320,321,323],"h2",{"id":322},"defining-responses","Defining Responses",[316,325,326,327,331],{},"By default, Rest responses are stored in the app\u002FRest\u002FResponses directory of your application. You may generate a new Response by using the ",[328,329,330],"code",{},"rest:response"," Artisan command:",[333,334,339],"pre",{"className":335,"code":336,"language":337,"meta":338,"style":338},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan rest:response UserResponse\n","bash","",[328,340,341],{"__ignoreMap":338},[342,343,346,350,354,357],"span",{"class":344,"line":345},"line",1,[342,347,349],{"class":348},"sBMFI","php",[342,351,353],{"class":352},"sfazB"," artisan",[342,355,356],{"class":352}," rest:response",[342,358,359],{"class":352}," UserResponse\n",[316,361,362,363,366],{},"You are now free to modify the ",[328,364,365],{},"map"," method from your new Response:",[333,368,371],{"className":369,"code":370,"language":349,"meta":338,"style":338},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F**\n * This maps on each model returned by the API, use it at your ease.\n *\n * @var \\Illuminate\\Database\\Eloquent\\Model $model\n * @var array $responseModel\n *\n * @return array\n *\u002F\nprotected function map(\\Illuminate\\Database\\Eloquent\\Model $model, array $responseModel) : array {\n    return $responseModel;\n}\n",[328,372,373,379,385,391,429,442,447,458,464,525,538],{"__ignoreMap":338},[342,374,375],{"class":344,"line":345},[342,376,378],{"class":377},"sHwdD","\u002F**\n",[342,380,382],{"class":344,"line":381},2,[342,383,384],{"class":377}," * This maps on each model returned by the API, use it at your ease.\n",[342,386,388],{"class":344,"line":387},3,[342,389,390],{"class":377}," *\n",[342,392,394,397,401,405,409,412,415,417,420,422,426],{"class":344,"line":393},4,[342,395,396],{"class":377}," * ",[342,398,400],{"class":399},"svl4J","@var",[342,402,404],{"class":403},"s7zQu"," \\",[342,406,408],{"class":407},"sHdIc","Illuminate",[342,410,411],{"class":403},"\\",[342,413,414],{"class":407},"Database",[342,416,411],{"class":403},[342,418,419],{"class":407},"Eloquent",[342,421,411],{"class":403},[342,423,425],{"class":424},"sFweD","Model",[342,427,428],{"class":377}," $model\n",[342,430,432,434,436,439],{"class":344,"line":431},5,[342,433,396],{"class":377},[342,435,400],{"class":399},[342,437,438],{"class":399}," array",[342,440,441],{"class":377}," $responseModel\n",[342,443,445],{"class":344,"line":444},6,[342,446,390],{"class":377},[342,448,450,452,455],{"class":344,"line":449},7,[342,451,396],{"class":377},[342,453,454],{"class":399},"@return",[342,456,457],{"class":399}," array\n",[342,459,461],{"class":344,"line":460},8,[342,462,463],{"class":377}," *\u002F\n",[342,465,467,471,474,478,482,485,487,489,491,493,495,497,500,503,506,509,511,514,517,520,522],{"class":344,"line":466},9,[342,468,470],{"class":469},"spNyl","protected",[342,472,473],{"class":469}," function",[342,475,477],{"class":476},"s2Zo4"," map",[342,479,481],{"class":480},"sMK4o","(\\",[342,483,408],{"class":484},"sTEyZ",[342,486,411],{"class":480},[342,488,414],{"class":484},[342,490,411],{"class":480},[342,492,419],{"class":484},[342,494,411],{"class":480},[342,496,425],{"class":348},[342,498,499],{"class":480}," $",[342,501,502],{"class":484},"model",[342,504,505],{"class":480},",",[342,507,438],{"class":508},"sbssI",[342,510,499],{"class":480},[342,512,513],{"class":484},"responseModel",[342,515,516],{"class":480},")",[342,518,519],{"class":480}," :",[342,521,438],{"class":508},[342,523,524],{"class":480}," {\n",[342,526,528,531,533,535],{"class":344,"line":527},10,[342,529,530],{"class":403},"    return",[342,532,499],{"class":480},[342,534,513],{"class":484},[342,536,537],{"class":480},";\n",[342,539,541],{"class":344,"line":540},11,[342,542,543],{"class":480},"}\n",[316,545,546,547,550,551,554],{},"The ",[328,548,549],{},"$model"," represents the original model, whereas ",[328,552,553],{},"$responseModel"," is the response that would typically be initiated by Laravel Rest Api.",[556,557,558],"note",{},[316,559,560],{},"Responses should be considered as a final resort for leveraging the API. In most cases, they may not be necessary.",[320,562,564],{"id":563},"registering-responses","Registering Responses",[316,566,567,568,571],{},"You now have to specify the Response within the corresponding ",[328,569,570],{},"Resource"," file.",[333,573,576],{"className":369,"code":574,"filename":575,"language":349,"meta":338,"style":338},"\u002F**\n * The reponse the entry corresponds to.\n *\n * @var class-string\u003CResponse>\n *\u002F\npublic static $response = App\\Rest\\Responses\\UserResponse::class;\n","UserResource.php",[328,577,578,582,587,591,615,619],{"__ignoreMap":338},[342,579,580],{"class":344,"line":345},[342,581,378],{"class":377},[342,583,584],{"class":344,"line":381},[342,585,586],{"class":377}," * The reponse the entry corresponds to.\n",[342,588,589],{"class":344,"line":387},[342,590,390],{"class":377},[342,592,593,595,597,600,603,606,609,612],{"class":344,"line":393},[342,594,396],{"class":377},[342,596,400],{"class":399},[342,598,599],{"class":424}," class",[342,601,602],{"class":377},"-",[342,604,605],{"class":399},"string",[342,607,608],{"class":377},"\u003C",[342,610,611],{"class":424},"Response",[342,613,614],{"class":377},">\n",[342,616,617],{"class":344,"line":431},[342,618,463],{"class":377},[342,620,621,624,627,629,632,635,638,640,643,645,647,649,652,655,658],{"class":344,"line":444},[342,622,623],{"class":469},"public",[342,625,626],{"class":469}," static",[342,628,499],{"class":480},[342,630,631],{"class":484},"response ",[342,633,634],{"class":480},"=",[342,636,637],{"class":484}," App",[342,639,411],{"class":480},[342,641,642],{"class":484},"Rest",[342,644,411],{"class":480},[342,646,287],{"class":484},[342,648,411],{"class":480},[342,650,651],{"class":348},"UserResponse",[342,653,654],{"class":480},"::",[342,656,657],{"class":508},"class",[342,659,537],{"class":480},[661,662,663],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .svl4J, html code.shiki .svl4J{--shiki-light:#F76D47;--shiki-light-font-style:italic;--shiki-default:#F78C6C;--shiki-default-font-style:italic;--shiki-dark:#F78C6C;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sFweD, html code.shiki .sFweD{--shiki-light:#E2931D;--shiki-light-font-style:italic;--shiki-default:#FFCB6B;--shiki-default-font-style:italic;--shiki-dark:#FFCB6B;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":338,"searchDepth":345,"depth":381,"links":665},[666,667],{"id":322,"depth":381,"text":323},{"id":563,"depth":381,"text":564},"The response is the way you have to manipulate the API's output for each model.","md",null,{},true,{"description":668},"3ZyCunZiX6TVY303dIw5JQ0LyrbH3HKErus3hgXCMC0",[676,678],{"title":283,"path":284,"stem":285,"description":677,"children":-1},"Instructions are a way to provide customization to your search requests fully depending on your needs. They give you full access to the query.",{"title":291,"path":292,"stem":293,"description":679,"children":-1},"Laravel Rest API provides first-class integration with Scramble to automatically generate your API documentation from your resources, fields, relations and validation rules — with zero manual configuration.",1794181353720]