[{"data":1,"prerenderedAt":3281},["ShallowReactive",2],{"navigation":3,"\u002Factions-and-metrics\u002Factions":307,"\u002Factions-and-metrics\u002Factions-surround":3276},{"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":128,"body":309,"description":3269,"extension":3270,"links":3271,"meta":3272,"navigation":395,"path":129,"seo":3273,"sitemap":3274,"stem":130,"__hash__":3275},"docs3x\u002F5.actions-and-metrics\u002F1.actions.md",{"type":310,"value":311,"toc":3251},"minimark",[312,316,321,333,361,814,821,897,965,969,979,990,1118,1165,1218,1222,1229,1301,1358,1447,1471,1550,1616,1621,1640,1667,1677,1679,1704,1751,1760,1870,1879,1883,1892,2013,2089,2200,2229,2233,2269,2273,2276,2304,2346,2373,2377,2383,2424,2441,2455,2492,2496,2508,2536,2542,2630,2682,2725,2729,2749,3015,3052,3059,3063,3066,3150,3198,3209,3213,3247],[313,314,315],"p",{},"An action is a class that runs your code on rows of a resource: close tickets, send a notification, export orders. Each action gets its own route, validates typed inputs, checks the policies of the rows and answers with the number of rows it ran on and an optional result.",[317,318,320],"h2",{"id":319},"defining-an-action","Defining an action",[313,322,323,324,328,329,332],{},"Generate an action with the ",[325,326,327],"code",{},"rest:action"," Artisan command. The class is written in ",[325,330,331],{},"app\u002FRest\u002FActions",":",[334,335,340],"pre",{"className":336,"code":337,"language":338,"meta":339,"style":339},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan rest:action ExtendSubscriptions\n","bash","",[325,341,342],{"__ignoreMap":339},[343,344,347,351,355,358],"span",{"class":345,"line":346},"line",1,[343,348,350],{"class":349},"sBMFI","php",[343,352,354],{"class":353},"sfazB"," artisan",[343,356,357],{"class":353}," rest:action",[343,359,360],{"class":353}," ExtendSubscriptions\n",[334,362,365],{"className":363,"code":364,"language":350,"meta":339,"style":339},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","namespace App\\Rest\\Actions;\n\nuse Illuminate\\Support\\Collection;\nuse Lomkit\\Rest\\Actions\\Action;\nuse Lomkit\\Rest\\Actions\\ActionFields;\nuse Lomkit\\Rest\\Fields\\Date;\nuse Lomkit\\Rest\\Fields\\Enum;\n\nclass ExtendSubscriptions extends Action\n{\n    public function fields(): array\n    {\n        return [\n            Date::make('expires_at')->rules('required'),\n            Enum::make('plan', Plan::class)->default(Plan::Monthly),\n        ];\n    }\n\n    public function handle(ActionFields $fields, Collection $models): void\n    {\n        foreach ($models as $subscription) {\n            $subscription->update(['expires_at' => $fields->expires_at, 'plan' => $fields->plan]);\n        }\n    }\n}\n",[325,366,367,390,397,419,442,464,486,508,513,529,535,554,560,570,611,657,663,669,674,710,715,741,797,803,808],{"__ignoreMap":339},[343,368,369,373,376,380,383,385,387],{"class":345,"line":346},[343,370,372],{"class":371},"sbssI","namespace",[343,374,375],{"class":349}," App",[343,377,379],{"class":378},"sMK4o","\\",[343,381,382],{"class":349},"Rest",[343,384,379],{"class":378},[343,386,128],{"class":349},[343,388,389],{"class":378},";\n",[343,391,393],{"class":345,"line":392},2,[343,394,396],{"emptyLinePlaceholder":395},true,"\n",[343,398,400,403,407,409,412,414,417],{"class":345,"line":399},3,[343,401,402],{"class":371},"use",[343,404,406],{"class":405},"sTEyZ"," Illuminate",[343,408,379],{"class":378},[343,410,411],{"class":405},"Support",[343,413,379],{"class":378},[343,415,416],{"class":405},"Collection",[343,418,389],{"class":378},[343,420,422,424,427,429,431,433,435,437,440],{"class":345,"line":421},4,[343,423,402],{"class":371},[343,425,426],{"class":405}," Lomkit",[343,428,379],{"class":378},[343,430,382],{"class":405},[343,432,379],{"class":378},[343,434,128],{"class":405},[343,436,379],{"class":378},[343,438,439],{"class":405},"Action",[343,441,389],{"class":378},[343,443,445,447,449,451,453,455,457,459,462],{"class":345,"line":444},5,[343,446,402],{"class":371},[343,448,426],{"class":405},[343,450,379],{"class":378},[343,452,382],{"class":405},[343,454,379],{"class":378},[343,456,128],{"class":405},[343,458,379],{"class":378},[343,460,461],{"class":405},"ActionFields",[343,463,389],{"class":378},[343,465,467,469,471,473,475,477,479,481,484],{"class":345,"line":466},6,[343,468,402],{"class":371},[343,470,426],{"class":405},[343,472,379],{"class":378},[343,474,382],{"class":405},[343,476,379],{"class":378},[343,478,42],{"class":405},[343,480,379],{"class":378},[343,482,483],{"class":405},"Date",[343,485,389],{"class":378},[343,487,489,491,493,495,497,499,501,503,506],{"class":345,"line":488},7,[343,490,402],{"class":371},[343,492,426],{"class":405},[343,494,379],{"class":378},[343,496,382],{"class":405},[343,498,379],{"class":378},[343,500,42],{"class":405},[343,502,379],{"class":378},[343,504,505],{"class":405},"Enum",[343,507,389],{"class":378},[343,509,511],{"class":345,"line":510},8,[343,512,396],{"emptyLinePlaceholder":395},[343,514,516,520,523,526],{"class":345,"line":515},9,[343,517,519],{"class":518},"spNyl","class",[343,521,522],{"class":349}," ExtendSubscriptions",[343,524,525],{"class":518}," extends",[343,527,528],{"class":349}," Action\n",[343,530,532],{"class":345,"line":531},10,[343,533,534],{"class":378},"{\n",[343,536,538,541,544,548,551],{"class":345,"line":537},11,[343,539,540],{"class":518},"    public",[343,542,543],{"class":518}," function",[343,545,547],{"class":546},"s2Zo4"," fields",[343,549,550],{"class":378},"():",[343,552,553],{"class":371}," array\n",[343,555,557],{"class":345,"line":556},12,[343,558,559],{"class":378},"    {\n",[343,561,563,567],{"class":345,"line":562},13,[343,564,566],{"class":565},"s7zQu","        return",[343,568,569],{"class":378}," [\n",[343,571,573,576,579,582,585,588,591,593,596,599,601,603,606,608],{"class":345,"line":572},14,[343,574,575],{"class":349},"            Date",[343,577,578],{"class":378},"::",[343,580,581],{"class":546},"make",[343,583,584],{"class":378},"(",[343,586,587],{"class":378},"'",[343,589,590],{"class":353},"expires_at",[343,592,587],{"class":378},[343,594,595],{"class":378},")->",[343,597,598],{"class":546},"rules",[343,600,584],{"class":378},[343,602,587],{"class":378},[343,604,605],{"class":353},"required",[343,607,587],{"class":378},[343,609,610],{"class":378},"),\n",[343,612,614,617,619,621,623,625,628,630,633,636,638,640,642,645,647,650,652,655],{"class":345,"line":613},15,[343,615,616],{"class":349},"            Enum",[343,618,578],{"class":378},[343,620,581],{"class":546},[343,622,584],{"class":378},[343,624,587],{"class":378},[343,626,627],{"class":353},"plan",[343,629,587],{"class":378},[343,631,632],{"class":378},",",[343,634,635],{"class":349}," Plan",[343,637,578],{"class":378},[343,639,519],{"class":371},[343,641,595],{"class":378},[343,643,644],{"class":546},"default",[343,646,584],{"class":378},[343,648,649],{"class":349},"Plan",[343,651,578],{"class":378},[343,653,654],{"class":405},"Monthly",[343,656,610],{"class":378},[343,658,660],{"class":345,"line":659},16,[343,661,662],{"class":378},"        ];\n",[343,664,666],{"class":345,"line":665},17,[343,667,668],{"class":378},"    }\n",[343,670,672],{"class":345,"line":671},18,[343,673,396],{"emptyLinePlaceholder":395},[343,675,677,679,681,684,686,688,691,694,696,699,701,704,707],{"class":345,"line":676},19,[343,678,540],{"class":518},[343,680,543],{"class":518},[343,682,683],{"class":546}," handle",[343,685,584],{"class":378},[343,687,461],{"class":349},[343,689,690],{"class":378}," $",[343,692,693],{"class":405},"fields",[343,695,632],{"class":378},[343,697,698],{"class":349}," Collection",[343,700,690],{"class":378},[343,702,703],{"class":405},"models",[343,705,706],{"class":378},"):",[343,708,709],{"class":371}," void\n",[343,711,713],{"class":345,"line":712},20,[343,714,559],{"class":378},[343,716,718,721,724,727,730,732,735,738],{"class":345,"line":717},21,[343,719,720],{"class":565},"        foreach",[343,722,723],{"class":378}," ($",[343,725,726],{"class":405},"models ",[343,728,729],{"class":378},"as",[343,731,690],{"class":378},[343,733,734],{"class":405},"subscription",[343,736,737],{"class":378},")",[343,739,740],{"class":378}," {\n",[343,742,744,747,749,752,755,758,760,762,764,767,769,771,773,775,777,780,782,784,786,788,790,792,794],{"class":345,"line":743},22,[343,745,746],{"class":378},"            $",[343,748,734],{"class":405},[343,750,751],{"class":378},"->",[343,753,754],{"class":546},"update",[343,756,757],{"class":378},"([",[343,759,587],{"class":378},[343,761,590],{"class":353},[343,763,587],{"class":378},[343,765,766],{"class":378}," =>",[343,768,690],{"class":378},[343,770,693],{"class":405},[343,772,751],{"class":378},[343,774,590],{"class":405},[343,776,632],{"class":378},[343,778,779],{"class":378}," '",[343,781,627],{"class":353},[343,783,587],{"class":378},[343,785,766],{"class":378},[343,787,690],{"class":378},[343,789,693],{"class":405},[343,791,751],{"class":378},[343,793,627],{"class":405},[343,795,796],{"class":378},"]);\n",[343,798,800],{"class":345,"line":799},23,[343,801,802],{"class":378},"        }\n",[343,804,806],{"class":345,"line":805},24,[343,807,668],{"class":378},[343,809,811],{"class":345,"line":810},25,[343,812,813],{"class":378},"}\n",[313,815,816,817,820],{},"Declare it in the ",[325,818,819],{},"actions()"," method of the resource:",[334,822,824],{"className":363,"code":823,"language":350,"meta":339,"style":339},"use App\\Rest\\Actions\\ExtendSubscriptions;\n\npublic function actions(): array\n{\n    return [\n        ExtendSubscriptions::make(),\n    ];\n}\n",[325,825,826,847,851,865,869,876,888,893],{"__ignoreMap":339},[343,827,828,830,832,834,836,838,840,842,845],{"class":345,"line":346},[343,829,402],{"class":371},[343,831,375],{"class":405},[343,833,379],{"class":378},[343,835,382],{"class":405},[343,837,379],{"class":378},[343,839,128],{"class":405},[343,841,379],{"class":378},[343,843,844],{"class":405},"ExtendSubscriptions",[343,846,389],{"class":378},[343,848,849],{"class":345,"line":392},[343,850,396],{"emptyLinePlaceholder":395},[343,852,853,856,858,861,863],{"class":345,"line":399},[343,854,855],{"class":518},"public",[343,857,543],{"class":518},[343,859,860],{"class":546}," actions",[343,862,550],{"class":378},[343,864,553],{"class":371},[343,866,867],{"class":345,"line":421},[343,868,534],{"class":378},[343,870,871,874],{"class":345,"line":444},[343,872,873],{"class":565},"    return",[343,875,569],{"class":378},[343,877,878,881,883,885],{"class":345,"line":466},[343,879,880],{"class":349},"        ExtendSubscriptions",[343,882,578],{"class":378},[343,884,581],{"class":546},[343,886,887],{"class":378},"(),\n",[343,889,890],{"class":345,"line":488},[343,891,892],{"class":378},"    ];\n",[343,894,895],{"class":345,"line":510},[343,896,813],{"class":378},[898,899,900,922,935,954],"ul",{},[901,902,903,904,906,907,909,910,913,914,917,918,921],"li",{},"The action is named after its class, without an ",[325,905,439],{}," suffix: ",[325,908,844],{}," gives the name ",[325,911,912],{},"Extend Subscriptions"," and the key ",[325,915,916],{},"extend-subscriptions",". Set the ",[325,919,920],{},"$name"," property to choose another name.",[901,923,924,927,928,930,931,934],{},[325,925,926],{},"Rest::resource()"," reads ",[325,929,819],{}," when it registers the routes, without a user. Keep the list the same for every user and free of queries, and run ",[325,932,933],{},"php artisan route:cache"," again after you add an action.",[901,936,937,940,941,945,946,949,950,953],{},[325,938,939],{},"->meta(['color' => '#FFFFFF'])"," adds keys that the ",[942,943,944],"a",{"href":173},"details"," give to clients with ",[325,947,948],{},"?with=actions.meta",". ",[325,951,952],{},"getMeta()"," reads them.",[901,955,956,957,960,961,964],{},"Inside an action, ",[325,958,959],{},"$this->resource"," is the resource and ",[325,962,963],{},"$this->request()"," the request of the endpoint.",[317,966,968],{"id":967},"running-an-action","Running an action",[313,970,971,972,975,976,332],{},"Each action gets the route ",[325,973,974],{},"POST \u002F{resource}\u002Factions\u002F{uriKey}",", named ",[325,977,978],{},"{name}.operate.{uriKey}",[334,980,984],{"className":981,"code":982,"language":983,"meta":339,"style":339},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST \u002Fapi\u002Fsubscriptions\u002Factions\u002Fextend-subscriptions\n","http",[325,985,986],{"__ignoreMap":339},[343,987,988],{"class":345,"line":346},[343,989,982],{},[334,991,995],{"className":992,"code":993,"language":994,"meta":339,"style":339},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"fields\": [{\"name\": \"expires_at\", \"value\": \"2027-01-31\"}],\n  \"search\": {\"filters\": [{\"field\": \"status\", \"value\": \"active\"}]}\n}\n","json",[325,996,997,1001,1053,1114],{"__ignoreMap":339},[343,998,999],{"class":345,"line":346},[343,1000,534],{"class":378},[343,1002,1003,1006,1008,1011,1013,1016,1018,1021,1023,1025,1028,1030,1032,1034,1036,1039,1041,1043,1045,1048,1050],{"class":345,"line":392},[343,1004,1005],{"class":378},"  \"",[343,1007,693],{"class":518},[343,1009,1010],{"class":378},"\"",[343,1012,332],{"class":378},[343,1014,1015],{"class":378}," [{",[343,1017,1010],{"class":378},[343,1019,1020],{"class":349},"name",[343,1022,1010],{"class":378},[343,1024,332],{"class":378},[343,1026,1027],{"class":378}," \"",[343,1029,590],{"class":353},[343,1031,1010],{"class":378},[343,1033,632],{"class":378},[343,1035,1027],{"class":378},[343,1037,1038],{"class":349},"value",[343,1040,1010],{"class":378},[343,1042,332],{"class":378},[343,1044,1027],{"class":378},[343,1046,1047],{"class":353},"2027-01-31",[343,1049,1010],{"class":378},[343,1051,1052],{"class":378},"}],\n",[343,1054,1055,1057,1060,1062,1064,1067,1069,1072,1074,1076,1078,1080,1083,1085,1087,1089,1092,1094,1096,1098,1100,1102,1104,1106,1109,1111],{"class":345,"line":399},[343,1056,1005],{"class":378},[343,1058,1059],{"class":518},"search",[343,1061,1010],{"class":378},[343,1063,332],{"class":378},[343,1065,1066],{"class":378}," {",[343,1068,1010],{"class":378},[343,1070,1071],{"class":349},"filters",[343,1073,1010],{"class":378},[343,1075,332],{"class":378},[343,1077,1015],{"class":378},[343,1079,1010],{"class":378},[343,1081,1082],{"class":371},"field",[343,1084,1010],{"class":378},[343,1086,332],{"class":378},[343,1088,1027],{"class":378},[343,1090,1091],{"class":353},"status",[343,1093,1010],{"class":378},[343,1095,632],{"class":378},[343,1097,1027],{"class":378},[343,1099,1038],{"class":371},[343,1101,1010],{"class":378},[343,1103,332],{"class":378},[343,1105,1027],{"class":378},[343,1107,1108],{"class":353},"active",[343,1110,1010],{"class":378},[343,1112,1113],{"class":378},"}]}\n",[343,1115,1116],{"class":345,"line":421},[343,1117,813],{"class":378},[334,1119,1121],{"className":992,"code":1120,"language":994,"meta":339,"style":339},"{\"data\": {\"impacted\": 11, \"result\": null}}\n",[325,1122,1123],{"__ignoreMap":339},[343,1124,1125,1128,1130,1133,1135,1137,1139,1141,1144,1146,1148,1151,1153,1155,1158,1160,1162],{"class":345,"line":346},[343,1126,1127],{"class":378},"{",[343,1129,1010],{"class":378},[343,1131,1132],{"class":518},"data",[343,1134,1010],{"class":378},[343,1136,332],{"class":378},[343,1138,1066],{"class":378},[343,1140,1010],{"class":378},[343,1142,1143],{"class":349},"impacted",[343,1145,1010],{"class":378},[343,1147,332],{"class":378},[343,1149,1150],{"class":371}," 11",[343,1152,632],{"class":378},[343,1154,1027],{"class":378},[343,1156,1157],{"class":349},"result",[343,1159,1010],{"class":378},[343,1161,332],{"class":378},[343,1163,1164],{"class":378}," null}}\n",[898,1166,1167,1190,1203],{},[901,1168,1169,1171,1172,1175,1176,1179,1180,1183,1184,1186,1187,1189],{},[325,1170,693],{}," is a list of ",[325,1173,1174],{},"{name, value}"," entries, not an object keyed by name. An object is a ",[325,1177,1178],{},"422",": ",[325,1181,1182],{},"The fields field must be a list."," Each name appears once, and an entry takes ",[325,1185,1020],{}," and ",[325,1188,1038],{}," only.",[901,1191,1192,1194,1195,1198,1199,1202],{},[325,1193,1143],{}," is the number of rows that the action ran on: the rows given to ",[325,1196,1197],{},"handle()",", or the rows put into the jobs of a ",[942,1200,1201],{"href":133},"queued action",".",[901,1204,1205,1206,1209,1210,1213,1214,1217],{},"An unknown action answers ",[325,1207,1208],{},"404"," to a user allowed ",[325,1211,1212],{},"viewAny"," on the resource, and ",[325,1215,1216],{},"403"," to the others.",[317,1219,1221],{"id":1220},"targets","Targets",[313,1223,1224,1225,1228],{},"The target of an action sets the rows it runs on, and what the request may send. Set it with the ",[325,1226,1227],{},"$target"," property, or when the resource declares the action:",[334,1230,1232],{"className":363,"code":1231,"language":350,"meta":339,"style":339},"use Lomkit\\Rest\\Actions\\ActionTarget;\n\nclass DeactivateUsers extends Action\n{\n    public ActionTarget $target = ActionTarget::Resources;\n}\n",[325,1233,1234,1255,1259,1270,1274,1297],{"__ignoreMap":339},[343,1235,1236,1238,1240,1242,1244,1246,1248,1250,1253],{"class":345,"line":346},[343,1237,402],{"class":371},[343,1239,426],{"class":405},[343,1241,379],{"class":378},[343,1243,382],{"class":405},[343,1245,379],{"class":378},[343,1247,128],{"class":405},[343,1249,379],{"class":378},[343,1251,1252],{"class":405},"ActionTarget",[343,1254,389],{"class":378},[343,1256,1257],{"class":345,"line":392},[343,1258,396],{"emptyLinePlaceholder":395},[343,1260,1261,1263,1266,1268],{"class":345,"line":399},[343,1262,519],{"class":518},[343,1264,1265],{"class":349}," DeactivateUsers",[343,1267,525],{"class":518},[343,1269,528],{"class":349},[343,1271,1272],{"class":345,"line":421},[343,1273,534],{"class":378},[343,1275,1276,1278,1281,1283,1286,1289,1291,1293,1295],{"class":345,"line":444},[343,1277,540],{"class":518},[343,1279,1280],{"class":349}," ActionTarget",[343,1282,690],{"class":378},[343,1284,1285],{"class":405},"target ",[343,1287,1288],{"class":378},"=",[343,1290,1280],{"class":349},[343,1292,578],{"class":378},[343,1294,33],{"class":405},[343,1296,389],{"class":378},[343,1298,1299],{"class":345,"line":466},[343,1300,813],{"class":378},[334,1302,1304],{"className":363,"code":1303,"language":350,"meta":339,"style":339},"public function actions(): array\n{\n    return [SendDigest::make()->target(ActionTarget::None)];\n}\n",[325,1305,1306,1318,1322,1354],{"__ignoreMap":339},[343,1307,1308,1310,1312,1314,1316],{"class":345,"line":346},[343,1309,855],{"class":518},[343,1311,543],{"class":518},[343,1313,860],{"class":546},[343,1315,550],{"class":378},[343,1317,553],{"class":371},[343,1319,1320],{"class":345,"line":392},[343,1321,534],{"class":378},[343,1323,1324,1326,1329,1332,1334,1336,1339,1342,1344,1346,1348,1351],{"class":345,"line":399},[343,1325,873],{"class":565},[343,1327,1328],{"class":378}," [",[343,1330,1331],{"class":349},"SendDigest",[343,1333,578],{"class":378},[343,1335,581],{"class":546},[343,1337,1338],{"class":378},"()->",[343,1340,1341],{"class":546},"target",[343,1343,584],{"class":378},[343,1345,1252],{"class":349},[343,1347,578],{"class":378},[343,1349,1350],{"class":405},"None",[343,1352,1353],{"class":378},")];\n",[343,1355,1356],{"class":345,"line":421},[343,1357,813],{"class":378},[1359,1360,1361,1383],"table",{},[1362,1363,1364],"thead",{},[1365,1366,1367,1371,1375,1380],"tr",{},[1368,1369,1370],"th",{},"Target",[1368,1372,1373],{},[325,1374,1059],{},[1368,1376,1377],{},[325,1378,1379],{},"resources",[1368,1381,1382],{},"Rows",[1384,1385,1386,1413,1430],"tbody",{},[1365,1387,1388,1395,1397,1400],{},[1389,1390,1391,1394],"td",{},[325,1392,1393],{},"ActionTarget::Search",", the default",[1389,1396,605],{},[1389,1398,1399],{},"refused",[1389,1401,1402,1403,1405,1406,1409,1410],{},"the rows that ",[325,1404,1059],{}," matches inside the ",[942,1407,1408],{"href":55},"perimeter",", every row with ",[325,1411,1412],{},"\"search\": {}",[1365,1414,1415,1420,1422,1424],{},[1389,1416,1417],{},[325,1418,1419],{},"ActionTarget::Resources",[1389,1421,1399],{},[1389,1423,605],{},[1389,1425,1426,1427,1429],{},"the rows of the keys in ",[325,1428,1379],{},", in their order",[1365,1431,1432,1437,1439,1441],{},[1389,1433,1434],{},[325,1435,1436],{},"ActionTarget::None",[1389,1438,1399],{},[1389,1440,1399],{},[1389,1442,1443,1444,1446],{},"none: ",[325,1445,1197],{}," receives an empty collection",[1448,1449,1450],"note",{},[313,1451,1452,1453,1455,1456,1458,1459,1461,1462,1179,1464,1467,1468,1470],{},"With the ",[325,1454,62],{}," target, send ",[325,1457,1412],{}," to run the action on every row of the perimeter. A body without ",[325,1460,1059],{}," is a ",[325,1463,1178],{},[325,1465,1466],{},"The search field is required."," Use ",[325,1469,1419],{}," when an action must never reach every row: the client then names each row by key.",[334,1472,1474],{"className":992,"code":1473,"language":994,"meta":339,"style":339},"{\"resources\": [1, 5, 9], \"fields\": [{\"name\": \"reason\", \"value\": \"spam\"}]}\n",[325,1475,1476],{"__ignoreMap":339},[343,1477,1478,1480,1482,1484,1486,1488,1490,1493,1495,1498,1500,1503,1506,1508,1510,1512,1514,1516,1518,1520,1522,1524,1526,1529,1531,1533,1535,1537,1539,1541,1543,1546,1548],{"class":345,"line":346},[343,1479,1127],{"class":378},[343,1481,1010],{"class":378},[343,1483,1379],{"class":518},[343,1485,1010],{"class":378},[343,1487,332],{"class":378},[343,1489,1328],{"class":378},[343,1491,1492],{"class":371},"1",[343,1494,632],{"class":378},[343,1496,1497],{"class":371}," 5",[343,1499,632],{"class":378},[343,1501,1502],{"class":371}," 9",[343,1504,1505],{"class":378},"],",[343,1507,1027],{"class":378},[343,1509,693],{"class":518},[343,1511,1010],{"class":378},[343,1513,332],{"class":378},[343,1515,1015],{"class":378},[343,1517,1010],{"class":378},[343,1519,1020],{"class":349},[343,1521,1010],{"class":378},[343,1523,332],{"class":378},[343,1525,1027],{"class":378},[343,1527,1528],{"class":353},"reason",[343,1530,1010],{"class":378},[343,1532,632],{"class":378},[343,1534,1027],{"class":378},[343,1536,1038],{"class":349},[343,1538,1010],{"class":378},[343,1540,332],{"class":378},[343,1542,1027],{"class":378},[343,1544,1545],{"class":353},"spam",[343,1547,1010],{"class":378},[343,1549,1113],{"class":378},[898,1551,1552,1568,1595],{},[901,1553,1554,1556,1557,1559,1560,1563,1564,1567],{},[325,1555,1059],{}," takes the keys of a ",[942,1558,1059],{"href":69},", without ",[325,1561,1562],{},"page",", as an object. ",[325,1565,1566],{},"text"," works on a resource that declares a text search.",[901,1569,1570,1571,1573,1574,1577,1578,1580,1581,1584,1585,1587,1588,1594],{},"A key of ",[325,1572,1379],{}," that does not exist, or that ",[325,1575,1576],{},"perimeterQuery()"," leaves out, is a ",[325,1579,1178],{}," under ",[325,1582,1583],{},"resources.{index}",". A repeated key is a ",[325,1586,1178],{}," too. A key outside the perimeter also dispatches the ",[942,1589,1591],{"href":1590},"\u002Fdigging-deeper\u002Fevents-and-hooks#keys-out-of-reach",[325,1592,1593],{},"KeysOutOfReach"," event.",[901,1596,1597,1598,1600,1601,1604,1605,1608,1609,1612,1613,1202],{},"The ",[942,1599,944],{"href":173},", with ",[325,1602,1603],{},"?with=actions",", give the target of each action as ",[325,1606,1607],{},"\"target\": \"search\"",", ",[325,1610,1611],{},"\"resources\""," or ",[325,1614,1615],{},"\"none\"",[1617,1618,1620],"h3",{"id":1619},"capping-the-rows","Capping the rows",[313,1622,1623,1624,1627,1628,1631,1632,1580,1634,1636,1637],{},"Every target is capped by the ",[325,1625,1626],{},"$maxResources"," property, ",[325,1629,1630],{},"1000"," by default. A search that matches more rows answers a ",[325,1633,1178],{},[325,1635,1059],{}," before the action runs on any row: ",[325,1638,1639],{},"This action can be run on at most 1000 resources; narrow the search.",[334,1641,1643],{"className":363,"code":1642,"language":350,"meta":339,"style":339},"public ?int $maxResources = 5000;\n",[325,1644,1645],{"__ignoreMap":339},[343,1646,1647,1649,1652,1655,1657,1660,1662,1665],{"class":345,"line":346},[343,1648,855],{"class":518},[343,1650,1651],{"class":378}," ?",[343,1653,1654],{"class":371},"int",[343,1656,690],{"class":378},[343,1658,1659],{"class":405},"maxResources ",[343,1661,1288],{"class":378},[343,1663,1664],{"class":371}," 5000",[343,1666,389],{"class":378},[313,1668,1669,1672,1673,1676],{},[325,1670,1671],{},"->maxResources(5000)"," sets it when the resource declares the action. ",[325,1674,1675],{},"null"," removes the cap: the action then runs on every row that its search matches, without counting them first.",[317,1678,42],{"id":693},[313,1680,1681,1684,1685,1688,1689,1608,1692,1608,1695,1608,1698,1186,1701,1202],{},[325,1682,1683],{},"fields()"," returns typed fields, the same classes as the ",[942,1686,1687],{"href":43},"fields of a resource",". They take ",[325,1690,1691],{},"rules()",[325,1693,1694],{},"nullable()",[325,1696,1697],{},"default()",[325,1699,1700],{},"label()",[325,1702,1703],{},"messages()",[898,1705,1706,1720,1730,1740],{},[901,1707,1708,1709,1608,1711,1186,1714,1717,1718,1202],{},"Each field is validated as a normal Laravel validation: ",[325,1710,605],{},[325,1712,1713],{},"required_if",[325,1715,1716],{},"present"," fire even when the field is absent from ",[325,1719,693],{},[901,1721,1722,1723,1726,1727,1202],{},"An error is keyed by the field name, ",[325,1724,1725],{},"fields.expires_at",". An unknown or repeated name is reported by position, ",[325,1728,1729],{},"fields.0.name",[901,1731,1732,1733,1735,1736,1739],{},"An ",[325,1734,505],{}," field names its enum class, ",[325,1737,1738],{},"Enum::make('plan', Plan::class)",", because action fields are not bound to a model.",[901,1741,1742,1743,1746,1747,1750],{},"The list takes at most ",[325,1744,1745],{},"rest.limits.sizes.fields"," entries, ",[325,1748,1749],{},"100"," by default.",[313,1752,1753,1755,1756,1759],{},[325,1754,1197],{}," receives a read-only ",[325,1757,1758],{},"Lomkit\\Rest\\Actions\\ActionFields",". Each declared input is a property cast to its field type, with its default filled in:",[1359,1761,1762,1772],{},[1362,1763,1764],{},[1365,1765,1766,1769],{},[1368,1767,1768],{},"Read",[1368,1770,1771],{},"Gives",[1384,1773,1774,1796,1812,1831,1847,1857],{},[1365,1775,1776,1781],{},[1389,1777,1778],{},[325,1779,1780],{},"$fields->expires_at",[1389,1782,1783,1784,1787,1788,1790,1791,1608,1793,1795],{},"a ",[325,1785,1786],{},"CarbonImmutable"," for a ",[325,1789,483],{},", the case for an ",[325,1792,505],{},[325,1794,1675],{}," when not sent and without default",[1365,1797,1798,1803],{},[1389,1799,1800],{},[325,1801,1802],{},"$fields->has('reason')",[1389,1804,1805,1808,1809,1811],{},[325,1806,1807],{},"true"," when the client sent it, ",[325,1810,1675],{}," included, or when the field has a default",[1365,1813,1814,1819],{},[1389,1815,1816],{},[325,1817,1818],{},"$fields->filled('reason')",[1389,1820,1821,1824,1825,1827,1828],{},[325,1822,1823],{},"has()"," and not ",[325,1826,1675],{},", like ",[325,1829,1830],{},"isset($fields->reason)",[1365,1832,1833,1841],{},[1389,1834,1835,1608,1838],{},[325,1836,1837],{},"$fields->only('plan', 'reason')",[325,1839,1840],{},"$fields->toArray()",[1389,1842,1843,1844,1846],{},"the inputs that ",[325,1845,1823],{}," reports, by name",[1365,1848,1849,1854],{},[1389,1850,1851],{},[325,1852,1853],{},"$fields->user()",[1389,1855,1856],{},"the user who sent the request, also in a queued job",[1365,1858,1859,1864],{},[1389,1860,1861],{},[325,1862,1863],{},"$fields->target()",[1389,1865,1866,1867,1869],{},"the ",[325,1868,1252],{}," of the action",[313,1871,1872,1873,1875,1876,1202],{},"Reading an input that ",[325,1874,1683],{}," does not declare throws ",[325,1877,1878],{},"Lomkit\\Rest\\Exceptions\\InvalidFieldException",[317,1880,1882],{"id":1881},"results","Results",[313,1884,1885,1886,1889,1890,332],{},"Override ",[325,1887,1888],{},"respond()"," to answer the client with a result. It runs once, after the last chunk, and receives the fields and ",[325,1891,1143],{},[334,1893,1895],{"className":363,"code":1894,"language":350,"meta":339,"style":339},"use Lomkit\\Rest\\Actions\\ActionFields;\nuse Lomkit\\Rest\\Actions\\ActionResponse;\n\npublic function respond(ActionFields $fields, int $impacted): ?ActionResponse\n{\n    return ActionResponse::message(\"{$impacted} subscriptions extended\");\n}\n",[325,1896,1897,1917,1938,1942,1975,1979,2009],{"__ignoreMap":339},[343,1898,1899,1901,1903,1905,1907,1909,1911,1913,1915],{"class":345,"line":346},[343,1900,402],{"class":371},[343,1902,426],{"class":405},[343,1904,379],{"class":378},[343,1906,382],{"class":405},[343,1908,379],{"class":378},[343,1910,128],{"class":405},[343,1912,379],{"class":378},[343,1914,461],{"class":405},[343,1916,389],{"class":378},[343,1918,1919,1921,1923,1925,1927,1929,1931,1933,1936],{"class":345,"line":392},[343,1920,402],{"class":371},[343,1922,426],{"class":405},[343,1924,379],{"class":378},[343,1926,382],{"class":405},[343,1928,379],{"class":378},[343,1930,128],{"class":405},[343,1932,379],{"class":378},[343,1934,1935],{"class":405},"ActionResponse",[343,1937,389],{"class":378},[343,1939,1940],{"class":345,"line":399},[343,1941,396],{"emptyLinePlaceholder":395},[343,1943,1944,1946,1948,1951,1953,1955,1957,1959,1961,1964,1966,1968,1970,1972],{"class":345,"line":421},[343,1945,855],{"class":518},[343,1947,543],{"class":518},[343,1949,1950],{"class":546}," respond",[343,1952,584],{"class":378},[343,1954,461],{"class":349},[343,1956,690],{"class":378},[343,1958,693],{"class":405},[343,1960,632],{"class":378},[343,1962,1963],{"class":371}," int",[343,1965,690],{"class":378},[343,1967,1143],{"class":405},[343,1969,706],{"class":378},[343,1971,1651],{"class":378},[343,1973,1974],{"class":349},"ActionResponse\n",[343,1976,1977],{"class":345,"line":444},[343,1978,534],{"class":378},[343,1980,1981,1983,1986,1988,1991,1993,1996,1998,2001,2004,2006],{"class":345,"line":466},[343,1982,873],{"class":565},[343,1984,1985],{"class":349}," ActionResponse",[343,1987,578],{"class":378},[343,1989,1990],{"class":546},"message",[343,1992,584],{"class":378},[343,1994,1995],{"class":378},"\"{$",[343,1997,1143],{"class":405},[343,1999,2000],{"class":378},"}",[343,2002,2003],{"class":353}," subscriptions extended",[343,2005,1010],{"class":378},[343,2007,2008],{"class":378},");\n",[343,2010,2011],{"class":345,"line":488},[343,2012,813],{"class":378},[334,2014,2016],{"className":992,"code":2015,"language":994,"meta":339,"style":339},"{\"data\": {\"impacted\": 11, \"result\": {\"type\": \"message\", \"message\": \"11 subscriptions extended\"}}}\n",[325,2017,2018],{"__ignoreMap":339},[343,2019,2020,2022,2024,2026,2028,2030,2032,2034,2036,2038,2040,2042,2044,2046,2048,2050,2052,2054,2056,2059,2061,2063,2065,2067,2069,2071,2073,2075,2077,2079,2081,2084,2086],{"class":345,"line":346},[343,2021,1127],{"class":378},[343,2023,1010],{"class":378},[343,2025,1132],{"class":518},[343,2027,1010],{"class":378},[343,2029,332],{"class":378},[343,2031,1066],{"class":378},[343,2033,1010],{"class":378},[343,2035,1143],{"class":349},[343,2037,1010],{"class":378},[343,2039,332],{"class":378},[343,2041,1150],{"class":371},[343,2043,632],{"class":378},[343,2045,1027],{"class":378},[343,2047,1157],{"class":349},[343,2049,1010],{"class":378},[343,2051,332],{"class":378},[343,2053,1066],{"class":378},[343,2055,1010],{"class":378},[343,2057,2058],{"class":371},"type",[343,2060,1010],{"class":378},[343,2062,332],{"class":378},[343,2064,1027],{"class":378},[343,2066,1990],{"class":353},[343,2068,1010],{"class":378},[343,2070,632],{"class":378},[343,2072,1027],{"class":378},[343,2074,1990],{"class":371},[343,2076,1010],{"class":378},[343,2078,332],{"class":378},[343,2080,1027],{"class":378},[343,2082,2083],{"class":353},"11 subscriptions extended",[343,2085,1010],{"class":378},[343,2087,2088],{"class":378},"}}}\n",[1359,2090,2091,2104],{},[1362,2092,2093],{},[1365,2094,2095,2100],{},[1368,2096,2097,2099],{},[325,2098,1888],{}," returns",[1368,2101,2102],{},[325,2103,1157],{},[1384,2105,2106,2118,2130,2142,2154,2166,2178,2190],{},[1365,2107,2108,2113],{},[1389,2109,2110],{},[325,2111,2112],{},"ActionResponse::message('Done')",[1389,2114,2115],{},[325,2116,2117],{},"{\"type\": \"message\", \"message\": \"Done\"}",[1365,2119,2120,2125],{},[1389,2121,2122],{},[325,2123,2124],{},"ActionResponse::danger('2 subscriptions are locked')",[1389,2126,2127],{},[325,2128,2129],{},"{\"type\": \"danger\", \"message\": \"2 subscriptions are locked\"}",[1365,2131,2132,2137],{},[1389,2133,2134],{},[325,2135,2136],{},"ActionResponse::download($url, 'subscriptions.csv')",[1389,2138,2139],{},[325,2140,2141],{},"{\"type\": \"download\", \"url\": \"...\", \"name\": \"subscriptions.csv\"}",[1365,2143,2144,2149],{},[1389,2145,2146],{},[325,2147,2148],{},"ActionResponse::redirect($url)",[1389,2150,2151],{},[325,2152,2153],{},"{\"type\": \"redirect\", \"url\": \"...\"}",[1365,2155,2156,2161],{},[1389,2157,2158],{},[325,2159,2160],{},"ActionResponse::created($invoices)",[1389,2162,2163],{},[325,2164,2165],{},"{\"type\": \"created\", \"keys\": [29, 30]}",[1365,2167,2168,2173],{},[1389,2169,2170],{},[325,2171,2172],{},"ActionResponse::data(['export' => 41, 'rows' => 120])",[1389,2174,2175],{},[325,2176,2177],{},"{\"type\": \"data\", \"data\": {\"export\": 41, \"rows\": 120}}",[1365,2179,2180,2185],{},[1389,2181,2182],{},[325,2183,2184],{},"ActionResponse::message('Export started')->withData(['export' => 41])",[1389,2186,2187],{},[325,2188,2189],{},"{\"type\": \"message\", \"message\": \"Export started\", \"data\": {\"export\": 41}}",[1365,2191,2192,2196],{},[1389,2193,2194,1394],{},[325,2195,1675],{},[1389,2197,2198],{},[325,2199,1675],{},[898,2201,2202,2209,2221],{},[901,2203,2204,2205,2208],{},"The status stays ",[325,2206,2207],{},"200",". The package does not send the file or follow the URL: the client acts on the result.",[901,2210,2211,1186,2214,2217,2218,1202],{},[325,2212,2213],{},"data()",[325,2215,2216],{},"withData()"," take an array with string keys. A list throws ",[325,2219,2220],{},"Lomkit\\Rest\\Exceptions\\InvalidActionException",[901,2222,2223,2225,2226,2228],{},[325,2224,1888],{}," does not run when ",[325,2227,1197],{}," throws.",[317,2230,2232],{"id":2231},"hints-for-clients","Hints for clients",[313,2234,2235,1186,2238,2241,2242,1186,2245,2248,2249,2251,2252,2254,2255,2259,2260,1186,2263,2266,2267,1202],{},[325,2236,2237],{},"->destructive()",[325,2239,2240],{},"->confirm('Extend the selected subscriptions?')"," mark an action for clients, or the ",[325,2243,2244],{},"$destructive",[325,2246,2247],{},"$confirm"," properties. The ",[942,2250,944],{"href":173}," give both on each action, with ",[325,2253,1603],{},", and the ",[942,2256,2258],{"href":2257},"\u002Fdigging-deeper\u002Fopenapi#actions-and-writes","OpenAPI"," operation of the action carries them as ",[325,2261,2262],{},"x-lomkit-destructive",[325,2264,2265],{},"x-lomkit-confirm",". The endpoint runs the action the same way: to make the endpoint check a confirmation, see ",[942,2268,136],{"href":137},[317,2270,2272],{"id":2271},"abilities","Abilities",[313,2274,2275],{},"Before validation, a known action checks, in this order:",[2277,2278,2279,2284,2295],"ol",{},[901,2280,2281,2283],{},[325,2282,1212],{}," on the resource;",[901,2285,2286,2287,2290,2291,2294],{},"the abilities that the resource's ",[325,2288,2289],{},"abilities()"," returns for ",[325,2292,2293],{},"Endpoint::Operate",", none by default;",[901,2296,2297,2298,2300,2301,1750],{},"the abilities that the action's ",[325,2299,2289],{}," returns, ",[325,2302,2303],{},"['viewAny']",[334,2305,2307],{"className":363,"code":2306,"language":350,"meta":339,"style":339},"public function abilities(): array\n{\n    return ['export'];\n}\n",[325,2308,2309,2322,2326,2342],{"__ignoreMap":339},[343,2310,2311,2313,2315,2318,2320],{"class":345,"line":346},[343,2312,855],{"class":518},[343,2314,543],{"class":518},[343,2316,2317],{"class":546}," abilities",[343,2319,550],{"class":378},[343,2321,553],{"class":371},[343,2323,2324],{"class":345,"line":392},[343,2325,534],{"class":378},[343,2327,2328,2330,2332,2334,2337,2339],{"class":345,"line":399},[343,2329,873],{"class":565},[343,2331,1328],{"class":378},[343,2333,587],{"class":378},[343,2335,2336],{"class":353},"export",[343,2338,587],{"class":378},[343,2340,2341],{"class":378},"];\n",[343,2343,2344],{"class":345,"line":421},[343,2345,813],{"class":378},[313,2347,2348,2349,2351,2352,2354,2355,2357,2358,2360,2361,2364,2365,2367,2368,2370,2371,1202],{},"These abilities add to ",[325,2350,1212],{},": the action above checks ",[325,2353,1212],{},", then ",[325,2356,2336],{},". An action whose ",[325,2359,2289],{}," returns ",[325,2362,2363],{},"[]"," runs without any of these checks, for an action that any user may run, guests included. The resources that its ",[325,2366,1059],{}," reaches through includes and relation filters still need ",[325,2369,1212],{},". See ",[942,2372,154],{"href":155},[1617,2374,2376],{"id":2375},"checking-each-row","Checking each row",[313,2378,2379,2382],{},[325,2380,2381],{},"authorizeEach()"," names a policy ability that the action checks on every row before it runs on any row:",[334,2384,2386],{"className":363,"code":2385,"language":350,"meta":339,"style":339},"public function authorizeEach(): ?string\n{\n    return 'update';\n}\n",[325,2387,2388,2404,2408,2420],{"__ignoreMap":339},[343,2389,2390,2392,2394,2397,2399,2401],{"class":345,"line":346},[343,2391,855],{"class":518},[343,2393,543],{"class":518},[343,2395,2396],{"class":546}," authorizeEach",[343,2398,550],{"class":378},[343,2400,1651],{"class":378},[343,2402,2403],{"class":371},"string\n",[343,2405,2406],{"class":345,"line":392},[343,2407,534],{"class":378},[343,2409,2410,2412,2414,2416,2418],{"class":345,"line":399},[343,2411,873],{"class":565},[343,2413,779],{"class":378},[343,2415,754],{"class":353},[343,2417,587],{"class":378},[343,2419,389],{"class":378},[343,2421,2422],{"class":345,"line":421},[343,2423,813],{"class":378},[313,2425,2426,2427,2429,2430,2433,2434,2437,2438,1202],{},"A refused row answers ",[325,2428,1216],{}," with the message of the first refusal, ",[325,2431,2432],{},"{\"message\": \"Closed tickets are read-only.\"}",", and no row is handled, no job is queued. To list every refused row in the body, see the ",[325,2435,2436],{},"denials"," of ",[942,2439,154],{"href":2440},"\u002Fauthorization\u002Fpolicies#denials",[313,2442,2443,2444,2447,2448,2451,2452,2454],{},"With ",[325,2445,2446],{},"->skipUnauthorized()",", or ",[325,2449,2450],{},"public bool $skipUnauthorized = true;",", the action runs on the allowed rows only, and ",[325,2453,1143],{}," counts them. A queued action checks the rows in the request, not again in the worker.",[898,2456,2457,2470],{},[901,2458,2459,2462,2463,2465,2466,2469],{},[325,2460,2461],{},"skipUnauthorized()"," without an ability, or an ability on the ",[325,2464,1350],{}," target, throws ",[325,2467,2468],{},"InvalidActionException"," when the actions of the resource are read.",[901,2471,2472,2478,2479,1612,2481,2483,2484,2360,2486,2488,2489,1202],{},[942,2473,2475],{"href":2474},"\u002Fdigging-deeper\u002Fartisan#checking-the-application",[325,2476,2477],{},"php artisan rest:check"," reports each action on the ",[325,2480,62],{},[325,2482,33],{}," target whose ",[325,2485,2381],{},[325,2487,1675],{},". An action that only reads returns ",[325,2490,2491],{},"'view'",[317,2493,2495],{"id":2494},"chunks-and-transactions","Chunks and transactions",[313,2497,2498,2499,2501,2502,2505,2506,1750],{},"The rows reach ",[325,2500,1197],{}," in chunks of ",[325,2503,2504],{},"$chunkCount"," rows, ",[325,2507,1749],{},[898,2509,2510,2521,2529],{},[901,2511,2512,2513,2516,2517,2520],{},"A search without ",[325,2514,2515],{},"sorts"," and without ",[325,2518,2519],{},"limit"," reads the rows in the order of their key, chunk after chunk, so an action that changes a filtered column still reaches every row.",[901,2522,2443,2523,2525,2526,2528],{},[325,2524,2515],{}," or a ",[325,2527,2519],{},", the action reads the keys first, in the order of the search, then loads each chunk of keys.",[901,2530,1597,2531,2533,2534,1202],{},[325,2532,33],{}," target gives the rows in the order of ",[325,2535,1379],{},[313,2537,1597,2538,2541],{},[325,2539,2540],{},"$transaction"," property chooses the transactions, on the connection of the model:",[1359,2543,2544,2557],{},[1362,2545,2546],{},[1365,2547,2548,2551,2554],{},[1368,2549,2550],{},"Value",[1368,2552,2553],{},"Declaring",[1368,2555,2556],{},"Behaviour",[1384,2558,2559,2574,2589,2612],{},[1365,2560,2561,2566,2568],{},[1389,2562,2563,1394],{},[325,2564,2565],{},"ActionTransaction::Chunk",[1389,2567],{},[1389,2569,2570,2571,2573],{},"each chunk runs in its own transaction, also around ",[325,2572,1197],{}," in a queued job",[1365,2575,2576,2581,2586],{},[1389,2577,2578],{},[325,2579,2580],{},"ActionTransaction::Whole",[1389,2582,2583],{},[325,2584,2585],{},"->atomic()",[1389,2587,2588],{},"every chunk runs in one transaction: a throw rolls back every row",[1365,2590,2591,2596,2601],{},[1389,2592,2593],{},[325,2594,2595],{},"ActionTransaction::Row",[1389,2597,2598],{},[325,2599,2600],{},"->transactionPerRow()",[1389,2602,2603,2604,2607,2608],{},"each row runs in its own transaction, in ",[325,2605,2606],{},"handleRow()",", see ",[942,2609,2611],{"href":2610},"#one-transaction-per-row","below",[1365,2613,2614,2619,2624],{},[1389,2615,2616],{},[325,2617,2618],{},"ActionTransaction::None",[1389,2620,2621],{},[325,2622,2623],{},"->withoutTransaction()",[1389,2625,2626,2627,2629],{},"no transaction: each row is written when ",[325,2628,1197],{}," writes it",[334,2631,2633],{"className":363,"code":2632,"language":350,"meta":339,"style":339},"use Lomkit\\Rest\\Actions\\ActionTransaction;\n\npublic ActionTransaction $transaction = ActionTransaction::None;\n",[325,2634,2635,2656,2660],{"__ignoreMap":339},[343,2636,2637,2639,2641,2643,2645,2647,2649,2651,2654],{"class":345,"line":346},[343,2638,402],{"class":371},[343,2640,426],{"class":405},[343,2642,379],{"class":378},[343,2644,382],{"class":405},[343,2646,379],{"class":378},[343,2648,128],{"class":405},[343,2650,379],{"class":378},[343,2652,2653],{"class":405},"ActionTransaction",[343,2655,389],{"class":378},[343,2657,2658],{"class":345,"line":392},[343,2659,396],{"emptyLinePlaceholder":395},[343,2661,2662,2664,2667,2669,2672,2674,2676,2678,2680],{"class":345,"line":399},[343,2663,855],{"class":518},[343,2665,2666],{"class":349}," ActionTransaction",[343,2668,690],{"class":378},[343,2670,2671],{"class":405},"transaction ",[343,2673,1288],{"class":378},[343,2675,2666],{"class":349},[343,2677,578],{"class":378},[343,2679,1350],{"class":405},[343,2681,389],{"class":378},[898,2683,2684,2690,2695,2708],{},[901,2685,2686,2687,2689],{},"Use ",[325,2688,1350],{}," for an action that calls an external service on each row or commits its own progress.",[901,2691,2692,2694],{},[325,2693,1888],{}," runs after the commit.",[901,2696,2697,2700,2701,2704,2705,2707],{},[325,2698,2699],{},"Whole"," on an action that implements ",[325,2702,2703],{},"ShouldQueue"," throws ",[325,2706,2468],{},": its chunks run in the worker, outside the request.",[901,2709,2443,2710,2713,2714,2716,2717,2720,2721,1202],{},[325,2711,2712],{},"transactions.attempts"," above ",[325,2715,1492],{}," in ",[325,2718,2719],{},"config\u002Frest.php",", a chunk, a row or a whole run that hits a deadlock runs again. See ",[942,2722,2724],{"href":2723},"\u002Fwriting\u002Fmutate#deadlock-retries","Deadlock retries",[1617,2726,2728],{"id":2727},"one-transaction-per-row","One transaction per row",[313,2730,2443,2731,2733,2734,2736,2737,2739,2740,2742,2743,949,2745,2748],{},[325,2732,2595],{},", each row runs in its own transaction, in the request and in the jobs of a ",[942,2735,1201],{"href":133},", whatever ",[325,2738,2504],{},". The rows reach ",[325,2741,2606],{}," instead of ",[325,2744,1197],{},[325,2746,2747],{},"beforeRow()"," runs just before, outside any transaction, for a call to an external service:",[334,2750,2752],{"className":363,"code":2751,"language":350,"meta":339,"style":339},"use Illuminate\\Database\\Eloquent\\Model;\nuse Lomkit\\Rest\\Actions\\Action;\nuse Lomkit\\Rest\\Actions\\ActionFields;\nuse Lomkit\\Rest\\Actions\\ActionTransaction;\n\nclass InvoiceOrders extends Action\n{\n    public ActionTransaction $transaction = ActionTransaction::Row;\n\n    public function beforeRow(ActionFields $fields, Model $row): void\n    {\n        $this->billing->reserveInvoiceNumber($row);\n    }\n\n    public function handleRow(ActionFields $fields, Model $row): void\n    {\n        $row->update(['status' => 'invoiced']);\n    }\n}\n",[325,2753,2754,2777,2797,2817,2837,2841,2852,2856,2877,2881,2912,2916,2936,2940,2944,2973,2977,3007,3011],{"__ignoreMap":339},[343,2755,2756,2758,2760,2762,2765,2767,2770,2772,2775],{"class":345,"line":346},[343,2757,402],{"class":371},[343,2759,406],{"class":405},[343,2761,379],{"class":378},[343,2763,2764],{"class":405},"Database",[343,2766,379],{"class":378},[343,2768,2769],{"class":405},"Eloquent",[343,2771,379],{"class":378},[343,2773,2774],{"class":405},"Model",[343,2776,389],{"class":378},[343,2778,2779,2781,2783,2785,2787,2789,2791,2793,2795],{"class":345,"line":392},[343,2780,402],{"class":371},[343,2782,426],{"class":405},[343,2784,379],{"class":378},[343,2786,382],{"class":405},[343,2788,379],{"class":378},[343,2790,128],{"class":405},[343,2792,379],{"class":378},[343,2794,439],{"class":405},[343,2796,389],{"class":378},[343,2798,2799,2801,2803,2805,2807,2809,2811,2813,2815],{"class":345,"line":399},[343,2800,402],{"class":371},[343,2802,426],{"class":405},[343,2804,379],{"class":378},[343,2806,382],{"class":405},[343,2808,379],{"class":378},[343,2810,128],{"class":405},[343,2812,379],{"class":378},[343,2814,461],{"class":405},[343,2816,389],{"class":378},[343,2818,2819,2821,2823,2825,2827,2829,2831,2833,2835],{"class":345,"line":421},[343,2820,402],{"class":371},[343,2822,426],{"class":405},[343,2824,379],{"class":378},[343,2826,382],{"class":405},[343,2828,379],{"class":378},[343,2830,128],{"class":405},[343,2832,379],{"class":378},[343,2834,2653],{"class":405},[343,2836,389],{"class":378},[343,2838,2839],{"class":345,"line":444},[343,2840,396],{"emptyLinePlaceholder":395},[343,2842,2843,2845,2848,2850],{"class":345,"line":466},[343,2844,519],{"class":518},[343,2846,2847],{"class":349}," InvoiceOrders",[343,2849,525],{"class":518},[343,2851,528],{"class":349},[343,2853,2854],{"class":345,"line":488},[343,2855,534],{"class":378},[343,2857,2858,2860,2862,2864,2866,2868,2870,2872,2875],{"class":345,"line":510},[343,2859,540],{"class":518},[343,2861,2666],{"class":349},[343,2863,690],{"class":378},[343,2865,2671],{"class":405},[343,2867,1288],{"class":378},[343,2869,2666],{"class":349},[343,2871,578],{"class":378},[343,2873,2874],{"class":405},"Row",[343,2876,389],{"class":378},[343,2878,2879],{"class":345,"line":515},[343,2880,396],{"emptyLinePlaceholder":395},[343,2882,2883,2885,2887,2890,2892,2894,2896,2898,2900,2903,2905,2908,2910],{"class":345,"line":531},[343,2884,540],{"class":518},[343,2886,543],{"class":518},[343,2888,2889],{"class":546}," beforeRow",[343,2891,584],{"class":378},[343,2893,461],{"class":349},[343,2895,690],{"class":378},[343,2897,693],{"class":405},[343,2899,632],{"class":378},[343,2901,2902],{"class":349}," Model",[343,2904,690],{"class":378},[343,2906,2907],{"class":405},"row",[343,2909,706],{"class":378},[343,2911,709],{"class":371},[343,2913,2914],{"class":345,"line":537},[343,2915,559],{"class":378},[343,2917,2918,2921,2924,2926,2929,2932,2934],{"class":345,"line":556},[343,2919,2920],{"class":378},"        $this->",[343,2922,2923],{"class":405},"billing",[343,2925,751],{"class":378},[343,2927,2928],{"class":546},"reserveInvoiceNumber",[343,2930,2931],{"class":378},"($",[343,2933,2907],{"class":405},[343,2935,2008],{"class":378},[343,2937,2938],{"class":345,"line":562},[343,2939,668],{"class":378},[343,2941,2942],{"class":345,"line":572},[343,2943,396],{"emptyLinePlaceholder":395},[343,2945,2946,2948,2950,2953,2955,2957,2959,2961,2963,2965,2967,2969,2971],{"class":345,"line":613},[343,2947,540],{"class":518},[343,2949,543],{"class":518},[343,2951,2952],{"class":546}," handleRow",[343,2954,584],{"class":378},[343,2956,461],{"class":349},[343,2958,690],{"class":378},[343,2960,693],{"class":405},[343,2962,632],{"class":378},[343,2964,2902],{"class":349},[343,2966,690],{"class":378},[343,2968,2907],{"class":405},[343,2970,706],{"class":378},[343,2972,709],{"class":371},[343,2974,2975],{"class":345,"line":659},[343,2976,559],{"class":378},[343,2978,2979,2982,2984,2986,2988,2990,2992,2994,2996,2998,3000,3003,3005],{"class":345,"line":665},[343,2980,2981],{"class":378},"        $",[343,2983,2907],{"class":405},[343,2985,751],{"class":378},[343,2987,754],{"class":546},[343,2989,757],{"class":378},[343,2991,587],{"class":378},[343,2993,1091],{"class":353},[343,2995,587],{"class":378},[343,2997,766],{"class":378},[343,2999,779],{"class":378},[343,3001,3002],{"class":353},"invoiced",[343,3004,587],{"class":378},[343,3006,796],{"class":378},[343,3008,3009],{"class":345,"line":671},[343,3010,668],{"class":378},[343,3012,3013],{"class":345,"line":676},[343,3014,813],{"class":378},[898,3016,3017,3020,3028],{},[901,3018,3019],{},"When a row throws, its transaction is rolled back and the run, or the job, stops there. The rows before it stay written.",[901,3021,3022,3023,3025,3026,1202],{},"A deadlock runs the transaction of the row again, ",[325,3024,2606],{}," included, but not ",[325,3027,2747],{},[901,3029,3030,3031,2704,3033,3035,3036,3038,3039,3041,3042,3044,3045,1612,3047,3049,3050,332],{},"An action with ",[325,3032,2874],{},[325,3034,2468],{}," when the actions of the resource are read if it does not declare ",[325,3037,2606],{},", if it declares ",[325,3040,1197],{},", or if its target is ",[325,3043,1350],{},". So does an action that declares ",[325,3046,2606],{},[325,3048,2747],{}," without ",[325,3051,2874],{},[334,3053,3057],{"className":3054,"code":3056,"language":1566,"meta":339},[3055],"language-text","App\\Rest\\Actions\\InvoiceOrders runs each row in its own transaction (ActionTransaction::Row), but it does not declare handleRow(): with Row, each row reaches handleRow(ActionFields $fields, Model $row) instead of handle().\n",[325,3058,3056],{"__ignoreMap":339},[317,3060,3062],{"id":3061},"middleware","Middleware",[313,3064,3065],{},"An action can carry its own route middleware, when the resource declares it or as properties:",[334,3067,3069],{"className":363,"code":3068,"language":350,"meta":339,"style":339},"public function actions(): array\n{\n    return [\n        ExportTickets::make()->middleware('throttle:exports'),\n        ReportOutage::make()->withoutMiddleware('auth:sanctum'),\n    ];\n}\n",[325,3070,3071,3083,3087,3093,3117,3142,3146],{"__ignoreMap":339},[343,3072,3073,3075,3077,3079,3081],{"class":345,"line":346},[343,3074,855],{"class":518},[343,3076,543],{"class":518},[343,3078,860],{"class":546},[343,3080,550],{"class":378},[343,3082,553],{"class":371},[343,3084,3085],{"class":345,"line":392},[343,3086,534],{"class":378},[343,3088,3089,3091],{"class":345,"line":399},[343,3090,873],{"class":565},[343,3092,569],{"class":378},[343,3094,3095,3098,3100,3102,3104,3106,3108,3110,3113,3115],{"class":345,"line":421},[343,3096,3097],{"class":349},"        ExportTickets",[343,3099,578],{"class":378},[343,3101,581],{"class":546},[343,3103,1338],{"class":378},[343,3105,3061],{"class":546},[343,3107,584],{"class":378},[343,3109,587],{"class":378},[343,3111,3112],{"class":353},"throttle:exports",[343,3114,587],{"class":378},[343,3116,610],{"class":378},[343,3118,3119,3122,3124,3126,3128,3131,3133,3135,3138,3140],{"class":345,"line":444},[343,3120,3121],{"class":349},"        ReportOutage",[343,3123,578],{"class":378},[343,3125,581],{"class":546},[343,3127,1338],{"class":378},[343,3129,3130],{"class":546},"withoutMiddleware",[343,3132,584],{"class":378},[343,3134,587],{"class":378},[343,3136,3137],{"class":353},"auth:sanctum",[343,3139,587],{"class":378},[343,3141,610],{"class":378},[343,3143,3144],{"class":345,"line":466},[343,3145,892],{"class":378},[343,3147,3148],{"class":345,"line":488},[343,3149,813],{"class":378},[334,3151,3153],{"className":363,"code":3152,"language":350,"meta":339,"style":339},"class ExportTickets extends Action\n{\n    public array $middleware = ['throttle:exports'];\n}\n",[325,3154,3155,3166,3170,3194],{"__ignoreMap":339},[343,3156,3157,3159,3162,3164],{"class":345,"line":346},[343,3158,519],{"class":518},[343,3160,3161],{"class":349}," ExportTickets",[343,3163,525],{"class":518},[343,3165,528],{"class":349},[343,3167,3168],{"class":345,"line":392},[343,3169,534],{"class":378},[343,3171,3172,3174,3177,3179,3182,3184,3186,3188,3190,3192],{"class":345,"line":399},[343,3173,540],{"class":518},[343,3175,3176],{"class":371}," array",[343,3178,690],{"class":378},[343,3180,3181],{"class":405},"middleware ",[343,3183,1288],{"class":378},[343,3185,1328],{"class":378},[343,3187,587],{"class":378},[343,3189,3112],{"class":353},[343,3191,587],{"class":378},[343,3193,2341],{"class":378},[343,3195,3196],{"class":345,"line":421},[343,3197,813],{"class":378},[313,3199,3200,3201,3204,3205,3208],{},"The route gets the package middleware, the middleware of the resource, the middleware of ",[325,3202,3203],{},"middlewareFor('operate', ...)",", then its own. ",[325,3206,3207],{},"withoutMiddleware()"," removes a middleware of any of these: name it as it is declared, with its parameters.",[317,3210,3212],{"id":3211},"reading-the-request","Reading the request",[313,3214,3215,3216,3219,3220,1179,3223,1608,3226,3228,3229,3231,3232,2447,3234,3236,3237,1186,3240,3243,3244,1202],{},"Once the request passed validation, ",[325,3217,3218],{},"$this->request()->payload()"," returns a ",[325,3221,3222],{},"Lomkit\\Rest\\Actions\\OperationNode",[325,3224,3225],{},"action",[325,3227,693],{}," (the input values as sent) and ",[325,3230,1341],{}," (the parsed search, the keys of ",[325,3233,1379],{},[325,3235,1675],{},"). The resource's ",[325,3238,3239],{},"operating()",[325,3241,3242],{},"operated()"," events run around the chunks, see ",[942,3245,3246],{"href":177},"Events and hooks",[3248,3249,3250],"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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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}",{"title":339,"searchDepth":346,"depth":392,"links":3252},[3253,3254,3255,3258,3259,3260,3261,3264,3267,3268],{"id":319,"depth":392,"text":320},{"id":967,"depth":392,"text":968},{"id":1220,"depth":392,"text":1221,"children":3256},[3257],{"id":1619,"depth":399,"text":1620},{"id":693,"depth":392,"text":42},{"id":1881,"depth":392,"text":1882},{"id":2231,"depth":392,"text":2232},{"id":2271,"depth":392,"text":2272,"children":3262},[3263],{"id":2375,"depth":399,"text":2376},{"id":2494,"depth":392,"text":2495,"children":3265},[3266],{"id":2727,"depth":399,"text":2728},{"id":3061,"depth":392,"text":3062},{"id":3211,"depth":392,"text":3212},"Run your own code on the rows of a resource, with typed inputs, row checks, transactions and a result for the client.","md",null,{},{"title":128,"description":3269},{"loc":129},"RVzGF4p5jDeI0T9f1r-Te2Buz7ceMTgm5ba7zg6Lylo",[3277,3279],{"title":118,"path":119,"stem":120,"description":3278,"children":-1},"Delete, restore and force delete rows by key with destroy, restore and forceDestroy, in one transaction with per-row policy checks.",{"title":132,"path":133,"stem":134,"description":3280,"children":-1},"Run an action in queued jobs, as the user who sent the request, and follow a batch from the client.",1794181348824]