[{"data":1,"prerenderedAt":2475},["ShallowReactive",2],{"navigation":3,"\u002Fsearch\u002Fsorts-and-selects":307,"\u002Fsearch\u002Fsorts-and-selects-surround":2470},{"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":76,"body":309,"description":2463,"extension":2464,"links":2465,"meta":2466,"navigation":482,"path":77,"seo":2467,"sitemap":2468,"stem":78,"__hash__":2469},"docs3x\u002F3.search\u002F3.sorts-and-selects.md",{"type":310,"value":311,"toc":2450},"minimark",[312,339,865,870,989,1054,1122,1127,1133,1168,1172,1198,1259,1314,1318,1327,1452,1476,1479,1539,1565,1568,1572,1585,1659,1666,1670,1745,1954,1999,2003,2008,2111,2162,2166,2169,2188,2229,2310,2314,2385,2446],[313,314,315,316,320,321,324,325,328,329,328,332,320,335,338],"p",{},"A search reads each field through its declaration: ",[317,318,319],"code",{},"sortable()"," and ",[317,322,323],{},"sortUsing()"," decide how a field is sorted, and ",[317,326,327],{},"selectable()",", ",[317,330,331],{},"writeOnly()",[317,333,334],{},"virtual()",[317,336,337],{},"resolveUsing()"," decide what a row can return.",[340,341,347],"pre",{"className":342,"code":343,"filename":344,"language":345,"meta":346,"style":346},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Illuminate\\Contracts\\Database\\Eloquent\\Builder;\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Lomkit\\Rest\\Fields\\ID;\nuse Lomkit\\Rest\\Fields\\Json;\nuse Lomkit\\Rest\\Fields\\Text;\n\npublic function fields(): array\n{\n    return [\n        ID::make('id'),\n        Text::make('first_name'),\n        Text::make('last_name'),\n        Text::make('full_name')\n            ->virtual()\n            ->requires(['first_name', 'last_name'])\n            ->resolveUsing(fn (Model $author): string => $author->first_name.' '.$author->last_name)\n            ->sortUsing(fn (Builder $query, string $direction) => $query\n                ->orderBy('last_name', $direction)\n                ->orderBy('first_name', $direction)),\n        Text::make('api_token')->writeOnly(),\n        Json::make('settings')->nullable(),\n    ];\n}\n","app\u002FRest\u002FResources\u002FAuthorResource.php","php","",[317,348,349,387,409,433,455,477,484,504,510,520,548,569,589,610,622,652,711,751,776,800,827,853,859],{"__ignoreMap":346},[350,351,354,358,362,366,369,371,374,376,379,381,384],"span",{"class":352,"line":353},"line",1,[350,355,357],{"class":356},"sbssI","use",[350,359,361],{"class":360},"sTEyZ"," Illuminate",[350,363,365],{"class":364},"sMK4o","\\",[350,367,368],{"class":360},"Contracts",[350,370,365],{"class":364},[350,372,373],{"class":360},"Database",[350,375,365],{"class":364},[350,377,378],{"class":360},"Eloquent",[350,380,365],{"class":364},[350,382,383],{"class":360},"Builder",[350,385,386],{"class":364},";\n",[350,388,390,392,394,396,398,400,402,404,407],{"class":352,"line":389},2,[350,391,357],{"class":356},[350,393,361],{"class":360},[350,395,365],{"class":364},[350,397,373],{"class":360},[350,399,365],{"class":364},[350,401,378],{"class":360},[350,403,365],{"class":364},[350,405,406],{"class":360},"Model",[350,408,386],{"class":364},[350,410,412,414,417,419,422,424,426,428,431],{"class":352,"line":411},3,[350,413,357],{"class":356},[350,415,416],{"class":360}," Lomkit",[350,418,365],{"class":364},[350,420,421],{"class":360},"Rest",[350,423,365],{"class":364},[350,425,42],{"class":360},[350,427,365],{"class":364},[350,429,430],{"class":360},"ID",[350,432,386],{"class":364},[350,434,436,438,440,442,444,446,448,450,453],{"class":352,"line":435},4,[350,437,357],{"class":356},[350,439,416],{"class":360},[350,441,365],{"class":364},[350,443,421],{"class":360},[350,445,365],{"class":364},[350,447,42],{"class":360},[350,449,365],{"class":364},[350,451,452],{"class":360},"Json",[350,454,386],{"class":364},[350,456,458,460,462,464,466,468,470,472,475],{"class":352,"line":457},5,[350,459,357],{"class":356},[350,461,416],{"class":360},[350,463,365],{"class":364},[350,465,421],{"class":360},[350,467,365],{"class":364},[350,469,42],{"class":360},[350,471,365],{"class":364},[350,473,474],{"class":360},"Text",[350,476,386],{"class":364},[350,478,480],{"class":352,"line":479},6,[350,481,483],{"emptyLinePlaceholder":482},true,"\n",[350,485,487,491,494,498,501],{"class":352,"line":486},7,[350,488,490],{"class":489},"spNyl","public",[350,492,493],{"class":489}," function",[350,495,497],{"class":496},"s2Zo4"," fields",[350,499,500],{"class":364},"():",[350,502,503],{"class":356}," array\n",[350,505,507],{"class":352,"line":506},8,[350,508,509],{"class":364},"{\n",[350,511,513,517],{"class":352,"line":512},9,[350,514,516],{"class":515},"s7zQu","    return",[350,518,519],{"class":364}," [\n",[350,521,523,527,530,533,536,539,543,545],{"class":352,"line":522},10,[350,524,526],{"class":525},"sBMFI","        ID",[350,528,529],{"class":364},"::",[350,531,532],{"class":496},"make",[350,534,535],{"class":364},"(",[350,537,538],{"class":364},"'",[350,540,542],{"class":541},"sfazB","id",[350,544,538],{"class":364},[350,546,547],{"class":364},"),\n",[350,549,551,554,556,558,560,562,565,567],{"class":352,"line":550},11,[350,552,553],{"class":525},"        Text",[350,555,529],{"class":364},[350,557,532],{"class":496},[350,559,535],{"class":364},[350,561,538],{"class":364},[350,563,564],{"class":541},"first_name",[350,566,538],{"class":364},[350,568,547],{"class":364},[350,570,572,574,576,578,580,582,585,587],{"class":352,"line":571},12,[350,573,553],{"class":525},[350,575,529],{"class":364},[350,577,532],{"class":496},[350,579,535],{"class":364},[350,581,538],{"class":364},[350,583,584],{"class":541},"last_name",[350,586,538],{"class":364},[350,588,547],{"class":364},[350,590,592,594,596,598,600,602,605,607],{"class":352,"line":591},13,[350,593,553],{"class":525},[350,595,529],{"class":364},[350,597,532],{"class":496},[350,599,535],{"class":364},[350,601,538],{"class":364},[350,603,604],{"class":541},"full_name",[350,606,538],{"class":364},[350,608,609],{"class":364},")\n",[350,611,613,616,619],{"class":352,"line":612},14,[350,614,615],{"class":364},"            ->",[350,617,618],{"class":496},"virtual",[350,620,621],{"class":364},"()\n",[350,623,625,627,630,633,635,637,639,642,645,647,649],{"class":352,"line":624},15,[350,626,615],{"class":364},[350,628,629],{"class":496},"requires",[350,631,632],{"class":364},"([",[350,634,538],{"class":364},[350,636,564],{"class":541},[350,638,538],{"class":364},[350,640,641],{"class":364},",",[350,643,644],{"class":364}," '",[350,646,584],{"class":541},[350,648,538],{"class":364},[350,650,651],{"class":364},"])\n",[350,653,655,657,660,662,665,668,670,673,676,679,682,685,687,689,692,694,697,700,703,705,707,709],{"class":352,"line":654},16,[350,656,615],{"class":364},[350,658,659],{"class":496},"resolveUsing",[350,661,535],{"class":364},[350,663,664],{"class":489},"fn",[350,666,667],{"class":364}," (",[350,669,406],{"class":525},[350,671,672],{"class":364}," $",[350,674,675],{"class":360},"author",[350,677,678],{"class":364},"):",[350,680,681],{"class":356}," string",[350,683,684],{"class":364}," =>",[350,686,672],{"class":364},[350,688,675],{"class":360},[350,690,691],{"class":364},"->",[350,693,564],{"class":360},[350,695,696],{"class":364},".'",[350,698,699],{"class":364}," '.",[350,701,702],{"class":364},"$",[350,704,675],{"class":360},[350,706,691],{"class":364},[350,708,584],{"class":360},[350,710,609],{"class":364},[350,712,714,716,719,721,723,725,727,729,732,734,736,738,741,744,746,748],{"class":352,"line":713},17,[350,715,615],{"class":364},[350,717,718],{"class":496},"sortUsing",[350,720,535],{"class":364},[350,722,664],{"class":489},[350,724,667],{"class":364},[350,726,383],{"class":525},[350,728,672],{"class":364},[350,730,731],{"class":360},"query",[350,733,641],{"class":364},[350,735,681],{"class":356},[350,737,672],{"class":364},[350,739,740],{"class":360},"direction",[350,742,743],{"class":364},")",[350,745,684],{"class":364},[350,747,672],{"class":364},[350,749,750],{"class":360},"query\n",[350,752,754,757,760,762,764,766,768,770,772,774],{"class":352,"line":753},18,[350,755,756],{"class":364},"                ->",[350,758,759],{"class":496},"orderBy",[350,761,535],{"class":364},[350,763,538],{"class":364},[350,765,584],{"class":541},[350,767,538],{"class":364},[350,769,641],{"class":364},[350,771,672],{"class":364},[350,773,740],{"class":360},[350,775,609],{"class":364},[350,777,779,781,783,785,787,789,791,793,795,797],{"class":352,"line":778},19,[350,780,756],{"class":364},[350,782,759],{"class":496},[350,784,535],{"class":364},[350,786,538],{"class":364},[350,788,564],{"class":541},[350,790,538],{"class":364},[350,792,641],{"class":364},[350,794,672],{"class":364},[350,796,740],{"class":360},[350,798,799],{"class":364},")),\n",[350,801,803,805,807,809,811,813,816,818,821,824],{"class":352,"line":802},20,[350,804,553],{"class":525},[350,806,529],{"class":364},[350,808,532],{"class":496},[350,810,535],{"class":364},[350,812,538],{"class":364},[350,814,815],{"class":541},"api_token",[350,817,538],{"class":364},[350,819,820],{"class":364},")->",[350,822,823],{"class":496},"writeOnly",[350,825,826],{"class":364},"(),\n",[350,828,830,833,835,837,839,841,844,846,848,851],{"class":352,"line":829},21,[350,831,832],{"class":525},"        Json",[350,834,529],{"class":364},[350,836,532],{"class":496},[350,838,535],{"class":364},[350,840,538],{"class":364},[350,842,843],{"class":541},"settings",[350,845,538],{"class":364},[350,847,820],{"class":364},[350,849,850],{"class":496},"nullable",[350,852,826],{"class":364},[350,854,856],{"class":352,"line":855},22,[350,857,858],{"class":364},"    ];\n",[350,860,862],{"class":352,"line":861},23,[350,863,864],{"class":364},"}\n",[866,867,869],"h2",{"id":868},"sorts","Sorts",[340,871,876],{"className":872,"code":873,"filename":874,"language":875,"meta":346,"style":346},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"search\": {\n    \"sorts\": [\n      {\"field\": \"price\", \"direction\": \"desc\"},\n      {\"field\": \"name\"}\n    ]\n  }\n}\n","POST \u002Fapi\u002Fproducts\u002Fsearch","json",[317,877,878,882,899,912,954,975,980,985],{"__ignoreMap":346},[350,879,880],{"class":352,"line":353},[350,881,509],{"class":364},[350,883,884,887,890,893,896],{"class":352,"line":389},[350,885,886],{"class":364},"  \"",[350,888,889],{"class":489},"search",[350,891,892],{"class":364},"\"",[350,894,895],{"class":364},":",[350,897,898],{"class":364}," {\n",[350,900,901,904,906,908,910],{"class":352,"line":411},[350,902,903],{"class":364},"    \"",[350,905,868],{"class":525},[350,907,892],{"class":364},[350,909,895],{"class":364},[350,911,519],{"class":364},[350,913,914,917,919,922,924,926,929,932,934,936,938,940,942,944,946,949,951],{"class":352,"line":435},[350,915,916],{"class":364},"      {",[350,918,892],{"class":364},[350,920,921],{"class":356},"field",[350,923,892],{"class":364},[350,925,895],{"class":364},[350,927,928],{"class":364}," \"",[350,930,931],{"class":541},"price",[350,933,892],{"class":364},[350,935,641],{"class":364},[350,937,928],{"class":364},[350,939,740],{"class":356},[350,941,892],{"class":364},[350,943,895],{"class":364},[350,945,928],{"class":364},[350,947,948],{"class":541},"desc",[350,950,892],{"class":364},[350,952,953],{"class":364},"},\n",[350,955,956,958,960,962,964,966,968,971,973],{"class":352,"line":457},[350,957,916],{"class":364},[350,959,892],{"class":364},[350,961,921],{"class":356},[350,963,892],{"class":364},[350,965,895],{"class":364},[350,967,928],{"class":364},[350,969,970],{"class":541},"name",[350,972,892],{"class":364},[350,974,864],{"class":364},[350,976,977],{"class":352,"line":479},[350,978,979],{"class":364},"    ]\n",[350,981,982],{"class":352,"line":486},[350,983,984],{"class":364},"  }\n",[350,986,987],{"class":352,"line":506},[350,988,864],{"class":364},[990,991,992,1011,1018,1032,1042],"ul",{},[993,994,995,996,998,999,1002,1003,328,1005,1007,1008],"li",{},"Sorts apply in their order. ",[317,997,740],{}," is ",[317,1000,1001],{},"asc"," or ",[317,1004,948],{},[317,1006,1001],{}," when omitted. Another value gives ",[317,1009,1010],{},"The selected search.sorts.0.direction is invalid.",[993,1012,1013,1014,1017],{},"A field is ordered by its column, qualified with the table of the model: ",[317,1015,1016],{},"products.price",".",[993,1019,1020,1021,1023,1024,1002,1026,1028,1029,1031],{},"A field with ",[317,1022,323],{}," is ordered by its callback, which receives the Eloquent query, also on an include, and the direction. A ",[317,1025,334],{},[317,1027,331],{}," field with ",[317,1030,323],{}," is sortable.",[993,1033,1034,1035,1037,1038,1041],{},"Without ",[317,1036,868],{},", the rows follow ",[317,1039,1040],{},"defaultOrderBy()",", the key of the model in descending order by default.",[993,1043,1044,1045,1048,1049,1051,1052,1017],{},"Every SQL order ends with the key of the model, in descending order, unless it already holds it, so that rows with equal values keep one order across pages and within the ",[317,1046,1047],{},"limit"," of an include. To order ties by another column, add it to ",[317,1050,868],{}," or to ",[317,1053,1040],{},[340,1055,1057],{"className":342,"code":1056,"language":345,"meta":346,"style":346},"public function defaultOrderBy(): array\n{\n    return ['published_on' => 'desc', 'title' => 'asc'];\n}\n",[317,1058,1059,1072,1076,1118],{"__ignoreMap":346},[350,1060,1061,1063,1065,1068,1070],{"class":352,"line":353},[350,1062,490],{"class":489},[350,1064,493],{"class":489},[350,1066,1067],{"class":496}," defaultOrderBy",[350,1069,500],{"class":364},[350,1071,503],{"class":356},[350,1073,1074],{"class":352,"line":389},[350,1075,509],{"class":364},[350,1077,1078,1080,1083,1085,1088,1090,1092,1094,1096,1098,1100,1102,1105,1107,1109,1111,1113,1115],{"class":352,"line":411},[350,1079,516],{"class":515},[350,1081,1082],{"class":364}," [",[350,1084,538],{"class":364},[350,1086,1087],{"class":541},"published_on",[350,1089,538],{"class":364},[350,1091,684],{"class":364},[350,1093,644],{"class":364},[350,1095,948],{"class":541},[350,1097,538],{"class":364},[350,1099,641],{"class":364},[350,1101,644],{"class":364},[350,1103,1104],{"class":541},"title",[350,1106,538],{"class":364},[350,1108,684],{"class":364},[350,1110,644],{"class":364},[350,1112,1001],{"class":541},[350,1114,538],{"class":364},[350,1116,1117],{"class":364},"];\n",[350,1119,1120],{"class":352,"line":435},[350,1121,864],{"class":364},[1123,1124,1126],"h3",{"id":1125},"fields-that-sorts-refuse","Fields that sorts refuse",[313,1128,1129,1130,895],{},"These fields give ",[317,1131,1132],{},"The selected search.sorts.0.field is invalid.",[990,1134,1135,1138,1144,1151,1160],{},[993,1136,1137],{},"an undeclared field;",[993,1139,1140,1141,1143],{},"a ",[317,1142,452],{}," field;",[993,1145,1146,1147,1150],{},"a field declared ",[317,1148,1149],{},"sortable(false)",";",[993,1152,1140,1153,1002,1155,1157,1158,1150],{},[317,1154,334],{},[317,1156,331],{}," field without ",[317,1159,323],{},[993,1161,1146,1162,1165,1166,1017],{},[317,1163,1164],{},"selectable(false)"," without ",[317,1167,319],{},[1123,1169,1171],{"id":1170},"sort-on-a-related-field","Sort on a related field",[313,1173,1174,1175,1178,1179,328,1182,328,1185,328,1188,328,1191,1002,1194,1197],{},"A sort can name a field of a to-one relation, ",[317,1176,1177],{},"\u003Crelation>.\u003Cfield>",": a ",[317,1180,1181],{},"BelongsTo",[317,1183,1184],{},"HasOne",[317,1186,1187],{},"HasOneThrough",[317,1189,1190],{},"HasOneOfMany",[317,1192,1193],{},"MorphOne",[317,1195,1196],{},"MorphOneOfMany"," relation.",[340,1199,1202],{"className":872,"code":1200,"filename":1201,"language":875,"meta":346,"style":346},"{\n  \"search\": {\n    \"sorts\": [{\"field\": \"author.last_name\"}]\n  }\n}\n","POST \u002Fapi\u002Fposts\u002Fsearch",[317,1203,1204,1208,1220,1251,1255],{"__ignoreMap":346},[350,1205,1206],{"class":352,"line":353},[350,1207,509],{"class":364},[350,1209,1210,1212,1214,1216,1218],{"class":352,"line":389},[350,1211,886],{"class":364},[350,1213,889],{"class":489},[350,1215,892],{"class":364},[350,1217,895],{"class":364},[350,1219,898],{"class":364},[350,1221,1222,1224,1226,1228,1230,1233,1235,1237,1239,1241,1243,1246,1248],{"class":352,"line":411},[350,1223,903],{"class":364},[350,1225,868],{"class":525},[350,1227,892],{"class":364},[350,1229,895],{"class":364},[350,1231,1232],{"class":364}," [{",[350,1234,892],{"class":364},[350,1236,921],{"class":356},[350,1238,892],{"class":364},[350,1240,895],{"class":364},[350,1242,928],{"class":364},[350,1244,1245],{"class":541},"author.last_name",[350,1247,892],{"class":364},[350,1249,1250],{"class":364},"}]\n",[350,1252,1253],{"class":352,"line":435},[350,1254,984],{"class":364},[350,1256,1257],{"class":352,"line":457},[350,1258,864],{"class":364},[990,1260,1261,1268,1271,1287,1300],{},[993,1262,1263,1264,1267],{},"The query orders by a subquery that reads the greatest value of the field among the related rows. That subquery applies the ",[317,1265,1266],{},"perimeterQuery()"," of the related resource and the global scopes of its model.",[993,1269,1270],{},"A missing related row, a soft-deleted one, or one outside the perimeter sorts as a null value. The database places null values as it does for a column: first in ascending order and last in descending order on SQLite and MySQL, the other way round on PostgreSQL.",[993,1272,1273,1274,1277,1278,1280,1281,1283,1284,1017],{},"The field must be one that ",[317,1275,1276],{},"max"," accepts in an aggregate: sortable by its own column, neither ",[317,1279,334],{}," nor ",[317,1282,331],{},", and not a ",[317,1285,1286],{},"Boolean",[993,1288,1289,1290,1293,1294,1297,1298],{},"A ",[317,1291,1292],{},"MorphTo"," relation, a relation with several rows, a deeper path such as ",[317,1295,1296],{},"author.posts.title"," and any other field give ",[317,1299,1132],{},[993,1301,1302,1303,1306,1307,1310,1311,1017],{},"The related resource needs ",[317,1304,1305],{},"viewAny",", checked before validation: a denial answers ",[317,1308,1309],{},"403"," under ",[317,1312,1313],{},"search.sorts.0",[1123,1315,1317],{"id":1316},"sort-on-an-aggregate","Sort on an aggregate",[313,1319,1320,1321,1002,1324,895],{},"A sort can name the key of an aggregate of the same search, its ",[317,1322,1323],{},"alias",[317,1325,1326],{},"\u003Crelation>_\u003Ctype>_\u003Cfield>",[340,1328,1331],{"className":872,"code":1329,"filename":1330,"language":875,"meta":346,"style":346},"{\n  \"search\": {\n    \"aggregates\": [{\"relation\": \"posts\", \"type\": \"count\"}],\n    \"sorts\": [{\"field\": \"posts_count\", \"direction\": \"desc\"}]\n  }\n}\n","POST \u002Fapi\u002Fauthors\u002Fsearch",[317,1332,1333,1337,1349,1399,1444,1448],{"__ignoreMap":346},[350,1334,1335],{"class":352,"line":353},[350,1336,509],{"class":364},[350,1338,1339,1341,1343,1345,1347],{"class":352,"line":389},[350,1340,886],{"class":364},[350,1342,889],{"class":489},[350,1344,892],{"class":364},[350,1346,895],{"class":364},[350,1348,898],{"class":364},[350,1350,1351,1353,1356,1358,1360,1362,1364,1367,1369,1371,1373,1376,1378,1380,1382,1385,1387,1389,1391,1394,1396],{"class":352,"line":411},[350,1352,903],{"class":364},[350,1354,1355],{"class":525},"aggregates",[350,1357,892],{"class":364},[350,1359,895],{"class":364},[350,1361,1232],{"class":364},[350,1363,892],{"class":364},[350,1365,1366],{"class":356},"relation",[350,1368,892],{"class":364},[350,1370,895],{"class":364},[350,1372,928],{"class":364},[350,1374,1375],{"class":541},"posts",[350,1377,892],{"class":364},[350,1379,641],{"class":364},[350,1381,928],{"class":364},[350,1383,1384],{"class":356},"type",[350,1386,892],{"class":364},[350,1388,895],{"class":364},[350,1390,928],{"class":364},[350,1392,1393],{"class":541},"count",[350,1395,892],{"class":364},[350,1397,1398],{"class":364},"}],\n",[350,1400,1401,1403,1405,1407,1409,1411,1413,1415,1417,1419,1421,1424,1426,1428,1430,1432,1434,1436,1438,1440,1442],{"class":352,"line":435},[350,1402,903],{"class":364},[350,1404,868],{"class":525},[350,1406,892],{"class":364},[350,1408,895],{"class":364},[350,1410,1232],{"class":364},[350,1412,892],{"class":364},[350,1414,921],{"class":356},[350,1416,892],{"class":364},[350,1418,895],{"class":364},[350,1420,928],{"class":364},[350,1422,1423],{"class":541},"posts_count",[350,1425,892],{"class":364},[350,1427,641],{"class":364},[350,1429,928],{"class":364},[350,1431,740],{"class":356},[350,1433,892],{"class":364},[350,1435,895],{"class":364},[350,1437,928],{"class":364},[350,1439,948],{"class":541},[350,1441,892],{"class":364},[350,1443,1250],{"class":364},[350,1445,1446],{"class":352,"line":457},[350,1447,984],{"class":364},[350,1449,1450],{"class":352,"line":479},[350,1451,864],{"class":364},[990,1453,1454,1457,1471],{},[993,1455,1456],{},"The query orders by the subquery of the aggregate, which runs a second time for the order.",[993,1458,1289,1459,328,1462,328,1464,1002,1467,1470],{},[317,1460,1461],{},"min",[317,1463,1276],{},[317,1465,1466],{},"avg",[317,1468,1469],{},"sum"," without a related row is a null value.",[993,1472,1473,1474],{},"The key of an aggregate that the same level does not request, such as an aggregate of an include, gives ",[317,1475,1132],{},[313,1477,1478],{},"Only an aggregate over a relation to many sorts, with no field or on a field that is not a key:",[1480,1481,1482,1495],"table",{},[1483,1484,1485],"thead",{},[1486,1487,1488,1492],"tr",{},[1489,1490,1491],"th",{},"Function",[1489,1493,1494],{},"Sorts on",[1496,1497,1498,1511,1522],"tbody",{},[1486,1499,1500,1508],{},[1501,1502,1503,328,1505],"td",{},[317,1504,1393],{},[317,1506,1507],{},"exists",[1501,1509,1510],{},"a relation to many",[1486,1512,1513,1519],{},[1501,1514,1515,328,1517],{},[317,1516,1461],{},[317,1518,1276],{},[1501,1520,1521],{},"a field of a relation to many that is not a key",[1486,1523,1524,1530],{},[1501,1525,1526,328,1528],{},[317,1527,1466],{},[317,1529,1469],{},[1501,1531,1140,1532,1002,1535,1538],{},[317,1533,1534],{},"Number",[317,1536,1537],{},"Integer"," field of a relation to many that is not a key",[313,1540,1541,1542,1544,1545,1547,1548,1551,1552,1554,1555,1002,1558,1561,1562,1564],{},"A key is the key of the related model, an ",[317,1543,430],{}," field, or a column that relates rows, such as the foreign key of the relation or of a relation of the related resource. The key of another aggregate, its ",[317,1546,1323],{}," included, gives the same 422: ",[317,1549,1550],{},"author_count"," on a ",[317,1553,1181],{}," relation, ",[317,1556,1557],{},"comments_max_id",[317,1559,1560],{},"comments_sum_show_id",". The aggregate itself is still accepted in ",[317,1563,1355],{},", and its value is returned in each row.",[313,1566,1567],{},"These sorts work at every level that accepts sorts, and each one adds a subquery: index the columns that relate the rows.",[1123,1569,1571],{"id":1570},"relevance","Relevance",[313,1573,1574,1575,1578,1579,1581,1582,1584],{},"With a text search whose strategy orders by relevance, ",[317,1576,1577],{},"@relevance"," places the relevance among the other sorts, ",[317,1580,948],{}," when ",[317,1583,740],{}," is omitted:",[340,1586,1588],{"className":872,"code":1587,"language":875,"meta":346,"style":346},"{\"sorts\": [{\"field\": \"featured\", \"direction\": \"desc\"}, {\"field\": \"@relevance\"}]}\n",[317,1589,1590],{"__ignoreMap":346},[350,1591,1592,1595,1597,1599,1601,1603,1605,1607,1609,1611,1613,1615,1618,1620,1622,1624,1626,1628,1630,1632,1634,1636,1639,1642,1644,1646,1648,1650,1652,1654,1656],{"class":352,"line":353},[350,1593,1594],{"class":364},"{",[350,1596,892],{"class":364},[350,1598,868],{"class":489},[350,1600,892],{"class":364},[350,1602,895],{"class":364},[350,1604,1232],{"class":364},[350,1606,892],{"class":364},[350,1608,921],{"class":525},[350,1610,892],{"class":364},[350,1612,895],{"class":364},[350,1614,928],{"class":364},[350,1616,1617],{"class":541},"featured",[350,1619,892],{"class":364},[350,1621,641],{"class":364},[350,1623,928],{"class":364},[350,1625,740],{"class":525},[350,1627,892],{"class":364},[350,1629,895],{"class":364},[350,1631,928],{"class":364},[350,1633,948],{"class":541},[350,1635,892],{"class":364},[350,1637,1638],{"class":364},"},",[350,1640,1641],{"class":364}," {",[350,1643,892],{"class":364},[350,1645,921],{"class":525},[350,1647,892],{"class":364},[350,1649,895],{"class":364},[350,1651,928],{"class":364},[350,1653,1577],{"class":541},[350,1655,892],{"class":364},[350,1657,1658],{"class":364},"}]}\n",[313,1660,1661,1662,1017],{},"See ",[1663,1664,88],"a",{"href":1665},"\u002Fsearch\u002Ftext-search#relevance",[866,1667,1669],{"id":1668},"selects","Selects",[340,1671,1673],{"className":872,"code":1672,"filename":874,"language":875,"meta":346,"style":346},"{\n  \"search\": {\n    \"selects\": [{\"field\": \"name\"}, {\"field\": \"price\"}]\n  }\n}\n",[317,1674,1675,1679,1691,1737,1741],{"__ignoreMap":346},[350,1676,1677],{"class":352,"line":353},[350,1678,509],{"class":364},[350,1680,1681,1683,1685,1687,1689],{"class":352,"line":389},[350,1682,886],{"class":364},[350,1684,889],{"class":489},[350,1686,892],{"class":364},[350,1688,895],{"class":364},[350,1690,898],{"class":364},[350,1692,1693,1695,1697,1699,1701,1703,1705,1707,1709,1711,1713,1715,1717,1719,1721,1723,1725,1727,1729,1731,1733,1735],{"class":352,"line":411},[350,1694,903],{"class":364},[350,1696,1668],{"class":525},[350,1698,892],{"class":364},[350,1700,895],{"class":364},[350,1702,1232],{"class":364},[350,1704,892],{"class":364},[350,1706,921],{"class":356},[350,1708,892],{"class":364},[350,1710,895],{"class":364},[350,1712,928],{"class":364},[350,1714,970],{"class":541},[350,1716,892],{"class":364},[350,1718,1638],{"class":364},[350,1720,1641],{"class":364},[350,1722,892],{"class":364},[350,1724,921],{"class":356},[350,1726,892],{"class":364},[350,1728,895],{"class":364},[350,1730,928],{"class":364},[350,1732,931],{"class":541},[350,1734,892],{"class":364},[350,1736,1250],{"class":364},[350,1738,1739],{"class":352,"line":435},[350,1740,984],{"class":364},[350,1742,1743],{"class":352,"line":457},[350,1744,864],{"class":364},[340,1746,1749],{"className":872,"code":1747,"filename":1748,"language":875,"meta":346,"style":346},"{\n  \"current_page\": 1,\n  \"data\": [\n    {\"name\": \"Floor lamp\", \"price\": 129},\n    {\"name\": \"Desk lamp\", \"price\": 39}\n  ],\n  \"from\": 1,\n  \"last_page\": 1,\n  \"per_page\": 50,\n  \"to\": 2,\n  \"total\": 2,\n  \"meta\": {}\n}\n","200 OK",[317,1750,1751,1755,1772,1785,1820,1854,1859,1874,1889,1905,1921,1936,1950],{"__ignoreMap":346},[350,1752,1753],{"class":352,"line":353},[350,1754,509],{"class":364},[350,1756,1757,1759,1762,1764,1766,1769],{"class":352,"line":389},[350,1758,886],{"class":364},[350,1760,1761],{"class":489},"current_page",[350,1763,892],{"class":364},[350,1765,895],{"class":364},[350,1767,1768],{"class":356}," 1",[350,1770,1771],{"class":364},",\n",[350,1773,1774,1776,1779,1781,1783],{"class":352,"line":411},[350,1775,886],{"class":364},[350,1777,1778],{"class":489},"data",[350,1780,892],{"class":364},[350,1782,895],{"class":364},[350,1784,519],{"class":364},[350,1786,1787,1790,1792,1794,1796,1798,1800,1803,1805,1807,1809,1811,1813,1815,1818],{"class":352,"line":435},[350,1788,1789],{"class":364},"    {",[350,1791,892],{"class":364},[350,1793,970],{"class":525},[350,1795,892],{"class":364},[350,1797,895],{"class":364},[350,1799,928],{"class":364},[350,1801,1802],{"class":541},"Floor lamp",[350,1804,892],{"class":364},[350,1806,641],{"class":364},[350,1808,928],{"class":364},[350,1810,931],{"class":525},[350,1812,892],{"class":364},[350,1814,895],{"class":364},[350,1816,1817],{"class":356}," 129",[350,1819,953],{"class":364},[350,1821,1822,1824,1826,1828,1830,1832,1834,1837,1839,1841,1843,1845,1847,1849,1852],{"class":352,"line":457},[350,1823,1789],{"class":364},[350,1825,892],{"class":364},[350,1827,970],{"class":525},[350,1829,892],{"class":364},[350,1831,895],{"class":364},[350,1833,928],{"class":364},[350,1835,1836],{"class":541},"Desk lamp",[350,1838,892],{"class":364},[350,1840,641],{"class":364},[350,1842,928],{"class":364},[350,1844,931],{"class":525},[350,1846,892],{"class":364},[350,1848,895],{"class":364},[350,1850,1851],{"class":356}," 39",[350,1853,864],{"class":364},[350,1855,1856],{"class":352,"line":479},[350,1857,1858],{"class":364},"  ],\n",[350,1860,1861,1863,1866,1868,1870,1872],{"class":352,"line":486},[350,1862,886],{"class":364},[350,1864,1865],{"class":489},"from",[350,1867,892],{"class":364},[350,1869,895],{"class":364},[350,1871,1768],{"class":356},[350,1873,1771],{"class":364},[350,1875,1876,1878,1881,1883,1885,1887],{"class":352,"line":506},[350,1877,886],{"class":364},[350,1879,1880],{"class":489},"last_page",[350,1882,892],{"class":364},[350,1884,895],{"class":364},[350,1886,1768],{"class":356},[350,1888,1771],{"class":364},[350,1890,1891,1893,1896,1898,1900,1903],{"class":352,"line":512},[350,1892,886],{"class":364},[350,1894,1895],{"class":489},"per_page",[350,1897,892],{"class":364},[350,1899,895],{"class":364},[350,1901,1902],{"class":356}," 50",[350,1904,1771],{"class":364},[350,1906,1907,1909,1912,1914,1916,1919],{"class":352,"line":522},[350,1908,886],{"class":364},[350,1910,1911],{"class":489},"to",[350,1913,892],{"class":364},[350,1915,895],{"class":364},[350,1917,1918],{"class":356}," 2",[350,1920,1771],{"class":364},[350,1922,1923,1925,1928,1930,1932,1934],{"class":352,"line":550},[350,1924,886],{"class":364},[350,1926,1927],{"class":489},"total",[350,1929,892],{"class":364},[350,1931,895],{"class":364},[350,1933,1918],{"class":356},[350,1935,1771],{"class":364},[350,1937,1938,1940,1943,1945,1947],{"class":352,"line":571},[350,1939,886],{"class":364},[350,1941,1942],{"class":489},"meta",[350,1944,892],{"class":364},[350,1946,895],{"class":364},[350,1948,1949],{"class":364}," {}\n",[350,1951,1952],{"class":352,"line":591},[350,1953,864],{"class":364},[990,1955,1956,1961,1970,1976,1994],{},[993,1957,1958,1960],{},[317,1959,1668],{}," lists the fields that each row returns, in this order.",[993,1962,1034,1963,1965,1966,1969],{},[317,1964,1668],{},", a row holds every selectable field of its resource, in the order of ",[317,1967,1968],{},"fields()",", at every level of the includes.",[993,1971,1972,1973,1975],{},"The ",[317,1974,1668],{}," of an include are checked against the fields of the related resource.",[993,1977,1978,1980,1981,1002,1983,1985,1986,1157,1988,1990,1991],{},[317,1979,1668],{}," accepts the selectable fields only. A field declared ",[317,1982,331],{},[317,1984,1164],{},", a ",[317,1987,334],{},[317,1989,337],{}," and an undeclared field give ",[317,1992,1993],{},"The selected search.selects.0.field is invalid.",[993,1995,1289,1996,1998],{},[317,1997,331],{}," field is never returned, by any endpoint.",[1123,2000,2002],{"id":2001},"computed-values","Computed values",[313,2004,2005,2007],{},[317,2006,337],{}," gives a field its value in a row. The callback receives the model of the row, and the response sends what it returns.",[340,2009,2011],{"className":342,"code":2010,"language":345,"meta":346,"style":346},"Text::make('display_name')\n    ->virtual()\n    ->requires(['first_name', 'last_name'])\n    ->resolveUsing(fn (Model $author): string => $author->first_name.' '.$author->last_name),\n",[317,2012,2013,2032,2041,2065],{"__ignoreMap":346},[350,2014,2015,2017,2019,2021,2023,2025,2028,2030],{"class":352,"line":353},[350,2016,474],{"class":525},[350,2018,529],{"class":364},[350,2020,532],{"class":496},[350,2022,535],{"class":364},[350,2024,538],{"class":364},[350,2026,2027],{"class":541},"display_name",[350,2029,538],{"class":364},[350,2031,609],{"class":364},[350,2033,2034,2037,2039],{"class":352,"line":389},[350,2035,2036],{"class":364},"    ->",[350,2038,618],{"class":496},[350,2040,621],{"class":364},[350,2042,2043,2045,2047,2049,2051,2053,2055,2057,2059,2061,2063],{"class":352,"line":411},[350,2044,2036],{"class":364},[350,2046,629],{"class":496},[350,2048,632],{"class":364},[350,2050,538],{"class":364},[350,2052,564],{"class":541},[350,2054,538],{"class":364},[350,2056,641],{"class":364},[350,2058,644],{"class":364},[350,2060,584],{"class":541},[350,2062,538],{"class":364},[350,2064,651],{"class":364},[350,2066,2067,2069,2071,2073,2075,2077,2079,2081,2083,2085,2087,2089,2091,2093,2095,2097,2099,2101,2103,2105,2107,2109],{"class":352,"line":435},[350,2068,2036],{"class":364},[350,2070,659],{"class":496},[350,2072,535],{"class":364},[350,2074,664],{"class":489},[350,2076,667],{"class":364},[350,2078,406],{"class":525},[350,2080,672],{"class":364},[350,2082,675],{"class":360},[350,2084,678],{"class":364},[350,2086,681],{"class":356},[350,2088,684],{"class":364},[350,2090,672],{"class":364},[350,2092,675],{"class":360},[350,2094,691],{"class":364},[350,2096,564],{"class":360},[350,2098,696],{"class":364},[350,2100,699],{"class":364},[350,2102,702],{"class":364},[350,2104,675],{"class":360},[350,2106,691],{"class":364},[350,2108,584],{"class":360},[350,2110,547],{"class":364},[990,2112,2113,2126,2132,2135,2138,2144,2152],{},[993,2114,1289,2115,1028,2117,2119,2120,2122,2123,2125],{},[317,2116,334],{},[317,2118,337],{}," is selectable: ",[317,2121,1668],{}," accepts it, and a row without ",[317,2124,1668],{}," returns it.",[993,2127,2128,2129,2131],{},"A field that is not virtual can declare ",[317,2130,337],{}," too: the callback then gives its value instead of the column.",[993,2133,2134],{},"In a row, the values of the callbacks come after the columns and the aggregates.",[993,2136,2137],{},"The callback runs once per returned row, so a query inside it runs once per row.",[993,2139,2140,2143],{},[317,2141,2142],{},"requires()"," lists the columns that the callback reads: they load when the field is returned.",[993,2145,2146,2147,320,2149,1017],{},"A virtual field is still sorted and filtered only through ",[317,2148,323],{},[317,2150,2151],{},"filterUsing()",[993,2153,2154,2155,2158,2159,2161],{},"The appended attributes of a model (",[317,2156,2157],{},"$appends",") are not evaluated on the rows of a response: return an appended value through a field whose ",[317,2160,337],{}," reads it.",[866,2163,2165],{"id":2164},"loaded-columns","Loaded columns",[313,2167,2168],{},"A search loads only the columns that its rows need, at every level:",[990,2170,2171,2174,2179,2185],{},[993,2172,2173],{},"the columns of the returned fields and the key of the model;",[993,2175,2176,2177,1150],{},"the columns that a returned field lists in ",[317,2178,2142],{},[993,2180,2181,2182,1150],{},"the columns that the resource lists in ",[317,2183,2184],{},"alwaysSelect()",[993,2186,2187],{},"the keys that its includes need, on the parent row and on the related rows.",[340,2189,2191],{"className":342,"code":2190,"language":345,"meta":346,"style":346},"public function alwaysSelect(): array\n{\n    return ['status'];\n}\n",[317,2192,2193,2206,2210,2225],{"__ignoreMap":346},[350,2194,2195,2197,2199,2202,2204],{"class":352,"line":353},[350,2196,490],{"class":489},[350,2198,493],{"class":489},[350,2200,2201],{"class":496}," alwaysSelect",[350,2203,500],{"class":364},[350,2205,503],{"class":356},[350,2207,2208],{"class":352,"line":389},[350,2209,509],{"class":364},[350,2211,2212,2214,2216,2218,2221,2223],{"class":352,"line":411},[350,2213,516],{"class":515},[350,2215,1082],{"class":364},[350,2217,538],{"class":364},[350,2219,2220],{"class":541},"status",[350,2222,538],{"class":364},[350,2224,1117],{"class":364},[350,2226,2227],{"class":352,"line":435},[350,2228,864],{"class":364},[990,2230,2231,2263,2272,2281,2295],{},[993,2232,2233,2234,1985,2237,328,2239,328,2242,1002,2245,2248,2249,2252,2253,2256,2257,2259,2260,2262],{},"A policy of the ",[317,2235,2236],{},"gates",[317,2238,337],{},[317,2240,2241],{},"map()",[317,2243,2244],{},"searched()",[317,2246,2247],{},"searchMeta()"," that reads a column that the search did not load throws ",[317,2250,2251],{},"MissingColumnException",", which names the resource, the column and the model. The search answers ",[317,2254,2255],{},"500",". List the column in ",[317,2258,2184],{}," or in the ",[317,2261,2142],{}," of the field that needs it.",[993,2264,2265,2267,2268,2271],{},[317,2266,2184],{}," returns ",[317,2269,2270],{},"[]"," by default. Its columns load without being returned.",[993,2273,2274,2275,2277,2278,2280],{},"A field that is not a column of the table, such as an accessor, must be declared ",[317,2276,334],{},", with ",[317,2279,337],{}," to return its value. A field that is not virtual is loaded as a column.",[993,2282,2283,2284,2287,2288,2291,2292,2294],{},"A relation that the model loads by itself, through ",[317,2285,2286],{},"$with"," or a ",[317,2289,2290],{},"with()"," in a scope, a global scope, an instruction or ",[317,2293,1266],{},", still loads: the search adds the keys that it needs.",[993,2296,2297,2298,2301,2302,2305,2306,2309],{},"Set ",[317,2299,2300],{},"rest.search.select_columns"," to ",[317,2303,2304],{},"false"," in ",[317,2307,2308],{},"config\u002Frest.php"," to load every column again. The fields of a row then come in the order of the columns of the table.",[866,2311,2313],{"id":2312},"errors","Errors",[340,2315,2318],{"className":872,"code":2316,"filename":2317,"language":875,"meta":346,"style":346},"{\n  \"message\": \"The selected search.sorts.0.field is invalid.\",\n  \"errors\": {\n    \"search.sorts.0.field\": [\"The selected search.sorts.0.field is invalid.\"]\n  }\n}\n","422 Unprocessable Content",[317,2319,2320,2324,2343,2355,2377,2381],{"__ignoreMap":346},[350,2321,2322],{"class":352,"line":353},[350,2323,509],{"class":364},[350,2325,2326,2328,2331,2333,2335,2337,2339,2341],{"class":352,"line":389},[350,2327,886],{"class":364},[350,2329,2330],{"class":489},"message",[350,2332,892],{"class":364},[350,2334,895],{"class":364},[350,2336,928],{"class":364},[350,2338,1132],{"class":541},[350,2340,892],{"class":364},[350,2342,1771],{"class":364},[350,2344,2345,2347,2349,2351,2353],{"class":352,"line":411},[350,2346,886],{"class":364},[350,2348,2312],{"class":489},[350,2350,892],{"class":364},[350,2352,895],{"class":364},[350,2354,898],{"class":364},[350,2356,2357,2359,2362,2364,2366,2368,2370,2372,2374],{"class":352,"line":435},[350,2358,903],{"class":364},[350,2360,2361],{"class":525},"search.sorts.0.field",[350,2363,892],{"class":364},[350,2365,895],{"class":364},[350,2367,1082],{"class":364},[350,2369,892],{"class":364},[350,2371,1132],{"class":541},[350,2373,892],{"class":364},[350,2375,2376],{"class":364},"]\n",[350,2378,2379],{"class":352,"line":457},[350,2380,984],{"class":364},[350,2382,2383],{"class":352,"line":479},[350,2384,864],{"class":364},[1480,2386,2387,2397],{},[1483,2388,2389],{},[1486,2390,2391,2394],{},[1489,2392,2393],{},"Message",[1489,2395,2396],{},"Cause",[1496,2398,2399,2411,2424,2433],{},[1486,2400,2401,2405],{},[1501,2402,2403],{},[317,2404,1132],{},[1501,2406,2407,2408,2410],{},"A field that sorts refuse, a relation path that is not to-one, the key of an aggregate that the level does not request or that does not sort, ",[317,2409,1577],{}," without text",[1486,2412,2413,2417],{},[1501,2414,2415],{},[317,2416,1010],{},[1501,2418,2419,2420,1002,2422],{},"A direction other than ",[317,2421,1001],{},[317,2423,948],{},[1486,2425,2426,2430],{},[1501,2427,2428],{},[317,2429,1993],{},[1501,2431,2432],{},"A field that selects refuse",[1486,2434,2435,2440],{},[1501,2436,2437],{},[317,2438,2439],{},"The search.sorts field must not have more than 20 items.",[1501,2441,2442,2443],{},"More sorts than ",[317,2444,2445],{},"rest.limits.sizes.sorts",[2447,2448,2449],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .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);}",{"title":346,"searchDepth":353,"depth":389,"links":2451},[2452,2458,2461,2462],{"id":868,"depth":389,"text":869,"children":2453},[2454,2455,2456,2457],{"id":1125,"depth":411,"text":1126},{"id":1170,"depth":411,"text":1171},{"id":1316,"depth":411,"text":1317},{"id":1570,"depth":411,"text":1571},{"id":1668,"depth":389,"text":1669,"children":2459},[2460],{"id":2001,"depth":411,"text":2002},{"id":2164,"depth":389,"text":2165},{"id":2312,"depth":389,"text":2313},"Order search rows by fields, to-one relation fields, aggregates or relevance, and choose the fields that each row returns.","md",null,{},{"title":76,"description":2463},{"loc":77},"tVr3g5G0HViu7EcqYoBVCar_VEThA9SiAHoX12Ds9pI",[2471,2473],{"title":72,"path":73,"stem":74,"description":2472,"children":-1},"Keep the rows that match conditions on fields, relation paths, pivot fields and related rows, with the operators that each field type accepts.",{"title":80,"path":81,"stem":82,"description":2474,"children":-1},"Load related rows with their own search and a limit per parent, read @more, and add count, exists, min, max, avg and sum values of relations.",1794181354559]