[{"data":1,"prerenderedAt":1275},["ShallowReactive",2],{"navigation":3,"\u002Fgetting-started\u002Fintroduction":307,"\u002Fgetting-started\u002Fintroduction-surround":1272},{"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":12,"body":309,"description":1265,"extension":1266,"links":1267,"meta":1268,"navigation":377,"path":13,"seo":1269,"sitemap":1270,"stem":14,"__hash__":1271},"docs3x\u002F1.getting-started\u002F1.introduction.md",{"type":310,"value":311,"toc":1256},"minimark",[312,317,335,760,842,845,849,860,1059,1066,1070,1127,1131,1134,1206,1210,1215,1219,1222,1232,1236,1252],[313,314,316],"h2",{"id":315},"what-it-is","What it is",[318,319,320,321,325,326,329,330,334],"p",{},"Laravel Rest Api turns your Eloquent models into a full API without one controller per use case. For each model, you write a ",[322,323,324],"strong",{},"resource"," that declares what the API exposes: its fields, its relations, its scopes, its actions and its rules. A thin ",[322,327,328],{},"controller"," binds the resource to a route name, and one call to ",[331,332,333],"code",{},"Rest::resource()"," registers its endpoints.",[336,337,343],"pre",{"className":338,"code":339,"filename":340,"language":341,"meta":342,"style":342},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","namespace App\\Rest\\Resources;\n\nuse App\\Models\\Product;\nuse Lomkit\\Rest\\Fields\\ID;\nuse Lomkit\\Rest\\Fields\\Integer;\nuse Lomkit\\Rest\\Fields\\Text;\nuse Lomkit\\Rest\\Relations\\BelongsTo;\n\nclass ProductResource extends Resource\n{\n    public static string $model = Product::class;\n\n    public function fields(): array\n    {\n        return [\n            ID::make('id'),\n            Text::make('name')->creationRules('required'),\n            Integer::make('price'),\n        ];\n    }\n\n    public function relations(): array\n    {\n        return [\n            BelongsTo::make('category', CategoryResource::class),\n        ];\n    }\n}\n","app\u002FRest\u002FResources\u002FProductResource.php","php","",[331,344,345,372,379,400,423,445,467,490,495,511,517,548,553,571,577,587,613,649,670,676,682,687,701,706,713,744,749,754],{"__ignoreMap":342},[346,347,350,354,358,362,365,367,369],"span",{"class":348,"line":349},"line",1,[346,351,353],{"class":352},"sbssI","namespace",[346,355,357],{"class":356},"sBMFI"," App",[346,359,361],{"class":360},"sMK4o","\\",[346,363,364],{"class":356},"Rest",[346,366,361],{"class":360},[346,368,33],{"class":356},[346,370,371],{"class":360},";\n",[346,373,375],{"class":348,"line":374},2,[346,376,378],{"emptyLinePlaceholder":377},true,"\n",[346,380,382,385,388,390,393,395,398],{"class":348,"line":381},3,[346,383,384],{"class":352},"use",[346,386,357],{"class":387},"sTEyZ",[346,389,361],{"class":360},[346,391,392],{"class":387},"Models",[346,394,361],{"class":360},[346,396,397],{"class":387},"Product",[346,399,371],{"class":360},[346,401,403,405,408,410,412,414,416,418,421],{"class":348,"line":402},4,[346,404,384],{"class":352},[346,406,407],{"class":387}," Lomkit",[346,409,361],{"class":360},[346,411,364],{"class":387},[346,413,361],{"class":360},[346,415,42],{"class":387},[346,417,361],{"class":360},[346,419,420],{"class":387},"ID",[346,422,371],{"class":360},[346,424,426,428,430,432,434,436,438,440,443],{"class":348,"line":425},5,[346,427,384],{"class":352},[346,429,407],{"class":387},[346,431,361],{"class":360},[346,433,364],{"class":387},[346,435,361],{"class":360},[346,437,42],{"class":387},[346,439,361],{"class":360},[346,441,442],{"class":387},"Integer",[346,444,371],{"class":360},[346,446,448,450,452,454,456,458,460,462,465],{"class":348,"line":447},6,[346,449,384],{"class":352},[346,451,407],{"class":387},[346,453,361],{"class":360},[346,455,364],{"class":387},[346,457,361],{"class":360},[346,459,42],{"class":387},[346,461,361],{"class":360},[346,463,464],{"class":387},"Text",[346,466,371],{"class":360},[346,468,470,472,474,476,478,480,483,485,488],{"class":348,"line":469},7,[346,471,384],{"class":352},[346,473,407],{"class":387},[346,475,361],{"class":360},[346,477,364],{"class":387},[346,479,361],{"class":360},[346,481,482],{"class":387},"Relations",[346,484,361],{"class":360},[346,486,487],{"class":387},"BelongsTo",[346,489,371],{"class":360},[346,491,493],{"class":348,"line":492},8,[346,494,378],{"emptyLinePlaceholder":377},[346,496,498,502,505,508],{"class":348,"line":497},9,[346,499,501],{"class":500},"spNyl","class",[346,503,504],{"class":356}," ProductResource",[346,506,507],{"class":500}," extends",[346,509,510],{"class":356}," Resource\n",[346,512,514],{"class":348,"line":513},10,[346,515,516],{"class":360},"{\n",[346,518,520,523,526,529,532,535,538,541,544,546],{"class":348,"line":519},11,[346,521,522],{"class":500},"    public",[346,524,525],{"class":500}," static",[346,527,528],{"class":352}," string",[346,530,531],{"class":360}," $",[346,533,534],{"class":387},"model ",[346,536,537],{"class":360},"=",[346,539,540],{"class":356}," Product",[346,542,543],{"class":360},"::",[346,545,501],{"class":352},[346,547,371],{"class":360},[346,549,551],{"class":348,"line":550},12,[346,552,378],{"emptyLinePlaceholder":377},[346,554,556,558,561,565,568],{"class":348,"line":555},13,[346,557,522],{"class":500},[346,559,560],{"class":500}," function",[346,562,564],{"class":563},"s2Zo4"," fields",[346,566,567],{"class":360},"():",[346,569,570],{"class":352}," array\n",[346,572,574],{"class":348,"line":573},14,[346,575,576],{"class":360},"    {\n",[346,578,580,584],{"class":348,"line":579},15,[346,581,583],{"class":582},"s7zQu","        return",[346,585,586],{"class":360}," [\n",[346,588,590,593,595,598,601,604,608,610],{"class":348,"line":589},16,[346,591,592],{"class":356},"            ID",[346,594,543],{"class":360},[346,596,597],{"class":563},"make",[346,599,600],{"class":360},"(",[346,602,603],{"class":360},"'",[346,605,607],{"class":606},"sfazB","id",[346,609,603],{"class":360},[346,611,612],{"class":360},"),\n",[346,614,616,619,621,623,625,627,630,632,635,638,640,642,645,647],{"class":348,"line":615},17,[346,617,618],{"class":356},"            Text",[346,620,543],{"class":360},[346,622,597],{"class":563},[346,624,600],{"class":360},[346,626,603],{"class":360},[346,628,629],{"class":606},"name",[346,631,603],{"class":360},[346,633,634],{"class":360},")->",[346,636,637],{"class":563},"creationRules",[346,639,600],{"class":360},[346,641,603],{"class":360},[346,643,644],{"class":606},"required",[346,646,603],{"class":360},[346,648,612],{"class":360},[346,650,652,655,657,659,661,663,666,668],{"class":348,"line":651},18,[346,653,654],{"class":356},"            Integer",[346,656,543],{"class":360},[346,658,597],{"class":563},[346,660,600],{"class":360},[346,662,603],{"class":360},[346,664,665],{"class":606},"price",[346,667,603],{"class":360},[346,669,612],{"class":360},[346,671,673],{"class":348,"line":672},19,[346,674,675],{"class":360},"        ];\n",[346,677,679],{"class":348,"line":678},20,[346,680,681],{"class":360},"    }\n",[346,683,685],{"class":348,"line":684},21,[346,686,378],{"emptyLinePlaceholder":377},[346,688,690,692,694,697,699],{"class":348,"line":689},22,[346,691,522],{"class":500},[346,693,560],{"class":500},[346,695,696],{"class":563}," relations",[346,698,567],{"class":360},[346,700,570],{"class":352},[346,702,704],{"class":348,"line":703},23,[346,705,576],{"class":360},[346,707,709,711],{"class":348,"line":708},24,[346,710,583],{"class":582},[346,712,586],{"class":360},[346,714,716,719,721,723,725,727,730,732,735,738,740,742],{"class":348,"line":715},25,[346,717,718],{"class":356},"            BelongsTo",[346,720,543],{"class":360},[346,722,597],{"class":563},[346,724,600],{"class":360},[346,726,603],{"class":360},[346,728,729],{"class":606},"category",[346,731,603],{"class":360},[346,733,734],{"class":360},",",[346,736,737],{"class":356}," CategoryResource",[346,739,543],{"class":360},[346,741,501],{"class":352},[346,743,612],{"class":360},[346,745,747],{"class":348,"line":746},26,[346,748,675],{"class":360},[346,750,752],{"class":348,"line":751},27,[346,753,681],{"class":360},[346,755,757],{"class":348,"line":756},28,[346,758,759],{"class":360},"}\n",[336,761,764],{"className":338,"code":762,"filename":763,"language":341,"meta":342,"style":342},"use App\\Rest\\Controllers\\ProductsController;\nuse Lomkit\\Rest\\Facades\\Rest;\n\nRest::resource('products', ProductsController::class);\n","routes\u002Fapi.php",[331,765,766,788,809,813],{"__ignoreMap":342},[346,767,768,770,772,774,776,778,781,783,786],{"class":348,"line":349},[346,769,384],{"class":352},[346,771,357],{"class":387},[346,773,361],{"class":360},[346,775,364],{"class":387},[346,777,361],{"class":360},[346,779,780],{"class":387},"Controllers",[346,782,361],{"class":360},[346,784,785],{"class":387},"ProductsController",[346,787,371],{"class":360},[346,789,790,792,794,796,798,800,803,805,807],{"class":348,"line":374},[346,791,384],{"class":352},[346,793,407],{"class":387},[346,795,361],{"class":360},[346,797,364],{"class":387},[346,799,361],{"class":360},[346,801,802],{"class":387},"Facades",[346,804,361],{"class":360},[346,806,364],{"class":387},[346,808,371],{"class":360},[346,810,811],{"class":348,"line":381},[346,812,378],{"emptyLinePlaceholder":377},[346,814,815,817,819,821,823,825,828,830,832,835,837,839],{"class":348,"line":402},[346,816,364],{"class":356},[346,818,543],{"class":360},[346,820,324],{"class":563},[346,822,600],{"class":360},[346,824,603],{"class":360},[346,826,827],{"class":606},"products",[346,829,603],{"class":360},[346,831,734],{"class":360},[346,833,834],{"class":356}," ProductsController",[346,836,543],{"class":360},[346,838,501],{"class":352},[346,840,841],{"class":360},");\n",[318,843,844],{},"Clients can now search, filter, sort and paginate the products, include their category, create and update them in batches, and delete them, all inside the rules you declared.",[313,846,848],{"id":847},"the-endpoints","The endpoints",[318,850,851,852,855,856,859],{},"Each registered resource answers on a fixed set of routes. The opt-in routes are added with ",[331,853,854],{},"withSoftDeletes()"," and ",[331,857,858],{},"withBatchProgress()",":",[861,862,863,882],"table",{},[864,865,866],"thead",{},[867,868,869,873,876,879],"tr",{},[870,871,872],"th",{},"Method",[870,874,875],{},"URI",[870,877,878],{},"Endpoint",[870,880,881],{},"Purpose",[883,884,885,906,926,945,964,983,1002,1021,1040],"tbody",{},[867,886,887,893,898,903],{},[888,889,890],"td",{},[331,891,892],{},"GET",[888,894,895],{},[331,896,897],{},"\u002Fapi\u002Fproducts",[888,899,900],{},[331,901,902],{},"details",[888,904,905],{},"Describe the resource for the current user",[867,907,908,913,918,923],{},[888,909,910],{},[331,911,912],{},"POST",[888,914,915],{},[331,916,917],{},"\u002Fapi\u002Fproducts\u002Fsearch",[888,919,920],{},[331,921,922],{},"search",[888,924,925],{},"Filter, sort, include, aggregate and paginate rows",[867,927,928,932,937,942],{},[888,929,930],{},[331,931,912],{},[888,933,934],{},[331,935,936],{},"\u002Fapi\u002Fproducts\u002Fmutate",[888,938,939],{},[331,940,941],{},"mutate",[888,943,944],{},"Create and update rows and their relations in one transaction",[867,946,947,951,956,961],{},[888,948,949],{},[331,950,912],{},[888,952,953],{},[331,954,955],{},"\u002Fapi\u002Fproducts\u002Factions\u002F{action}",[888,957,958],{},[331,959,960],{},"operate",[888,962,963],{},"Run an action that the resource declares",[867,965,966,970,975,980],{},[888,967,968],{},[331,969,912],{},[888,971,972],{},[331,973,974],{},"\u002Fapi\u002Fproducts\u002Fmetrics\u002F{metric}",[888,976,977],{},[331,978,979],{},"metric",[888,981,982],{},"Compute a metric that the resource declares",[867,984,985,990,994,999],{},[888,986,987],{},[331,988,989],{},"DELETE",[888,991,992],{},[331,993,897],{},[888,995,996],{},[331,997,998],{},"destroy",[888,1000,1001],{},"Delete rows",[867,1003,1004,1008,1013,1018],{},[888,1005,1006],{},[331,1007,912],{},[888,1009,1010],{},[331,1011,1012],{},"\u002Fapi\u002Fproducts\u002Frestore",[888,1014,1015],{},[331,1016,1017],{},"restore",[888,1019,1020],{},"Restore soft-deleted rows, opt-in",[867,1022,1023,1027,1032,1037],{},[888,1024,1025],{},[331,1026,989],{},[888,1028,1029],{},[331,1030,1031],{},"\u002Fapi\u002Fproducts\u002Fforce",[888,1033,1034],{},[331,1035,1036],{},"forceDestroy",[888,1038,1039],{},"Force delete rows, opt-in",[867,1041,1042,1046,1051,1056],{},[888,1043,1044],{},[331,1045,892],{},[888,1047,1048],{},[331,1049,1050],{},"\u002Fapi\u002Fproducts\u002Factions\u002F{action}\u002Fbatches\u002F{batch}",[888,1052,1053],{},[331,1054,1055],{},"batch",[888,1057,1058],{},"Read the progress of a batched action, opt-in",[318,1060,1061,1062,1065],{},"See ",[1063,1064,33],"a",{"href":39}," for the registration options.",[313,1067,1069],{"id":1068},"why-use-it","Why use it",[1071,1072,1073,1080,1086,1101,1110,1118],"ul",{},[1074,1075,1076,1079],"li",{},[322,1077,1078],{},"Declare, do not code."," A column that a resource does not declare does not exist for clients. The same goes for relations, scopes, actions and instructions. Adding a column to a table never exposes it.",[1074,1081,1082,1085],{},[322,1083,1084],{},"One request, many rows."," A search reads nested relations with their own filters and limits. A mutation creates a row, attaches its tags and updates its children in one transaction.",[1074,1087,1088,1091,1092,1095,1096,855,1098,1100],{},[322,1089,1090],{},"Authorization built in."," Every endpoint checks your Laravel policies: ",[331,1093,1094],{},"viewAny"," on each resource a request reaches, then each row it writes or deletes. A perimeter query decides which rows exist for each client. See ",[1063,1097,54],{"href":55},[1063,1099,154],{"href":155},".",[1074,1102,1103,1106,1107,1100],{},[322,1104,1105],{},"Typed and validated."," Each field has a type that decides its filter operators, its validation and its OpenAPI schema. Every payload is validated in one pass, with exact error keys such as ",[331,1108,1109],{},"search.filters.0.field",[1074,1111,1112,1115,1116,1100],{},[322,1113,1114],{},"Bounded."," Request sizes, nesting depths and totals are limited by configuration, so one request cannot ask for unbounded work. See ",[1063,1117,58],{"href":59},[1074,1119,1120,1123,1124,1100],{},[322,1121,1122],{},"Documented."," The package describes every endpoint in the OpenAPI document that Scramble serves. See ",[1063,1125,1126],{"href":185},"OpenAPI",[313,1128,1130],{"id":1129},"how-it-fits-laravel","How it fits Laravel",[318,1132,1133],{},"The package builds on what your application already has:",[1071,1135,1136,1142,1153,1164,1179,1190,1198],{},[1074,1137,1138,1141],{},[322,1139,1140],{},"Eloquent",": resources read and write your models, their casts, their scopes and their relations.",[1074,1143,1144,1146,1147,1150,1151,1100],{},[322,1145,154],{},": authorization goes through ",[331,1148,1149],{},"Gate"," and your policy classes. See ",[1063,1152,154],{"href":155},[1074,1154,1155,1157,1158,1161,1162,1100],{},[322,1156,50],{},": field rules are Laravel rules, and errors come back as standard ",[331,1159,1160],{},"422"," responses. See ",[1063,1163,50],{"href":51},[1074,1165,1166,1169,1170,1172,1173,855,1176,1100],{},[322,1167,1168],{},"Routing",": ",[331,1171,333],{}," registers plain Laravel routes that work with route groups, middleware, ",[331,1174,1175],{},"route:list",[331,1177,1178],{},"route:cache",[1074,1180,1181,1184,1185,855,1187,1100],{},[322,1182,1183],{},"Queues and events",": actions can be queued or batched, and writes dispatch Laravel events. See ",[1063,1186,128],{"href":129},[1063,1188,1189],{"href":177},"Events and hooks",[1074,1191,1192,1195,1196,1100],{},[322,1193,1194],{},"Laravel Scout",": a resource can run its text search on a Scout search engine. See ",[1063,1197,92],{"href":93},[1074,1199,1200,1203,1204,1100],{},[322,1201,1202],{},"Laravel Precognition",": forms can validate a payload before they send it. See ",[1063,1205,188],{"href":189},[313,1207,1209],{"id":1208},"version-3","Version 3",[318,1211,1212,1213,1100],{},"Version 3.0 types every declaration: fields, inputs and pivot fields are objects with a type, and the search, mutate and action payloads are validated against them. If you come from 2.x, read the ",[1063,1214,28],{"href":29},[313,1216,1218],{"id":1217},"meet-lomkit","Meet Lomkit",[318,1220,1221],{},"Lomkit is an organization dedicated to the Laravel community. We offer a collection of open source packages for developers, and we keep them up to date with the latest practices of the framework.",[318,1223,1224,1225,1231],{},"Community contributions are welcome. Explore our packages on ",[1063,1226,1230],{"href":1227,"rel":1228},"https:\u002F\u002Fgithub.com\u002Flomkit",[1229],"nofollow","GitHub",", open an issue or send a pull request.",[313,1233,1235],{"id":1234},"next-steps","Next steps",[1071,1237,1238,1243],{},[1074,1239,1240,1100],{},[1063,1241,1242],{"href":17},"Install the package",[1074,1244,1245,1248,1249,1100],{},[1063,1246,1247],{"href":21},"Expose your first models"," with ",[331,1250,1251],{},"rest:quick-start",[1253,1254,1255],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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 .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 .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);}",{"title":342,"searchDepth":349,"depth":374,"links":1257},[1258,1259,1260,1261,1262,1263,1264],{"id":315,"depth":374,"text":316},{"id":847,"depth":374,"text":848},{"id":1068,"depth":374,"text":1069},{"id":1129,"depth":374,"text":1130},{"id":1208,"depth":374,"text":1209},{"id":1217,"depth":374,"text":1218},{"id":1234,"depth":374,"text":1235},"Laravel Rest Api exposes your Eloquent models through a small set of endpoints. You declare what clients may read and write, the package does the rest.","md",null,{},{"title":12,"description":1265},{"loc":13},"lu-n4gtF2RzVSkAKc3IdldiHveKjeMKMwb6EdPRztpY",[1267,1273],{"title":16,"path":17,"stem":18,"description":1274,"children":-1},"Install Laravel Rest Api in a Laravel application, publish its configuration and add the optional packages.",1794181348017]